Bugger 4 SINTS to A real

asterof

Member
Join Date
May 2007
Location
Califonia
Posts
554
So I know how to convert two Ints to a Real
But how do you convert 4 SINTS to a real
SINT[4]
SINT[0] = 0
SINT[1] = 1
SINT[2] = 10
SINT[3] = 1

Any ideas
Its a GPM flow rate from a Modbus RTU meter
read by a Anybus module that reads in SINTS
 
I'm assuming that you mean that the 32 bits of the REAL were split into four 8-bit chunks (SINTs), and you need to stitch them back together?

If you're using RSLogix 5000, just use a COP or CPS instruction.

COP SINT[0] RealValue 1

Note the length of 1 - that's because the length is in terms of destination elements. If your destination element is a REAL, it will grab 32 bits of data, starting with SINT[0], and slot them all into the the REAL in order.

If you're using another platform, give us some more details and we'll try again!
 
what happens is

lets say there is a floating point in the meter 40001 and 40002
the Anybus module is like a Prosoft modbus module
except it breaks 16 bit Ints into 8 bit Ints
so to have the Anybus module read the float
you specify as this
Length 4
read 40002 length of 4
so you get back 4 SInts that need to be turned back into a Real
 
Yep - the COP or CPS instruction will do it for you as above. The only thing you'll have to check is the byte order - you may need to use a SWPB instruction or swap them around before you use the COP if it uses different encoding
 
Hi

I would check your setup of the anybus module I am almost sure you can select
That the information comes in as int
It would be easier for you

Donnchadh
 

Similar Topics

Is there a debugger yet for Logix programs? Something that would let me step through a program with watches and breakpoints?
Replies
2
Views
1,655
Hi. I am writing VB Script in WinCC but cannot open the debugger to debug it. I installed the one from Microsoft but none pops up when I hit...
Replies
2
Views
7,564
We have an AB system that is connected to several CANbus networks via HMS gateways. A CAN message is comprised of upto eight, eight-bit bytes...
Replies
0
Views
1,411
We have a IFM DTE102 RFID Reader. PLC is L82E v32 It presents the results into an array of SINTs, I have to select HEX as the style in the tag...
Replies
7
Views
2,242
Hello, I will try to be as succinct as possible, and hopefully this will make some sense. Say, in Logix Designer, I have a generic Ethernet...
Replies
5
Views
5,061
Back
Top Bottom