|
Exercise: Using the Scale Mode feature with real tags
In this example, a Celsius temperature acquired from a remote tag will be converted to Fahrenheit using the Scale Mode feature.
Create two INT (INT16) tags named “Celsius” and “Fahrenheit”. Enter the I/O Device and address as shown below.(Note: In this example, the user has already defined an I/O device named “PLC.STATION”. If your I/O device has a different name, then enter that name into the I/O Device field. Likewise, if the I/O address format is different, use the correct format for your PLC).
Click and expand the Advanced tab for the “FAHRENHEIT” tag > click the Scale Mode drop-down menu > Linear Slope > double-click on do“1.8” for Slope and “32” for [Intercept].
c) Go to [Insert] > [Textbox] and draw two text boxes on the main screen. Select these textboxes, then open the [Property Editor] tab and expand the [Appearance] tab. In this tab, select the [Text] field and click the icon. This will open the [Binding Properties] tab. In this window, click the
icon to assign the desired tag. Assign the ‘Celsius’ and 'Fahrenheit’ tags to their respective text boxes.
d) Download the project to an Xpanel device. Verify that the value from the PLC is transferred to the remote tags and visible via the text box. The tag value should be converted from Celsius to Fahrenheit. Note: In this example, both tags are reading an integer from the D00 device. Make sure that your PLC program is storing a 16-bit integer value to the D00 device, and that communication with the PLC is properly configured in Canvas.