03-21-2023 02:21 PM
Hello,
I'm trying to read 4 digital gages using the Gage-Mux. The way you read a gage is to write R followed by the port numbers 01,02,03,04 (ex. R01 reads gage connected to port 1). In the example sketch, I made a flipflop circuit to swap the input going into the VISA Write Buffer terminal, this lets me get two of the reading from R01 and R01. What I'm trying to get it to do is send all four of the commands either at one time, if possible, and get 4 readings out or send each of the commands one after another with a delay in between to read the values. How would I go about doing this?
I've tried:
Case structure, but I couldn't figure out how to change cases periodically.
Duplicating the entire sketch and trying to run them at the same time, but it gives an error, something along the lines of "VISA resource in use"
Ex:
Solved! Go to Solution.
03-21-2023 03:04 PM
03-21-2023 07:05 PM
What about something like this?
Do all 4 queries concatenated, then all 4 reads.
If the instrument you're communicating was made "properly", it should have an input buffer where it will read in one command, execute it, and then read in the next one from the buffer and so on. If it was made poorly then it might discard all pending data when it starts running a command, but there's no way to know unless you try it out.
03-23-2023 01:10 PM
So this kinda works, but the device cycles through all the ports so fast that labview can only capture the last port.
03-23-2023 03:16 PM
I don't know how well of a solution this is, but I just copied the code 4 times and replaced the commands. Then I put each of the codes into a flat sequence structure one after the other, since each sequence has a close visa function, the next sequence has no issue opening it up and running it. My next plan to improve this is to put the code into a sub-VI then have the commands be an input. This has worked for me so far!