HVAC-Talk: Heating, Air & Refrigeration Discussion banner
1 - 13 of 32 Posts
Reading signed 32bit and signed 16 bits from XNC

The way you have the setpoints setup is how I would do it. If it does not work, you will have to sniff the traffic and see if the modbus device is tossing back an error code.

The digital status bits, I'm not sure if the bit mask applies to writes or not. Typically I work will all 16bits at a shot. So I read/write a number to the register, and deal with separating out the single bits in strategy. This is pretty simple when working with the first 8bits, just use the A2D or D2A blocks.

So if I want to set bit 2 & 4, I use a D2A block tie my logic to these bits and then write the analog number to the register.

What’s not clear in the documentation is what the other bits of register 16525 are doing. If they are just ignored, I would use something like the attached strategy to write to them. This will have the affect of setting all the other bits to 0. If this is unacceptable, you would have to read in the register, then manipulate the bits and send it back.
Hi i have the same situation with reading from signed 16 and signed 32 bits from 2 different electrical meters.
Orion242 can u send a part of strategy that contains your way seperating the bits and write them Using A to D and D to A ?
 
Ty so much orion but im still having difficulties here im trying to read 16 bit signed number . I used your strategy and tie my output to that knob to see bits .DSE 7320 electrical meter document says the signed bit calculation is set on 2's compliment. With C00#ms/ls in my storestore i got number 32767 i have used c05 function also still have same . When i used your strategy i get 11111111 for lsb and 11111110 for msb i really mixed up here .trying to use 2's compliment the result goes #0000000000000010 aint it? And i tried to set #C05#0000000000000010 if i want to set this signed bit with 2's compliment what i must do? C09 just giving number 1 as output. i have 2 signed 16bits and 2 signed 32bits to read
 
im using serialmodbusmaster.xnc as driver im working on modbus RTU devices.im getting whole info voltage,current etc but have problem with powerfactor signed16bit and power(watt) signed 32bit , im getting other info for unsigned 32 at c10 and unsigned fromm c00 . Yes i have the datasheet for this device tring to get info from register 1581 and 1560. There is nothing about signed numbers in their document just says about 2's compliment is used for signed ones
 
Tyvm orion the other thing is when i change #C05#xxxxxxxxxxxxxx 0 and 1 's with different combinations nothing changes same value 32767 coming from the different signed registers
 
Its possible i have messed up with 32bit signed but i tried C10 MS/LS LS/MS both combinations same as C05#MS/LS or C05#LS/MS at C05#LS/MS all signed 16 bit registers give -128 as result.
I will give you the document of this DSE PLC they have a special register calculation.i will give u the page number of that formula and will give you the page numbers where my signed 16bits and 32bits are.
http://www.4shared.com/rar/VDyQ7Psk/S_b.html
Register Calculation: Page 16 1st section
formula: register_address=page_number*256+register_offset.

E001#F03#A01557#N01#O012#C05#0000000010000000 (avarage power factor) tried MS/LS LS/MS also, Page: 6 register_offset: 21

E001#F03#A01536#N01#O008#C05#0000000010000000 (total power)tried MS/LS LS/MS C09 function C10 too, Page: 6 Register_offset: 0
E001#F03#A01295#N01#O099#C05#0000000010000000 Fuel Temp(degreees)
signed 16 bit,tried C05#MS/LS LS/MS ,Page : 5 register_offset: 15

For another electrical meter all signed 32bit here:
Attached the .pdf file for PM710
At bottom page 13 u will see an info(small puntos) about Float
E003#F04#A01020#N01#O049#C04#LS/MS (frequency) tried MS/LS gives result 0,C10 MS/LS LS/MS gives result of 0 also
E003#F04#A01012#N01#O063#C04#LS/MS (power factor) tried MS/LS gives result 0,C10 MS/LS LS/MS gives result of 0 also

Ty for your time Orion, i really messed up in here :)
 
And yes at 1st device other values working ,just 1 unsigned i just have problem
E001#F03#A01552#N01#O010#C10#MS/LS (VaR Reactive Power) Page : 6 Register_Offset:16
 
1 - 13 of 32 Posts
You have insufficient privileges to reply here.