Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Geo SCADA Knowledge Base
Access vast amounts of technical know-how and pro tips from our community of Geo SCADA experts.
Link copied. Please paste this link to share this article on your social media post.
Originally published on Geo SCADA Knowledge Base by Anonymous user | June 10, 2021 01:03 AM
TYPE ModbusAlgTagName : DATABASE_OBJECT(CModbusPointAlg) FullScale : INT; ZeroScale : INT; FullName : STRING; END_DATABASE_OBJECT; END_TYPE PROGRAM ConfigurePoints VAR_INPUT sGroupFullName : STRING; END_VAR METHOD CallSub AT %M(.Sub.Execute) : STRING; END_METHOD VAR ModbusAlgTags AT %S(SELECT Id, Units, FullScale, ZeroScale, TrendMaximum, TrendMinimum, FullName FROM CModbusPointAlg WHERE FullName LIKE ? || '%') : RESULTSET OF ModbusAlgTagName WITH_PARAMS sGroupFullName; END_VAR VAR iRangeMax AT %I(.Range Max) : INT; iRangeMin AT %I(.Range Min) : INT; END_VAR WHILE ModbusAlgTags.Valid DO ModbusAlgTags.Value.FullScale := iRangeMax; ModbusAlgTags.Value.ZeroScale := iRangeMin; CallSub(ModbusAlgTags.Value.FullName); ModbusAlgTags.Next(); END_WHILE; END_PROGRAM
PROGRAM Sub VAR_INPUT FullName : STRING; END_VAR VAR CtrlMax AT %M({FullName}.Control.ControlMaximum) : INT; CtrlMin AT %M({FullName}.Control.ControlMinimum) : INT; Enabled AT %M({FullName}.Control.$Enabled) : BOOL; END_VAR VAR iRangeMax AT %I(.Range Max) : INT; iRangeMin AT %I(.Range Min) : INT; END_VAR IF Enabled THEN CtrlMax := iRangeMax; CtrlMin := iRangeMin; END_IF; END_PROGRAM
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.