I second this request.
It would be very helpful to have high level commands to query and set the analog scale values from a chart or OptoScript.
The addition of two operations:
- SetAnalogFullScale(ioName, newFullScaleValue)
would allow programmers to add logic to access and manipulate analog scaling values.
These functions would be useful in applications where the end equipment users can make equipment modifications in the field. We would like to limit device specific changes to a single configuiation include file, so when we update software, we do not overwrite device specific changes.
The config file would contain the scaling factor for this specific device:
100.0 ^ConfigMyConfigurableMfcFullScaleFlowInSCCM @!
500.0 ^ConfigMyConfigurableMfcFullScaleFlowInSCCM @!
Code-wise, it would look like this:
, in the Power Up chart:
in other charts, the current full scale value could be accessed as follows:
UserSetpointError = (SetPointFromUser > GetAnalogFullScale(MyPresetMfc));
Apparently, the hardware memory map can be used to access this information, however there are drawbacks to using the hardware memory map –
- Figuring out what memory address is to feed to the ReadNumTableFromIoUnitMemMap() function is, well, painful and prone to error.
- If the Analog I/O point is ever moved, there are now multiple places in the strategy that need to be changed.
- Embedding the scale value in the controller configuration make it difficult to install logic upgrades on devices as we sometimes need to make other changes to the controller configuration.