07-08-2020 01:21 PM - edited 07-08-2020 01:25 PM
Maybe reentrant isn't the right word but...
I have four instruments on four different com ports
I believe that I should be able to read all four of these instruments simultaneously.
But it does not seem to work that way.
It appears the instruments are read consecutively but not necessarily in the same order every time. (VISA race?)
I have set all the sub-vi's related to the instruments to be "Preallocated clone reeentrant execution".
07-08-2020 02:50 PM
Sample code...
07-08-2020 03:01 PM
In your first post because you have "Value" property nodes, I don't think it is possible to synchronize. Each property node runs separately in the UI thread. The only way to try would be to wait for all property nodes to finish then run in parallel.
I don't think VISA can run in parallel, but not completely sure. Make sure there are no possible blocking subVIs in your reentrant VIs. (I cannot open them from the snippet.) I am only guessing about VISA; my guess comes from the fact of looking at the old GPIB functions. There are special VIs for looking at all devices.
mcduff
07-08-2020 03:36 PM
Interesting...
I will remove the indicators and see if it's any faster
07-08-2020 03:56 PM - edited 07-08-2020 04:22 PM
Right click on your VISA read/write functions and see what mode they're in. From this help article, it sort of implies that it's not multithreaded:
Mind if I ask if this is causing some issue of some kind? Are you simply trying to read three instruments simultaneously? If so, how "simultaneous" do you need it to be?
Edit: I had another thought, it's possible the VCP drivers you're using are not multithreaded. If they all call the same driver then it might be blocking one level *under* VISA. That's way outside anything I have experience with, but it might be an avenue for some research.
07-08-2020 03:59 PM
I am sure, it is possible to write simultaneously to several com ports via LabView and Visa
That is why , I would guess it is possible to read simultaneously, too
can you open "dc measurement.vi" and "ac measurement.vi" separately and run each .vi?
like press the run button in vi_1, wait until you get some readings
then press the run button in vi2 ... ?
07-08-2020 04:42 PM - edited 07-08-2020 04:43 PM
@BertMcMahan wrote:
Right click on your VISA read/write functions and see what mode they're in. From this help article, it sort of implies that it's not multithreaded:
Mind if I ask if this is causing some issue of some kind? Are you simply trying to read three instruments simultaneously? If so, how "simultaneous" do you need it to be?
Edit: I had another thought, it's possible the VCP drivers you're using are not multithreaded. If they all call the same driver then it might be blocking one level *under* VISA. That's way outside anything I have experience with, but it might be an avenue for some research.
I will give that article a review...
Well in general I am trying to speed up acquisition time. As it is now I can get about a four second loop rate and would like to get that down to one second or less to catch frequency variations when the generator is step loaded.
I am not really using any "drivers" the Yokogawa meters and the Agilent use SCPI commands.
07-08-2020 04:58 PM - edited 07-08-2020 05:05 PM
@RTSLVU wrote:I am not really using any "drivers" the Yokogawa meters and the Agilent use SCPI commands.
There is a USB to VCP driver somewhere in the mix (unless this is Ethernet... in which case I can offer some other suggestions). I assume this is USB, so when you plug in your device to your PC, there is some driver that gets installed to tell your computer "Hey, you can communicate with me via a terminal protocol". For example, a common chip for this is the CP2102. I have no idea if that chip is used by Agilent, it's just an example. I meant *that* driver might not be multithreaded, but I would honestly be surprised if that's the case here.
Can you post your actual device-reading subVI's? If they use Bytes at Port and a timeout, then they'll take forever. It surprises me that it takes more than a couple hundred ms per instrument query. If it's configured properly with termchars it should be very fast (unless there's a LOT of data to transfer, but I don't know what it is you're reading).
07-08-2020 05:04 PM
@BertMcMahan wrote:
@RTSLVU wrote:I am not really using any "drivers" the Yokogawa meters and the Agilent use SCPI commands.
There is a USB to VCP driver somewhere in the mix (unless this is Ethernet... in which case I can offer some other suggestions). I assume this is USB, so when you plug in your device to your PC, there is some driver that gets installed to tell your computer "Hey, you can communicate with me via a terminal protocol". For example, a common chip for this is the CP2102. I have no idea if that chip is used by Agilent, it's just an example. I meant *that* driver might not be multithreaded, but I would honestly be surprised if that's the case here.
Ohhh So you mean it could be the FTDI virtual serial port driver...
Crap I hope that's not it.
07-08-2020 05:09 PM
Yes, the FTDI driver. I *seriously* doubt that's the case but I wanted to throw it out there.
Can you post your subVI's? If you can post the whole thing in a zip file we can poke at it some more.