Real to bit

gsirin

Member
Join Date
Aug 2006
Location
Ankara
Posts
7
Dear sir,

There is a level data coming from another station, and it is REAL. This data should transfer another station over my redundant (414-4H) S7-400 CPU. All connections between CPU's are o.k. And the second station has requested this level data like below;

Level_05 : Bool ; //Level Bit_05
Level_06 : Bool ; //Level Bit_06
Level_07 : Bool ; //Level Bit_07
Level_08 : Bool ; //Level Bit_08
Level_09 : Bool ; //Level Bit_09
Level_10 : Bool ; //Level Bit_10
Level_11 : Bool ; //Level Bit_11
Level_S : Bool ; //Level Bit_Sign
Mv_Ovf : Bool ; //Level Meas. Value Overflow
Mv_Trf : Bool ; //Level Meas. Value Transmitter Fault
Mv_Sp : Bool ; //Level Meas. Value Spare
Level_00 : Bool ; //Level Bit_00
Level_01 : Bool ; //Level Bit_01
Level_02 : Bool ; //Level Bit_02
Level_03 : Bool ; //Level Bit_03
Level_04 : Bool ; //Level Bit_04


I only can manage my CPU, not others. How can i do this? I need help urgently.

Regards
 
Is it realy bit shifted like that? or is it just scrolling over your screen Bits 00 thru 11 look like a standard Integer word (12 bits). Try injecting a signsal, say 25% then displaying the word in different formats e.g. Integer, Binary, you may find one makes sense. As you increase your signal you will see mor bits turning on and you csn compare the binary patern with the number you see.
Hope this helps
Roy
 
Are your two devices communicating over a serial link. Sometimes that can be the cause of miss communication if the baud rate, and other parameters are not set correctly.
 
No they are not. There are iso on tcp connection over CP cards between cpus.
Do you have any example, it will be very helpfull.

Regards.
 
Real to Bit

Hi Thank you for answer,

i tried to implement your code to my system but i couldnt.

there are some print screen, can you tell me the what is the problem ??

thank you.

convrt-a.JPG


convrt-b.JPG
 
I think you should be stating what the problem is !

Your screen shot shows a real value of 3.02 being passed in which is converted and results in Level_Bit_00 and Level_Bit_01 being true and all other bits being false which is the equivilant of 3
 
yes you are right. but i need also the digits after "." i mean the result should be 3.02 not only 3.

at the second station "3" means "0.01" . these 2 data should have the same value. but they arent.

How can we do ??
 
Last edited:
[font='Arial','sans-serif']this is the last send and response data[/font]
[font='Arial','sans-serif']
0-0.000
16-0.005
32-0.010
64-0.020
128-0.045
256-0.085
512-0.175
1024-0.350
2048-0.700
3072-1.050
4096-1.400
6144-2.100
8192-2.800
9368-3.200
12288-4.200
16384-5.600
regards.[/font]
 
Last edited:
Hello,

I have solved my problem. i used "unscale" function for the real value and then transfer the second station and it is working.
emotion-5.gif


Thanks for your helps.

Regards
 

Similar Topics

The topic of reading or writing floating-point values via Modbus seems to come up regularly, and it is to my mind not that difficult. That said...
Replies
0
Views
1,352
Hello, First, please excuse my question I am new to Modbus. I have a CX-5140 control unit from Beckhoff and an instrumentation device that...
Replies
3
Views
3,022
I am having problems expressing an ANALOG OUTPUT 16bit INT word (0-10V Proportional Valve Voltage) as a REAL decimal number. From my...
Replies
6
Views
9,052
DearAll, I have a problem in coverting 48bit integer to Real.Kindly see the details as below System:- compactlogix L43 With MVI69-MCM...
Replies
1
Views
1,694
I had a real world problem at work today. To be clear: I am not a programmer or plc guy. I am a BUBBA! I know enough to be dangerous. Since, I am...
Replies
18
Views
6,874
Back
Top Bottom