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:
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:
|