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

Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
2
Views
58
Hello, I have a question about an encoder that has absolute measurement. Specifically, it's the Lika SMA5, which I would like to connect...
Replies
0
Views
34
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
284
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
99
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
135
Back
Top Bottom