I am having issues communicating with two different devices simultaneously using my gpib-usb-hs. I have two different vis that communicate with my two separate devices (each vi simply reads the measurement on each device). When the vis are run at separate times they work. I encounter an issue when I run these two vis at the same time I get 'Error-1073807338' and one vi stops running. Dose anyone knows what the issue could be?
When the vis are run at separate times they work. I encounter an issue when I run these two vis at the same time I get 'Error-1073807338' and one vi stops running. Dose anyone knows what the issue could be?
The issue could be an error in your code.
As you failed to attach your code you need to debug on your own…
This is like taking a picture of two pistons and then asking what might be wrong with the engine (apart from the fact that you completely disassembled your engine).
What does "running them at the same time" mean? Are they two subVIs encompassed by another VI? Are you running them both in "run continuously" mode? Do you have unique instrument addresses?
I'm running them both in run continuously mode.
Okay, so the first thing is: "Run Continuously" mode is a debugging tool. It should never be used as the primary way of running a VI. (It would be nice if NI would say that somewhere someone would be likely to look.) Just as in any programming language, to make it run more than once, you need a loop.
But wait - why are you running them in "Run Continuously" mode if they are already have a loop? If this is GPIB, why are you configuring serial port parameters?
GPIB is a serial bus (but not a serial port), so the commands run serially. There's a lot of ground to cover because I'm guessing that you do not understand the concept of "dataflow". We need to hook those two examples up sequentially, using dataflow concepts to do this.
To answer your question the short term, place the two examples in the same VI and hook the error out of one into the error in of the other. This establishes a dataflow dependency because of this one dataflow concept to rule them all: "A node executes only when data is available at all of its input terminals and supplies data to the output terminals only when the node finishes execution."
So the second VI cannot execute until it gets data at its error in terminal, and that can't happen until the first VI completes and supplies data to its error our terminal.
In the long term, it isn't enough to understand that hooking up the error out of one VI to the error in on another makes them execute in order. You need to understand why.