LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading power values via serial Modbus RTU power meter (slave) at LabView

hi I don't understand why you're starting with 40232 while the manual says active power is at 40233

and it says 23 bits from 40233 will represent mantissa try to extract these bits and convert.

bp
0 Kudos
Message 11 of 25
(1,970 Views)

Dear bharatp10,

I typed 40232 because I read that the addresses start at 0, and that's why a register's location would be one less. Now, I write 40233. The number I get is 2.84217E-14. I converted it to binary. The binary representation of this is 00000010, which is not 32 bit.

I also changed the power applied at the heater to see if this value changes. Although the device measures the power correctly, the value shown at LabView won't change at all.

0 Kudos
Message 12 of 25
(1,964 Views)

try this one see if anything changes ..

bp
0 Kudos
Message 13 of 25
(1,956 Views)

Nope. The number indicator shows the same values that I mentioned in the first time (a number in the order of 256)

0 Kudos
Message 14 of 25
(1,949 Views)

Nothing can change, unless we are able to read both registers 233 and 234 (by the way: I think that you should drop the initial 4, the only doubt is about using 233-234 as in the documentation or 232-233 to switch to 0 based).

Once we can read both register, we will be able to address convertion to the actual value. It is possible that we need to swap the Hi-Lo values or other similar manipulations at the byte level. It is easy to find the correct method by simple tests.

Before that, it's important to clarify whether a RS485 echo is present or not. Try with the attached vi. As the sent string is not a MODBUS command, you should not receive anything back.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 15 of 25
(1,944 Views)

Paolo, I've tried the echoing test. I get a Timeout Error at the VISA read. I read TESTSTRING from the read buffer 1 and 2 and return counts seem to be correct as well (both 10). So does that mean that there is a RS485 echo?

 

0 Kudos
Message 16 of 25
(1,940 Views)

Yes. You must get rid of it. What's the RS485 device you are using? Generally they can be configured to automatically suppress the echo, via BIOS/config software/microswitch/jumper, depending on the hardware.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 17 of 25
(1,935 Views)

I'm happy that we approach the problem from another point of view. I'm using this RS232/RS485 converter:

https://www.wut.de/e-86000-ww-daus-000.php

This is the converter proposed by the customer support of Siemens and they validate that it works with the device I have. It really worked because we tried another converter and it did not work at all.

There are no jumpers or microswitches on the converter.

The thing is, the device has its own configuration software (SIMEAS Parametrization Tool) and there everything seems to work fine. I can connect to the device, receive ID, read out power measurement values etc. At Labview however, I cannot see any values, as you already know. I'm not sure, but doesn't the fact that it works with its own software means that the suppression seems to be OK?

Regards,

Kaya

0 Kudos
Message 18 of 25
(1,925 Views)

Echo suppression can be handled by software, and definitely their software does handle it. But the NI-MODBUS library does not.

You may modify the library this way: open the MB Serial Transmit.vi under the vi.lib node of your project and change the code accordingly to the picture below. Of course, the purpose of the added Read is to swallow the echo of the sent command (and only this!).

Please remark that usually it's not good to modify code into the vi.lib folder. Normally you would need to duplicate the code to be changed to another folder, but I guess you would not be comfortable in doing these operations correctly.

Anyway keep in mind that:

- the modified code will not work if there is no echo on the serial interface

- in case you need to reinstall the library or LabVIEW, you will need to apply the code change again

 

Immagine.png

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 19 of 25
(1,919 Views)

Paolo,

 

Thanks a lot for the input. I'll update the library vi as you said and will write here what happened as result. I've also been communicating with the customer service of the adapter, and they said that it reflects the data. That's why, when setting up a connection with the device at their software, a configuration option is provided "with mirrored RS485 adapter". I guess this suppresses the echo at their software, and this suppression is not performed in LabView as you said. Anyway, I'll keep you updated!

 

0 Kudos
Message 20 of 25
(1,915 Views)