S7-1200

Ramsri

Member
Join Date
Apr 2014
Location
coimbatore
Posts
40
i need to extract the floating numbers from s7-1200 Registers.

Ex: registers value will be 3.1256421

I want to make this one as 3.125 only first 3 of the floating values. i guess we need to use some shift register ins for getting the above said.

Is there any special instructions are available to do like this in 1200 software.
 
floating point number is not stored on some conventional way so shift would not help. you could, for instance, make it one register for whole number, one for fraction, that extract 3 digits from fraction part and represent it as integer second register

EDIT:
something like: decimals = int ( float(x)-int(x) ) * 1000 )
 
Last edited:
Multiply by 1000 then use the ROUND function (in the Convert section), using datatypes of Real to Real, then divide by 1000. That should do it, though I haven't given it a try.
 

Similar Topics

Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
213
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
71
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
117
commentaire communiqué siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
119
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
170
Back
Top Bottom