From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what am i doing wrong - modbus protocol

HI. I want to establish a communication with power meter Siemens Simeas P50.
Basicaly i just want to read some values (registers) at 1 read/sec.
At the begining, i wanted to do it with serial ASCII protocol, but i give up, because i havn't necessary protocol from Siemens.
(specific function to read/write). So i started digging for modbus protocol.

I work in Labview 8.6 and i have also installed DSC module and NI-modbus library 1.2.
Steps which i have done:
1.- start new project / new server I/O / choose modbus /;
2.- create bound variables / Add range registers /;
3.- New vi / drag 3 registers with indicators for testing / Run or deploy the vi with success, but, no values;

Modbus I/O server is set right i think, as you can see in attachment.

My question is, why i'm not seeing the values in the vi for registers ?
Something is not write, i know, but i don't know how to do it right.
Can you advice me ?  
In the attachment you can also see the proprietary software of Siemens for this power meter, with read values.    

Thanks.

0 Kudos
Message 1 of 5
(2,491 Views)

Are you trying to run both programs at the same time?

 

If the proprietary software has the com port open, then LabVIEW is not going to be able to open the com port.

0 Kudos
Message 2 of 5
(2,458 Views)
No, i run just the vi. proprietary software was there just for taking screenshot. If i started right, then what's next ? How to read holding registers ? I tried also MB Serial Example Master.vi, and i modified function and registers, but no succes, even if, i see some communication on converter's led. I have another question : How come holding registers, in general, start at 400001, but for my Siemens power meter, measured values (holding registers) start at 40001 ?
0 Kudos
Message 3 of 5
(2,443 Views)

here is the scrreenshot with holding registers of Simea P50.

0 Kudos
Message 4 of 5
(2,442 Views)

I personally use the modbus library from NI, you can download it.

You can use the example to test communication.

 

Another easy way is to use modscan32 -download the trial- and use that to poll the device, to check if you're addressing the correct register numbers.

 

All input registers start with 4, so if you read holding registers you enter as register number 201 for the voltage (leave 40000 off). Sometimes in labview it is even 1 register lower because it starts numbering at 0. In that case the register would be 200 in labview. I dont know if thats the same with the things you're using, Im not familiar with that.

 

I like to directly from labview communicate with my modbus devices. I use modbus TCP btw.

 

 

 

 

0 Kudos
Message 5 of 5
(2,417 Views)