Ok, that’s helpful to know that the issue seems to be internal to the Toolbox system, rather than occurring during transmission between the Toolbox and the KepServerEX. The whole behavior of the slider seems a bit odd in your system, so I’d suggest creating a backup of your current version and downloading a fresh copy of the core-addon from our GitHub to make sure nothing’s been corrupted.
To adjust the scale of the slider using the unitMin and unitMax, you can directly edit the tools/slider/index.html
file.
Look for the line
realityInterface.write('value', properties.value);
and replace it with something like:
let unitMin = 0;
let unitMax = 100;
let unitLabel = undefined; // can be any string, example: 'meters', 'kg', or undefined if you don't need this
realityInterface.write('value', properties.value, 'f', unitLabel, unitMin, unitMax);
Try connecting the updated slider to a graph, and you should see it display the scaled value like this:
The debug value on localhost:8080 will still show the unscaled value (in my screenshot, 0.6517…), but the node now contains the right metadata for listeners (such as the graph tool) to scale it to the correct range.
Looking at this again, I have one more suggestion for what you may need to do. It is possible that you can just use a default slider (sending the 0 to 1 range of values) if you also configure the Min and Max of the tag in the Kepware Hardware Interface. If you go to localhost:8080 and click on the Manage Hardware Interfaces tab, and then click on the yellow gear next to the kepware field, you should see a list of configurable properties. At the bottom (at least in the old Kepware interface, this might have changed with the OPCUA version), you will see a “Configure tags” section, and if you Edit your tag you can type in a new Min and Max for its range, for example 0 and 100. This means that when the Toolbox node receives a value of 1, the interface should send the PLC a value of 100.
I haven’t tested this recently myself, as I don’t have hardware on-hand, and perhaps you’re already doing this step, but I just wanted to add it in case this is what I missed the first time.
Best,
Ben