LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Paolo,

I updated the MB Serial Transmit vi as you said, and it won't work. I get a timeout error at the Read Holding Registers. When I rewinded the vi back to its original state, the vi worked as before. So apparently there is no echo. Does that mean that I should reinstall LabView?

Regards,

Kaya

0 Kudos
Message 21 of 25
(981 Views)

No. Indeed there is an echo as confirmed by more than one proof.

It is possible that the proposed change does not work (I cannot guarantee, although I succesfully used a similar technique in other cases).

After all, remember that so far you never got an answer from the instrument. "work as before" in this case means "does not work". So, there may be other problems: wrong addressing, wrong settings...

It's difficult to say without having the full instrument documentation... and the instrument itself with which to play.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 22 of 25
(977 Views)

I was a bit confused whether there was an echo or not. I don't want to bugger you further with instrument full documentation and details. I'll write here if I have specific questions and hopefully a resolution.

 

Thanks for your help, I've learned a lot!

Regards,

Kaya

0 Kudos
Message 23 of 25
(966 Views)

Dear all,

I've been working on the issue in the meantime. I think the problem is solved (although not optimal yet). I've contacted the customer service of the Siemens device and they said that Labview cannot interpret 32 bit float requests. That's why I needed to be sure that device sends requests in 16bit integer form. For that I needed to access the 40050th register. I tried couple of Modbus communicator programs for this. Simply Modbus Master 8.0.6 worked. After I've made sure that it is 16bit integer, I used the very first vi that I've sent you (sicam.vi). The 5th row in the measurement array gives my power values. It gives a timeout error after a while, but I suppose this is another problem. Paolo's vi showed an irrelevant value, but I think it is about correct interpretation of the responses from the device. I'll be working on it further.

I'm also using another PC now, to be sure that there is no driver conflict (I used to get blue screens with the previous setting). I'd like to thank you all for your time and effort to solve this thread.

Best regards,

Kaya

0 Kudos
Message 24 of 25
(928 Views)

@heinasirkka wrote:

Dear all,

. I've contacted the customer service of the Siemens device and they said that LabVIEW cannot interpret 32 bit float requests.

Best regards,

Kaya


That is not entirely correct. 

 

As has been stated in this thread in a few places, if you have a 32 bit float, it is divided among two registers as a high 16-bit word and a low 16-bit word.  YOu'll have to read the device manual to determine which register is high and which is low.  In LabVIEW, you'd read both registers, you can get them as a 16-bit array, and typecast that to a 32-bit (single) float.  You may have to swap words or reorder your array before the conversion.

0 Kudos
Message 25 of 25
(924 Views)