Change tag Units using instances and scripts

A forum devoted to the discussion of all topics having to do with scripting and other advanced programming using iX Developer.
Post Reply
Douglas50
Posts: 3
Joined: Wed Sep 25, 2013 1:53 pm

Change tag Units using instances and scripts

Post by Douglas50 »

Hi I was just wondering what solutions anyone else is using for changing units from metric to imperial on an HMI when using aliases already. i.e.4 different motors displayed on the HMI depending if instance 1 to 4 is selected. Is there a good for units to change when using aliases? I was thinking of a script that could be written that would change from instance 1 ( metric ) to instance 5 ( which would be the imperial version of motor 1 ) when the units button is selected. And if you hit the units button again it goes back to instance 1( metric ). So maybe a comparison of what instance is active and change instances based on the state of the units button. Make sense? Any way to script this or better solutions to this problem?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: Change tag Units using instances and scripts

Post by mark.monroe »

This forum post talks a little about scripting with aliases.

Most people use expressions to convert between one scale and another. Expressions are associated with Analog Numeric boxes. The problem with using expressions occurs if you need to send data back to the PLC. Expressions will take the PLC value and change it. But it will not take the value inputted into the Analog Numeric box and convert it back to PLC units.

The tag scaling will do that for you. It converts both ways. However, there is no way to turn scaling on/off. It is either on or off and you define that at design time.
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

Post Reply