ID:KB000012.htm
Question:

Can an integer number deriving from a PLC with one or more decimal figures be displayed?

Answer:

This function can be obtained in various ways. It is however fundamental to establish whether the variable is in read only or whether it can also be written by Movicon:

 

Read only variables:

In this case you simply set the variable in the Movicon Real Time DB of the same type of  that of the PLC, Word for instance, and then insert it in the display or rectangle object's 'Text' animation property by setting it as "x.x" "x.xx" format etc., according to the decimal figures to be displayed. This means that if the value in the variable is "9999" it will show as "99.99" in the display object set as "x.xx". Be careful however and remember that this is only for display purposes and that the value of the Movicon variable is always "9999".

 

Read/Write variables:

In this case the variable's "Scaling" properties can be used. The value arriving from the PLC can then be scaled and written in the variable from the Movicon Real Time DB. You must consider that in order to manage decimal figures in this case, the variable from the Movicon Real Time DB must be floating point type. In this situation, assuming that you have to read/write a variable which is Word type in the PLC, you have to carry out the following operations:

 

  1. Set a Float type variable in the Real Time DB

  2. Dynamically link the PLC variable to the Movicon variable by using the variable's "Dynamic" general property

  3. Enter the "1" value in the "#Elements" property in the task pane. By doing this only one item will be ready from the PLC, being one Word therefore 2 bytes, even when the Movicon variable is Float type therefore 4 bytes

  4. Enable the "Enable Scaling" check box in the variable's "Scaling" properties and set how the PLC's value scaling in the Movicon variable is to be

 

Another way would be to exchange the variables with the PLC with the same format, then use the "Scaling Object List for scaling the variables read in other dummy variables. And in this case the dummy or scales variables must be Float types. The advantage you get in this case is that the scaled variables are not  exchanged with the driver and therefore the license byte number count is lower.

References:

Additional query words:

Variables, Scaling, Engeenering