Cmos

convert Real to two int to pass to/from modbus tcp/ip

6 posts in this topic

My customer has process skid with an Allen Bradley Compactlogix with EtherNet IP that will need to communicate with their ABB DCS system. I am planning on using the Prosoft PLX32-EIP-MBTCP Ethernet IP to Modbus TCP/IP converter.

When I create the Ethernet module in the Compactlogix, the EDS for the prosoft creates the memory as 496 In / 496 Out SINT format to pass back & forth.  I will need to get and send temperature and pressure values and setpoints that are real values in the compactlogix, for read / write control on the DCS system HMI.  The DCS will use Modbus registers (example: 4000 & 4001)  to store a real value. I need to put the real tag value into that format in the Compaclogix to output to the DCS, then convert the input from the DCS back into real for use in the Compactlogix

 It seems like there is very little info on performing this conversion. Any help would be greatly appreciated.

Thanks

Share this post


Link to post
Share on other sites

Look under the Move/Logical tab and take a look at the BTD Bit Field Distribute routine. You can assemble two words of data into a float with that. Bear in mind that the Modbus standard isn't. Some people put the MSW first / LSW last. Some put LSW first / MSW last. And there's the evil mad scientist group that does a byte swap on each word and incorporates the MSW/LSW trickery. But, BTD, can sort it all out if you can figure out what their version of Modbus doing to the data

Edited by Michael Lloyd

Share this post


Link to post
Share on other sites

If the DCS doesn't support Contrologix EIP than I suggest the folllowing;

  1. Shoot the DCS (it's probably senile anyways).
  2. Slap a redlion DSP in to perform protocol conversion.
  3. Moxa makes an EIP to modbus gateway that isn't a complete nightmare
  4. kepware but if the DCS can't do EIP I'm afraid it might not do OPC.
  5. Throw a ML 1400 in there since the contrologix can read and write to it and it can be setup to do modbus tcp.

Do not do the following;

  1. Ask why they didn't order a compatible skid
  2. Forget to get a signed change order, work order, or purchase order.
  3. Tell anyone it's the engineers fault. (Yes, I know it is but no one will ever admit it.)
  4. Try to get that horrid modbus routine for contrologix to work on a live system.
2 people like this

Share this post


Link to post
Share on other sites

Using a COP instruction in Logix is all you need.  You don't need BTD or anything special.  Copy from a Real to INT/SINT then send the result to the Modbus device, and when reading a float, copy from the INT/SINT to the Real tag.  Depending on the byte/word order, you may need to do swapping, which you can do in the gateway.

Share this post


Link to post
Share on other sites

i think to use the real data (Floating point tags) you should configure it from the PLX3xx prosoft configuration, and then you can get the real data by CIP message into your PLC.

i am already used the PLX3xx modules but not for real data, but you can read the user manual from pages 53, 54 .....

Share this post


Link to post
Share on other sites

y2kmfic is right, transfer data in any form you like and on AB side use COP instruction to transfer data bit by bit from one type to another. 

another option is to simply do the conversion yourself. programming is all about putting code together to perform some task and 32-bit REAL numbers are not something obscure, format is well documented, check Wikipedia or whatever source you like. data manipulation is essential but very handy skill. don't be afraid to invest some time when possible to do such conversion yourself. it is a good exercise. 

 

https://en.wikipedia.org/wiki/Single-precision_floating-point_format

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now