4.1.5 Exercise

This section gives an illustrative example of using the tag scaling feature. Your settings may be different depending on your project’s configuration.

Exercise: Using the Scale/Offset feature with real tags

In this example, a Celsius temperature acquired from a real tag will be converted to Fahrenheit using the Scale/Offset feature.

a) Create two analog tags named ‘Celsius’ and ‘Fahrenheit’. Set the tag type to “Real Tag” and 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, then use the correct format for your PLC).

b) Go to the [Advanced] tab in the editing menu for the ‘FAHRENHEIT’ tag. Check the [Scale] option, then enter “1.8” for Scale and “32” for Offset.

c) Go to [Draw] – [Dynamic Tag] and add tag value objects to display the Celsius and Fahrenheit tag values. When you configure the dynamic tag object, assign the ‘Digit Number’ and ‘Decimal Point’ options to 6 and 2, respectively. Otherwise, the displayed values will be rounded.

Tag Name

CELSIUS

Display Format

###.##

Tag Name

FAHRENHEIT

Display Format

###.##

d) Download the project to an Xpanel device. Verify that the value from the PLC is transferred to the real tag and visible via the dynamic tag. The tag value should be converted from Celsius to Fahrenheit. Note: In this example, both tags are reading an unsigned integer from the D0 device. Make sure that your PLC program is storing a 16-bit integer value to the D0 device, and that communication with the PLC is properly configured in XpanelDesigner.