Real to INT RSLogix5000 FBD

Roy Matson

Member
Join Date
Apr 2004
Location
Vancouver
Posts
465
Hi,
I have a project using RSLogix Function Block Diagram and a Prosoft Profibus module to communicate with a Siemens DCS
My problem is it has been decreed that the data transfer will be INT, apparently the Siemens system swaps bytes around making it difficult to handle Real data, besides the Prosoft data table is INT
Most of my data is in small numberes e.g. 0.0 - 1.0 gpm

My solution is to multiply the Real by 1000 then tie the result into the Prosoft data table, this seems to work except the data appears in the next cosecutive word i.e. if I connect to word ProsoftDataTable[56] I see the answer in [57]

Rockwell support solution was to multiply as I have done then Copy the result to the data table but FBD doesn't have a Copy block that I can see.

What's the elegant solution?

Thanks in advance

Roy
 
Last edited:
Ron,
I am doing something like that, the multiply block is real x real and the result (your RH connection is the Prosoft word ProsoftData[56] an INT word. If I look at the data table the result is in [57]
Ithought the result would overflow to word [56] as [57] passed 32000 but it doesn't.
Clicking help on the Multiply block seems to indicate it will handle INT, DINT or Real data.
Thanks
Roy
 
Last edited:
The difference between a copy and a move is that a move does data type conversion and copy performs a bit to bit copy without any conversion. This is sometimes important when real data is transferred over a communication link as 16 bit words. Two 16 bit words are transferred to represent a 32 bit IEEE754 floating point number.

In FB there isn't a COP function equivalent. Instead, use the AND function block and use #16FFFF for source B. This will place the source bit pattern into the destination word without conversion.
 

Similar Topics

Hi all. Me again still learning Rockwell. So I'll be polling an INT data array from a Modbus SE power meter with a L82 (with a Modbus ProSoft in...
Replies
56
Views
1,383
I seem to be making this harder than it should be, and Its not making any sense. I simply need to move a real variable to two integer variables...
Replies
8
Views
979
Situation: Single [EQU] instruction with single [OTE] on a rung, nothing else/simple. [EQU] operand(A) is a real number data type...
Replies
16
Views
2,592
I work at a cheese factory and we recently ran into a problem where in an older controller they where able to use a REAL Data type in OTU and XIC...
Replies
13
Views
2,586
Hello I have a question about SCL if I have a real value like valor: INT I would do valor : = 1.5 Or this trhow me an error? How can I save...
Replies
6
Views
1,678
Back
Top Bottom