![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() 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! |
|
|
|
#2 |
|
Member
![]() 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?
|
|
|
|
#3 |
|
Lifetime Supporting Member
|
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! |
|
|
|
#4 |
|
Member
![]() 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.
|
|
|
|
#5 |
|
Lifetime Supporting Member
|
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." |
|
|
|
#6 |
|
Member
![]() Join Date: Jan 2008
Location: vancouver
Posts: 269
|
Thanks OKiePC,
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 | |