05-20-2014 03:39 AM
hi
i wanna ask how to multiple request and response on MODBUS RTU using VISA ? i tried to monitoring 2 device digital metering, i made a Labview program to communicate that device alternately using Stacked Sequence Structure, but it only can communicate with 1 device, and the response i think there are some error, the number of byte doesnt match what i request ( 0A04 0000 0002 70B0 )
this is my screenshot
and then i tried this and this not working too
any suggestion ? or maybe use other way to multiple request and response use NI VISA ?
Thanks~
05-21-2014 01:31 PM
Hi rhiesnand,
To check if you are getting errors, you can wire error indicators to the error wires. This will allow you to see if there are any errors being generated in the VISA Read/Write VIs.
Is the CVM device working as you expect? Are the CVM read buffer, substring, byte count and voltmeter values correct?
It may be that there the full frame is not available yet when you are doing the VISA Read because you are using the Bytes at Port property rather than specifying a fixed number of bytes to read. If you use constants for the bytes to read, do the read buffers show what you expect?
Also, you could try using the Modbus API rather than VISA commands to do the modbus communication. This API can be downloaded here:
https://decibel.ni.com/content/docs/DOC-30140
05-26-2014 01:54 AM
Hi Catherine,
i think no, you can see that i request 0A04 0000 0002 70B0 but the answer is incorrect, the number of byte doesnt match. you can see this video :
https://drive.google.com/file/d/0B_94Z4CwsTYeajlnaTF0bzF0TVk/edit?usp=sharing
yeah right, i tried modbus library, i think with this method is more simple :
but on that VI just read first register, how to read 10 register on CVM ? it just 1 register that could be show.
according on that manual of CVM if i request 10 register from 00 (starting address) that should be response Volt, Ampere, Watt, VarL,PF.
any suggestion ?
Thanks~
05-27-2014 04:58 PM
Hi rhiesnand,
Can you clarify the behavior you were seeing when using the NI Modbus Library? Was it successfully reading the first register specified, but not all 10? The output of the Read Input Registers VI is an array of values, so you may need to extract the elements or index through the array to access all of the register values.
Also, there are a couple of different Modbus libraries. The newer, more robust library (LabVIEW Modbus API) can be downloaded at:
https://decibel.ni.com/content/docs/DOC-30140
There is a discussion board specifically for questions about the LabVIEW Modbus API:
https://decibel.ni.com/content/thread/17712?tstart=0
06-02-2014 09:05 PM
Hi Catherine,
yes, it only read first register, not all 10. sorry, could you show me with screenshot how to extract that element ? i still didnt get it.
i already download it.
06-03-2014 10:02 AM
Hi rrhiesnand,
As you can see in the picture below, the outputs of the Read Input Registers VIs are 1D arrays of values. You can use a for loop and auto-indexing to index through the array of register values. If you are reading 10 register values, you will likely want to add more indicators so you can display all of the values you are reading.
More information about auto-indexing can be found in the LabVIEW Help:
http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/auto_indexing_1/