11-26-2012 02:54 AM
Hi all,
i just started using teststand and i am not too familiar with the program up to now.
What I want to do is, writing teststand station globals from a vi that i started asynchronously. What steps do i need to execute in teststand before starting the vi? A small example would also be great.
thanks for your help.
Walter
11-26-2012 03:30 AM
Walter,
is there a specific reason why you are using global variables?
Global variables should be used primarily for configuration settings, so data which is written once (e.g. during start-up) and then only read. I don't recommend them to be used for continuous data transfer.
That being said, you have to pass the SequenceContext to the module when it is called by your sequence execution. Use the TS API to access the variables you want to write to.
Norbert
11-26-2012 03:47 AM
I need to lock and unlock a device, during my teststand sequence executes. Therefore i use the global variable because i need the access from labview all the time.
I already use the actvex module but i can't read the teststand values from labview. Can u tell me the correct way to configure the activeX modules?
11-26-2012 06:20 AM
When using instruments in LV code modules, the code module itself presents a lock (default execution setting of LV VIs when not changed to reentrant execution).
So if the instrument is used in a single code module (which is used several times in your TS sequence(s)), there is nothing you have to worry about.
If the instrument is used in multiple (different) LV code modules (by passing its handle from module to module), you might require to include some locking.
I recommend you to provide the lock in TestStand. Use the Lock steptype in the synchronization palette to do so.
Norbert
11-27-2012 05:54 AM
Please refer TestStand examples for accessing Teststand variables from a VI :
C:\Users\Public\Documents\National Instruments\TestStand 4.2.1\Examples\AccessingArraysUsingAPI\UsingLabVIEW
As suggested earlier you can use the Lock step type which can lock your resources in multithread applications.