Double word data

60Hertz

Member
Join Date
Mar 2007
Location
Illinois
Posts
1
Hi all. I am new to PLCS.net and have looked at several previously posted threads in hopes of finding the answer to my question; to no avail (it could still be there). I have a SLC 5/05 with a 1747-SDN card and am communicating to two Kollmorgan S300 servo drives. This is also my first DeviceNet project, but I managed to get the drives talking, commanding through polled I/o and some commanding over explicit messaging. Now for the question. To get a current fault code, you have request it over explicit messaging. When I request the data, I move 32 words of data from the M1 file to N23. According to the Kollmorgan documentation the structure of the returned data is:

TX_ID/TX_Status (byte1 and byte0).Word0 (N23:0)
Port=0/MSG_SIZE in bytes..........Word1 (N23:1)
Service/MACID in bytes............Word2 (N23:2)
DATA..............................Word3-31 (N23:3 through N23:31)

Simulating a faultcode 16 or 0x8000(missing main supply feed). When I request the fault code, I get a value of 4 in N23:1 (number of bytes) and -32768 in N23:3 and 0 in N23:4
I realize this number is exceeding my 16 bit word, but am no sure how to make sense of it?
I also have a similar situation whereby I am reading the actual postion, mapped to I:1.3 and I:1.4. The value of I:1.3 will go into the negative numbers and I:1.4 will then hold a value. I would like to bring them together to a single value to compare against such that when actual equals a preset, then stop the motor.
Any help would be greatly appreciated.

Regards.
 
The returned value is occupying two sequential registers, oriented "LSW/MSW" (Least Significant Word / Most Significant Word).
If you look at the bit patterns of the N23:3 and 4 registers, you will see:
N23:3 - 1000 0000 0000 0000 N23:4 - 0000 0000 0000 0000
Converting the nibbles to hex, you get:
N23:3 - 0x8000 N23:4 0x0000
Since it appears to be Least Significant Word first, if you re-assemble them in the proper order, it would be: 0x00008000

The '8' in the high bit position of the LSW is interpreted by the SLC as a sign bit, since it only deals with signed integer math.

If you search here, there have been a few posts about converting two 16 bit integers representing a 32 bit value into a float, but a float can't represent the full domain of a 32 bit integer value.
 

Similar Topics

Hi guys I'm having some weird data conversion issue over modbus happening. And I found a post here before that is similar to what I'm seeing but...
Replies
6
Views
7,173
Hi! I am using a TM200CE40T PLC from Schneider to write data over Modbus. I have used Memory words (%MW) before using the Write variable...
Replies
1
Views
533
Hi, I am currently reading a Modbus value from a Device, through TCP, going into our 400 series plc. The Modbus value is a real value, and it is...
Replies
27
Views
7,592
Hello How to convert dword to bit in Siemens plc s7؟ Thank you
Replies
15
Views
2,796
Hi, In Proficy Historian I have a tag connected with Double Integer / DWord configuration. In the PLC it is a Time format. Can that be a problem...
Replies
0
Views
1,206
Back
Top Bottom