nhicks
Member
As you can see from the title, I have a number of questions/issues;
Two different situations/issues:
1. Im reading Oil Pressure and Fuel Pressure over J1939 through a Pyramid Solutions Bridgeway. Im getting the data in, im just having issues getting the correct display. When either the fuel or Oil pressure reaches 75 (PSI, after being converted from kPa)- the number turns negative and start decreasing by 2 (-73, -71, -69) although the pressure continues to rise. The data comes into a SINT. I tried moving bit for bit to a INT to try and defeat the signing - but that didnt work, same problem. Im starting to wonder if this data is coming across as Twos complement?
I have zipped and attached the logix5000 file, a quick reference:
Raw Binary data is read into AB7645:I.Data.9 (Oil Pressure) - and you can see under the J1939 subroutine, where I tried to cheat and move bit for bit into CAT_J1939_OIL_PRESSURE. Before that, I used a COP command from AB7645:I.Data.9 into CAT_J1939_OIL_PRESSURE which was also a SINT. Rung 2 of the J1939 subroutine takes the incoming value times 4 (to give kPa.) Then rung 3 takes the oil kPa times .14503 to give PSI.) That value (AB_J1939_OIL_PRESSURE) is what im displaying on the HMI.
2. Im trying to read Current across Modbus RTU, from a G.E. 489 Generator protection relay. The data type is listed as the following "2's Complement, Signed Long Value" 32bits total - 1st 16 bits are High Order Word of Long Value, 2nd 16bits are Low Order Word of Long Value. Example; -123456 stored as -123456 (i.e. 1st word: FFFE hex, 2nd word 1DC0 hex)
Im not sure how to take a two word, two's complement value, and put it into a real number/floating number? Im searchig the web and see examples of how to change from two's complement into decimal, but not sure how to relate it to logix5000. Im under the gun and return to the job site down south Monday, only having Monday and Tuesday to get both items going - so any help will be greatly appreciated!!!!
NH
Two different situations/issues:
1. Im reading Oil Pressure and Fuel Pressure over J1939 through a Pyramid Solutions Bridgeway. Im getting the data in, im just having issues getting the correct display. When either the fuel or Oil pressure reaches 75 (PSI, after being converted from kPa)- the number turns negative and start decreasing by 2 (-73, -71, -69) although the pressure continues to rise. The data comes into a SINT. I tried moving bit for bit to a INT to try and defeat the signing - but that didnt work, same problem. Im starting to wonder if this data is coming across as Twos complement?
I have zipped and attached the logix5000 file, a quick reference:
Raw Binary data is read into AB7645:I.Data.9 (Oil Pressure) - and you can see under the J1939 subroutine, where I tried to cheat and move bit for bit into CAT_J1939_OIL_PRESSURE. Before that, I used a COP command from AB7645:I.Data.9 into CAT_J1939_OIL_PRESSURE which was also a SINT. Rung 2 of the J1939 subroutine takes the incoming value times 4 (to give kPa.) Then rung 3 takes the oil kPa times .14503 to give PSI.) That value (AB_J1939_OIL_PRESSURE) is what im displaying on the HMI.
2. Im trying to read Current across Modbus RTU, from a G.E. 489 Generator protection relay. The data type is listed as the following "2's Complement, Signed Long Value" 32bits total - 1st 16 bits are High Order Word of Long Value, 2nd 16bits are Low Order Word of Long Value. Example; -123456 stored as -123456 (i.e. 1st word: FFFE hex, 2nd word 1DC0 hex)
Im not sure how to take a two word, two's complement value, and put it into a real number/floating number? Im searchig the web and see examples of how to change from two's complement into decimal, but not sure how to relate it to logix5000. Im under the gun and return to the job site down south Monday, only having Monday and Tuesday to get both items going - so any help will be greatly appreciated!!!!
NH