|
Exercise: Using the Scale Mode feature with real tags
In this exampleexercise, a Celsius temperature acquired from a remote tag will be converted to Fahrenheit using the Scale Mode feature.
Create two REAL (FLOAT) tags named “Celsius” and “Fahrenheit”. Enter the I/O Device and address as shown below.
(Note: The user has already defined an I/O device named “PLC” in this example. 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 form 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 the Slope field and input “1.8”, and for Intercept, input “32.0”.
Click Insert > Text and draw two text boxes on the main screen or use the Text object from the toolbar as shown in the GIF below. Select a textbox, open the Property Editor pane and expand the Appearance tab. Select the Text field in this tab and click the link icon. This will open the Binding Properties window. In this window, click the tag icon to assign the desired tag. Assign the Celsius and Fahrenheit tags to their respective text boxes.
(Note: Alternatively, tags can be assigned to parameters within the Property Editor by drag-and-dropping the tags from the Tag Editor, as shown in the below GIF.)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: Both tags read a float from the D00 device in this example, but the Fahrenheit tag is scaled. Make sure that your PLC program is storing a 32-bit float to the D00 device and that communication with the PLC is configured correctly in Canvas.
...