You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old July 29th, 2009, 11:42 AM   #1
wilsonzhu
Member
Canada

wilsonzhu is offline
 
Join Date: Jan 2008
Location: vancouver
Posts: 269
modbus registers map to controllogix data type

Hi all,

When programming modbus communication, we need to map the registers to AB Controllogix Data type. Is the following Modbus registers mapping correct?
signed 16 bits(INT),
unsigned 16 bit(I don't know,pls tell me),
signed 32 bits(DINT),
unsigned 32 bits(LINT),
floating points(REAL)
Thanks a lot!
  Reply With Quote
Old July 29th, 2009, 11:58 AM   #2
wilsonzhu
Member
Canada

wilsonzhu is offline
 
Join Date: Jan 2008
Location: vancouver
Posts: 269
I check the help file, LINT is for 64 bits, Does it mean in controllogix all Int type is signed INT? Then how to map unsigned modbus register to controllogix via prosoft modules?
  Reply With Quote
Old July 30th, 2009, 06:33 AM   #3
rdrast
Lifetime Supporting Member
United States

rdrast is offline
 
rdrast's Avatar
 
Join Date: Apr 2003
Location: South Carolina Lowcountry
Posts: 3,650
You can 'create' a Long Int type with a UDT, but it's not a native Logix type.

All integer datatypes are signed (SINT, INT, and DINT), there are no unsigned versions, but as long as you are aware of that, you can move an unsigned value into a signed type without a problem. 'X' bits is still 'X' bits, the sign only matters in how a value is calculated and represented.
__________________
------------------------------------
How to ask questions the SMART Way!

Look First, Ask Second!

  Reply With Quote
Old August 4th, 2009, 12:10 PM   #4
wilsonzhu
Member
Canada

wilsonzhu is offline
 
Join Date: Jan 2008
Location: vancouver
Posts: 269
So, if the device use unsigned value, and it's automatically convert to signed type in controllogix. for example of Int type, if the value in PLC is -5, actually it represents 32768 + abs(-5) for actually value in device, I have to create another DINT to store this positive to show up in HMI. Is it Correct? Thanks.
  Reply With Quote
Old August 4th, 2009, 12:52 PM   #5
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 7,553
Actually, in the HMI you can (probably) choose unsigned and it will show up correctly.

There is no "automatic conversion to signed type". It is just how the math instructions and RSLogix treat the most significant bit.

If you need to manipulate the values with PLC code, then, yes, you need to deal with the sign bit properly depending on the operation. But, if they are just being displayed, see if you can choose unsigned data type in the HMI and get the correct values.
__________________
A rebel who's taking a pause.

It's not all the variables I am most concerned with, it's the undiscovered constants.

"You can lead a horse to water but if he's got his head up his as$ he may die of thirst anyway."
  Reply With Quote
Old August 4th, 2009, 12:56 PM   #6
wilsonzhu
Member
Canada

wilsonzhu is offline
 
Join Date: Jan 2008
Location: vancouver
Posts: 269
Thanks OKiePC,
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
ControlLogix as modbus master help CEMMaster LIVE PLC Questions And Answers 5 November 24th, 2008 02:14 PM
PLC5 Registers to ControlLogix dadara LIVE PLC Questions And Answers 11 August 20th, 2008 09:16 AM
MPI comunication Manuel Raposo LIVE PLC Questions And Answers 22 July 16th, 2007 06:24 AM
Devicenet Error Code 77 ganutenator LIVE PLC Questions And Answers 21 April 4th, 2007 07:31 AM
how can i convert the data received in modbus formate to other format? LIVE PLC Questions And Answers 7 February 2nd, 2004 02:43 AM


All times are GMT -5. The time now is 01:49 AM.


.