NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Syncrhronization problems in Parallel Mode

I've developed a program im TestStand using the Parallel Process Model. I'm controlling 4 equipments with GPIB and a DaQ Card. When I run my first Socket I don't have problems and the sequence works perfect, but when I run more than one Socket the sequence fails and give me the error:"Attempt to unlock a lock that is not locked by this thread". Everytime I make some write or read operation to my equipment with GPIB I lock this step between lock and unlock. Can someboday help me? Maybe I'm not using properly the lock functions. Where can I find examples about this?
0 Kudos
Message 1 of 4
(3,456 Views)
Hi Penya,

Your other sockets shouldn't be trying to unlock but waiting for the socket that has locked the IO process to unlock it to show that it is now free for the other sockets to use the IO process.

There is an example in your labview examples folder for VISA called locking.vi.


Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 4
(3,456 Views)
Hi Ray,
I'm using this VISA locks but I want that the control of the lock will be controlled and configured from TestStand and not LabVIEW
0 Kudos
Message 3 of 4
(3,456 Views)
Without seeing your sequence it is difficult to say what exactly is going wrong. Basically, to use a TestStand lock, you create it with a name and lock it using the name before the critical section of your code. When you lock a lock, you specify a lifetime for which when it expires the lock will automatically be unlocked (I believe the default lifetime is until the sequence finishes executing). In addition you can perform an EarlyUnlock operation to release the lock before the lock lifetime expires.

Another way of using locks is to use the synchronization tab of the step properties dialog on any step. You give it a name of a lock and it will automatically create and lock the lock before calling the step's code module and then automatically unlock it after the step compl
etes.

-Doug
0 Kudos
Message 4 of 4
(3,456 Views)