LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus code for Power meter not working

The same way!

 

When you want to read from slave address 4, then your input cluster to the read/write VI will be RTU, 4.

0 Kudos
Message 11 of 57
(1,909 Views)

I did not get this. Where is the input cluster located in the VI code or are you talking about the MBAP which has Transaction ID and Unit ID. If possible do a markup on the attached PDF and send to me

0 Kudos
Message 12 of 57
(1,908 Views)

Please reread message #9, particularly the last sentence.

 

Also, please attach actual VI's or VI snippets.  Screenshots in docx or pdf files are not ideal.  The images are distorted, and we can't actual run them

 

Attached is a snippet pointing out what your MB Read/Write should look like once you fix the cluster.

 

 

 

0 Kudos
Message 13 of 57
(1,903 Views)

Thanks for the email but unfortunately I could not see that MB (ie the abc wr MB and the connected  RTU) in my Vi. please how do I get it. Attached is my vi which you can help modify if need be but will like to know how that MB module can be obtained.

0 Kudos
Message 14 of 57
(1,884 Views)

I can't open your VI because I don't have LV 16 installed.  Please to a Save for Previous Version and save back to LV 14.

 


@Austyno wrote:

" I could not see that MB (ie the abc wr MB and the connected  RTU) in my Vi. "


I don't understand what you are trying to say here. "the abc wr"

0 Kudos
Message 15 of 57
(1,880 Views)

Please see attached in 2014 version

0 Kudos
Message 16 of 57
(1,872 Views)

That's not an editable VI.  That is a screen shot of a VI pasted into a VI.

 

What is shows should work for slave address #3.

 

You haven't done the step I said back in Message #9.  So I'll quote that here.

 

"Get rid of the constants and the bundle.  Just right click on the input [of the subVI] and pick Create Constant.  Now you'll have a properly documented cluster constant that is not being coerced."

0 Kudos
Message 17 of 57
(1,869 Views)

when I clicked on the sub Vi and click create constant. two values with 0 & 0 came up and I changed the below one to 3. Is this what you are suggesting? I did not see the RTU per your sent snapshot. Please see the attached PDF. I could not get the VI working again in 2014. Not sure why even when I do copy and paste the VI in 2014 version, I could not change anything nad nothing shows up in the block diagram.

0 Kudos
Message 18 of 57
(1,864 Views)

My mistake on the image.  I had picked the Serial Read Write instead of Ethernet version.  That cluster gives the mode (RTU/ASCII) and the slave address.  Apparently the ethernet version gives "transaction ID" (I don't know what that means) and "unit ID" which I would have thought would be the slave address but maybe it means something else.  But I don't know of anywhere else that you would specify a slave address.

 

Actually, this leads me to the question, why are you using the ethernet version?  I know your devices are serial connected to an RS-485 server.  Generally, those devices install a driver on your PC that makes those remote serial devices look like an actual serial device.  If these were real ethernet devices, each would have its own IP address and would be addressed individually by the IP address.

 

In Windows Device manager, do those remote serial ports show up?  If so, then use the serial version of the modbus VI's.  Otherwise, you will need to read up on that remote device server on how to access the ports.  You may have to run a configuraiton utility.

0 Kudos
Message 19 of 57
(1,857 Views)

Yes, the Unit ID is same as Slave address but still trying to figure out what trasaction ID is all about. I have been able to successfully connect to each of the Power meters seperately. The problem I have now is that the values being obtained from the power meters are not correct. It show zero when I put address 41001. Please any help? I have attached a zipped folder containing PDF of the code as well as the Power meter documentation (Modbus Map Address starts on page B34 (Section B.7) for your perusal.

0 Kudos
Message 20 of 57
(1,854 Views)