02-12-2022 04:12 PM
Hi, I'm trying to send 2 commands at once and graph their responses on different plots. The method of communication is Modbus serial. I tried the same plot, but couldn't figure it out. But, I am having a an issue with sending and receiving the responses from the sensor at the same time. However, my second VISA Write-Read combinaiton fails to complete. Any help would be greatly appreciated.
Solved! Go to Solution.
02-13-2022 10:42 AM
Don't try to reinvent the wheel, there is a free and full featured Modbus library available for LabVEW
I have used this library in a few applications and found it straight forward and well supported in the forum I linked to.
02-14-2022 08:13 AM
I have installed the Package previously, but I am a confused is it supposed to replace all the VISA Writes and Reads in my Block diagram?
02-14-2022 08:43 AM
Yes. Because the needed VISA Writes and Reads are in the VI's of the library, along with all the other code to structure the command messages and interpret the responses from the device.
02-14-2022 08:57 AM
Yes it replaces VISA, I believe actually it uses VISA inside but that's kind of the point of the library. As it abstracts out all the "hairy details' of Modbus an boils it down to reading and writing registers and coils. You will still have to know exactly what register(s) to read and how to convert the returned data.
02-14-2022 12:05 PM
Trying to execute requests in parallel over serial could potentially cause additional problems if the read operations happen in the opposite order of your write actions. As an example, there's nothing stopping your Gas PPM request to happen before your Temperature request but then have the Temperature read happen before the Gas PPM read.
The Modbus library that was linked has a mutex around the critical VISA read/write section to avoid that problem.
02-14-2022 02:05 PM
So, should I even be configuring my serial port using VISA Configure cause I'm not sure what it is supposed to connect to anymore? Also, do I need both Master and Slave Versions of the Read/Write VIs? Can I just use Modbus Read Multiple holding registers to read the value stored there or does the basic structure of command and response apply whether it is VISA or Modbus?
02-14-2022 03:36 PM
I will try to give you a couple tips here... but later, after work< I might be able to answer more detailed questions.
First, study the manual of your device thoroughly as you will need to know what register(s) to read and how to scale the returned values.
02-15-2022 07:51 AM
Hi RTSLVU,
Thank you for your help. I've just realized that I have been working away at an issue from base camp when people have already built a helicoter that could take me halfway up the mountain lol. I'm looking at example codes online (which can be a risky proposition as I've learned from the past), but if my understanding is correct my current code would be from the perspective of the client (master)
02-15-2022 08:37 AM
@vanceblake wrote:
Hi RTSLVU,
Thank you for your help. I've just realized that I have been working away at an issue from base camp when people have already built a helicoter that could take me halfway up the mountain lol. I'm looking at example codes online (which can be a risky proposition as I've learned from the past), but if my understanding is correct my current code would be from the perspective of the client (master)
But to further that analogy, you learn a lot more by getting yourself halfway up the mountain than if you took the helicopter!