11-23-2012
06:19 AM
- last edited on
10-20-2024
12:34 PM
by
Content Cleaner
Acquire Semaphore in TestStand within LabVIEW VI
Hello, I would like to share my solved issue of semaphore used in TestStand within LabVIEW VI.
I created a simple TestStand sequence for incrementing global numeric variable. As a station model for the sequence execution is used BatchModel and number of test sockets is 8. Description of my sequence is bellow:
Description of the sequence steps
1. Global Reset - Resets the global numeric variable
2. Semaphore Create - Creates a reference to new semaphore
3. Global Increment With Semaphore - Is synchronized part of application which increments a numeric value
4. SemaphoreDestroy - Releases a semaphore reference
5. Global Read - Reads the numeric global variable
6. Message Popup - Shows the output of numeric global variable
Execution of sequence
Execution of the sequence causes Error !
Solution
I found incorrect settings in TestStand. It doesn't reserved the loaded VI's for the execution. Therefore the reference of the semaphore which I created in step SemaphoreCreate has become not valid.
Something from LabVIEW Help:
Reserve Loaded VIs for Execution—Specifies whether LabVIEW reserves each VI to run when TestStand loads the VI. When a VI is reserved for execution, any references the VI creates during execution remain valid until the VI is unreserved. VIs LabVIEW reserves take less time to call. However, you cannot edit the VIs in LabVIEW unless you click Edit VI on the LabVIEW Module tab or Specify Module dialog box or select Edit Code from the context menu for the calling step.
Source code you can find in attachment
I hope, that this article will be helpful for somebody. I had really problem with it