LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acces FilesGlobals of Teststand from LabVIEW?

Hi,
 
What happens, when you try to get the value of a Teststand variable (FileGlobals) with the Get Property in LabVIEw and at the same time, Teststand whant to access the same variable. Is there some conflicts?
 
Regards,
Risotto
0 Kudos
Message 1 of 4
(2,870 Views)
Under rare circumstances this could cause a problem. Imagine the following scenario:
LabView and TestStand are running in different threads.
LabView accesses the global variable reading it.
No a thread-change takes place, and teststand is changing the varible (lets say incremnting it by 1). No another thread-change takes place, and we are back in labview, but LabView hasn´t noticed, that the variable has changed.

To prevent this, you should use Locks (You can find this step type in the synchronisation palette) in TestStand, that guarantee that only one thread at a time accesses the variable.
0 Kudos
Message 2 of 4
(2,866 Views)

Hi,

 

I think, I have exactly what you describe: I run a LabVIEW-VI as separate thread from Teststand. This VI read each 1 second some variables in Teststand. Teststand update the same variable each 50ms. The whole sequence may last 24 hours. But from what I understand from your explanation, the only risk is to have my VI not be notified about a change in my variables.

But it is possible, that for example my VI try to read the variable during Teststand write it at the same time?

Moreover, how could works these "Lock" if Labview and Teststand are running on separated thread?

Regards

Risotto

0 Kudos
Message 3 of 4
(2,863 Views)
This could be, even though this is rare, but it could happen, that right in the moment when TestStand writes to the global variable, the thread changing happens, and labView might see strange data (for example if the variable is a array, that not all values had been updated, so LabView would see a mi of old and new data). This is a general problem, when working with multiple threads, and is not TestStand specific. The solution is using synchronisation step types, for example the lock steps to secure the access of global variables, files or devices. You place a lock step before and after the step that works with the variable. before the step you "lock" the step, after the step you can "early unlock" it again. When you do the same on some other position, but with the same lock-reference, you can garantuee, that as long as one thread "locked" the lock, no other can do the same, and so your steps following the lock-step are secure.

Hope that was good to understand. Here you can find some more Information concerning parallel tests:
http://zone.ni.com/devzone/devzone.nsf/webcategories/F255EBD2FF79B055862567B3006BE376
0 Kudos
Message 4 of 4
(2,856 Views)