There is a subsequence that contains an action step that calls a VI that runs a loop. This subsequence is run in a new thread, which allows the VI to run in parallel to the MainSequence. The VI gets data from DAQmx Read every second. This set of data is passed to TestStand's FileGlobals via "TestStand - Set Property Value.vi" every second. Then, some steps in the sequence snatch the freshest data from FileGlobals.
Now the scenario changes. The DAQmx device is not on the same computer as the one that runs the MainSequence. It doesn't look like direct remote access to a DAQmx device in a VI is possible. Then, the DAQmx VI will have to run on the computer where the device is installed. This VI will have to pass data over a local network to another computer's TestStand FileGlobals.
Can a TestStand sequence step call the VI on another computer over a network?
What would be the best approach to make the VI pass data over a network to TestStand?
I came across some information about shared variables and data sockets. It would be great to know where I should be heading before I invest a lot of time for a suboptimal method.
Any insight will be appreciated!
To answer your first question, if you add a Sequence Call, under the Modules tab> Execution Options> Select Use Remote Computer. This will prompt you to set up the remote host information.
For your second question, you can pass data through the parameters from the remote subsequence to the host main sequence.
Thanks for the answer.
The remote DAQmx VI runs a loop that should iterate every second for data logging until the MainSequence ends. I don't think it is a good practice to create a channel and start task for each loop every second. I wanted to put only the DAQmx Read part inside the loop, which means it is hard to pass data through TestStand parameters since the VI doesn't stop running. Hence, I decided to use shared variables to pass data for every loop to another computer's VI.
This is how I implemented the sequence.
1. MainSequence's Setup, on the main computer, calls a subsequence in a new thread that runs Start DAQmx VI.
2. Start DAQmx VI runs Call by Reference to call the DAQmx VI on the remote computer. (I wanted to use Start Asynchronous Call to call and forget but it doesn't seem to work for remote connection.) Start DAQmx VI will stop only after DAQmx VI stops. DAQmx VI has two shared variables for sending measurements and receiving stop signal.
3. MainSequence runs the Main part. Whenever a step needs DAQmx data, SequenceFilePreStep callback runs a VI that collects the most recent measurements through the shared variable. These values are saved to FileGlobals for the step to use.
4. MainSequence's Cleanup runs Stop DAQmx VI that sends a boolean to DAQmx VI's shared variable for stop signal.