In training and struggling with an exercise

Working on a graphics page and am trying to add the min/max portion of the facets from a Numeric Writable point. I thought using the bound label and format text would be the way to go. Ultimately I am adding a widget, bound label, check boxes for format text (%out.value%), status, border, and Make display. I was thinking the formatted text might need more, but at this point I am turning to you all for assistance.

TIA

So you cannot use numeric writables to write to a BFacet type. You’d need a program object. Depending upon how often you’re using this, it would probably be best to put it in a module.

The biggest question is why though? Are you trying to prevent a setpoint overlap of some point? Is this a spec requirement.

Just trying to display the min max range on the graphic next to the set point. It’s in the exercise example and was just struggling to get that part of the facet to display. Measurement(C°) and precision np, but min/max….

What training example is requiring this? I don’t know of any training materials that uses this as an example.

Again, to reiterate, that’s a part of BFacets. I don’t know if they can be separated.

I’ve written to BFacets min and max to prevent setpoint overlap.

I am taking the training with ThinkTec. It was paid for by my company. It is self paced and this was at the end of the Modbus module. Able to get the point name and %out.value% for the set points as you can see. The min/max in the square brackets is what I was hoping to insert, where it would change if the values in the facet were changed.

So those look like setpoint field editors.

However, as I said before, facets can’t just be exposed to be written two with numeric writables. You will need program object that executes the min facet value and max value on change. You can’t just expose them on the graphic.

To clarify, you can add the facets slot to a graphic and use %min% and %max% to get read them separately but you will need an object that writes to those. You could feed numeric writables into that object, but you cannot just feed them in individually.

Awesome, thank you for your patience. I will give it a run here shortly.

You would need something like this:

private static final BUnit FAHRENHEIT_UNIT = UnitDatabase.getUnit(“fahrenheit”);
private static final int PRECISION = 1;

public void onStart() throws Exception
{
updateTemperatureSetpointFacets();
}

public void onExecute() throws Exception
{
updateTemperatureSetpointFacets();
}

private void updateTemperatureSetpointFacets()
{
double spMin = getSetpointMin().getValue();
double spMax = getSetpointMax().getValue();

 setSetpointFacet(createTempFacet(spMin, spMax));

}

private BFacets createTempFacet(double min, double max)
{
return BFacets.makeNumeric(FAHRENHEIT_UNIT, PRECISION, min, max);
}

You could create a timer function and allow it to write on a timer after you add the min and max values. I would always start by updating the max first, then the min value

So perhaps I missed something. Is the ThinkTech class requiring you to figure this out or is this just something you’re interested in?

Ok, the guys from thinktech got back with me. Apparently it is in the kitPx palette.

SetPointFieldEditor

This provides the Value and the range from the point. He also gave me the bformat;

Bound label

%facets.units% [%facets.min% - %facets.max%]

Tried it both ways. Either way it is a 2 step process to get the full line of text for the graphic.

I said this was a setpoint field editor in one of my first messages. I thought you were looking for a way to change the min and max facets through numeric writables.

Yep, over looked that in the top of the message it was sent in. That would be a lack of knowing what I was looking for. Didn’t even realize that was an answer when it was given. My bad. I do appreciate you sticking it out with me though.

No worries at all! Wasn’t sure what you were asking specifically but now there’s a program object that’ll do what you’re asking.