LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus code for Power meter not working

I have some 5 Power Quality Meters which has been configured with Modbus RS-485 connection with Slave addresses (2, 3, 3, 5,6) and these are daisy chained using RS-485 connection and finally hooked up to the RS-485 port of a Modbus gateway which also has an Ethernet port connection for running Modbus TCP/IP. The Modbus Gateway is configured with an IP address and plugged into the network through the RJ-45 Ethernet connection. However, my LabVIEW code (which is attached) is run, it sees the IP address with no error (error status 2 which is green) but error status 2 gives error as shown in the attachment. I believe that the Gateway is trying to pull data from these slaves but with no success. The errors are Code 6010 and Modbus Exception Code:10. Can someone help towards correcting these errors? Attached is the connection setup and the codes with errors. Your efforts are well appreciated.

0 Kudos
Message 1 of 57
(6,380 Views)

This doesn't seem to be a problem with LabVIEW, but with the gateway.  Have you tried contacting the manufacturer of that for help?

 

Do they have any software you can run to see if it works with that?

 

What if you connected the RS-485 lines to an RS-485 serial port on your computer and use Modbus Serial to see if the devices work that way?

0 Kudos
Message 2 of 57
(6,330 Views)

Yes I did talk with the Manufacturers and was told that the problem is with the labview code because when I run the data and check status of the gateway, it shows data are being sent to the slave devices but no response is received by the gatewat, hence times out. See attachment per Gateway data communication request and response.

 

 

0 Kudos
Message 3 of 57
(6,319 Views)

What you are saying is the exact opposite of what you just said!

 

If the gateway is not getting a response from the devices, then the problem is between the devices and the gateway.  NOT, the gateway and LabVIEW.

Who is the manufacturer of your power meters?  Who is the manufacturer of the gateway?  Do you have a model number or instructions for it?

 

Correct me if I'm wrong, but this is my understanding of your setup.

Power meter (x4)  <------->  Gateway  <--------->  PC with LabVIEW

                               RS-485                   TCP/IP

 

If the problem is that the gateway is sending messages to the power meters, but not getting the reponses back, then the  problem is in the Gateway to Power meter communication.  Not the LabVIEW to Gateway.  You actually know that part is working because the gateway is giving you back an exception code saying it couldn't communicate with the devices.

 

 

 

0 Kudos
Message 4 of 57
(6,310 Views)

yes, that setup is correct. EPM7000 Power meter from GE and Vlinx MESR901 Gateway. I have attached manuals of both devices. Note that for me to get this response from the Gateway, i have to run the labview code and both Labview and Gateway software are resident in the PC.

0 Kudos
Message 5 of 57
(6,306 Views)

Attached also is the Gateway manual

0 Kudos
Message 6 of 57
(6,305 Views)

Double check all of your communicaiton settings.  Slave addresses.  Baud rate.  Is the gateway set up for 2-wire or 4-wire RS-485.

Termination resistors called out in power meter manual.

 

Like I said, take a step back, remove the gateway and talk directly between PC and one device using an RS-485 port on your PC (you'll probably need to get a USB-RS-485 adapter for that.)

0 Kudos
Message 7 of 57
(6,295 Views)

My settings are ok. 9600 Baud rate, 8 bits, 1 stop bit, no parity. I have RS-485 to USb which is what I used in setting the EPM using the GE software 9GE Communicator). With the RS485 to USB and GE Communicator, I was able to see needed data on the GE communicator software. The Gateway is setup for 2-Wire RS-485 and attached as slaves. Addresses were assigned to the GE PQM from 2 to 6. Are you suggesting that I do a labview code that can talk directly to these devices and see if it works?

0 Kudos
Message 8 of 57
(6,288 Views)

Yes.

 

And are you sure about your addresses?  In your first message, you said "I have some 5 Power Quality Meters which has been configured with Modbus RS-485 connection with Slave addresses (2, 3, 3, 5,6)"  I asumme the second #3 was meant to be 4.

 

In your 3rd message, the monitor screen says it is sending 01 04 02 43 00 02 81 A7.  So that is trying to communicate with slave address #1.  Your first message pdf says it has a cluster going in that is a 0, 1 It is also coerced.  Get rid of the constants and the bundle.  Just right click on the input and pick Create Constant.  Now you'll have a properly documented cluster constant that is not being coerced.  The first 0 is being coerced to RTU.  The second number of 1 means you are tyring to communicate with slave address 1.  And this correlates well with the monitor screen shot.

 

If your devices are 2, 3, 4, 5, 6 (and that is 5 devices not 4), you don't have a slave address number 1 and no one is going to respond to the message.

 

Try making that cluster constant RTU and 2 and see if device 2 responds.

0 Kudos
Message 9 of 57
(6,284 Views)

Thanks for your help so far but this is the situation. I connected one slave device to the Gateway and changed the starting address on the labview code and was able to see data on the register and the Gateway also did send and receive data back. The question I have now is how do I specify the slave address in the code when I have two or more of these slave RTU devices daisy chained and connected to the gateway since the holding register addresses are the same and the only thing changing is the slave addresses in each RTU device. For now I shall be using 5 RTUs with Slave addresses 2, 3, 4, 5, 6. Any help is well appreciated.

0 Kudos
Message 10 of 57
(6,264 Views)