01-03-2021 10:40 PM
Hi,
I am trying to communicate with VISA Serial instruments and I did it with example - Simple Serial.vi. However, I would like to use network-published shared variable (string type) to send command to the instruments by replacing the string command (*IDN?\n) to the shared variable with same command loaded into the variable. Figure below shows the Simple Serial.vi added into a .lvproj file and a shared variable "READ" is preloaded with exactly same command.
May I know how to make it work as I am unable to communicate with the instrument once I changed the string command to shared variable?
Thank you.
Best regards,
Wing
Solved! Go to Solution.
01-04-2021 01:38 AM
Attached with the zip file for the Simple Serial.lvproj
01-04-2021 05:18 AM
First I will state that I advise against Network Published Shared Variables. They are slow, unsecure (anybody on the network can update the value), and often have weird race conditions. What what is it that you are actually trying to accomplish? There are likely better ways.
On the serial side, we need to know the device and its command structure in order to help at all here. Again, I advise against using the NI example. You might want to have a look at this: VIWeek 2020/Proper way to communicate over serial
01-04-2021 10:17 PM
Hi crossrulz,
Thanks for your reply. However, it is a must for me to use NPSV as requested from the top. May I know is there additional information when NPSV giving out data? Because the way with manual command works but through NPSV doesn't work even with exact command written into NPSV.
Best regards,
Wing
01-11-2021 09:47 PM
Hi all,
I solved the NPSV problem by removing the termination characters in variables and adding Term Char manually to write into the machine and it works fine with my three different instruments.
Thank you all for your replies.
Best regards,
Wing