12-18-2018 01:28 AM
I have parallel model with 8 sockets. Each of sockets has VI called "Open_Excel_File.VI" that openes excel file and read/write data to it. If Any of 8 testsockets open VI at the same time, i get error that excel file is not available.
How can I disable the same open/close of excel file in all 8 test sockets, so if one of sockets opens excel, others has to wait that excel is again availabe and then open it?
Solved! Go to Solution.
12-18-2018 10:09 AM
For the step that is calling your VI click on Synchronization in the Properties tab. Then check the Use Lock to Allow Only One Thread at a Time to Execute the Step.
This should fix it.
Cheers,
12-27-2018 09:10 AM
Hi Skoda3,
I guess you got your answer from jigg.
Kudos to him and mark as a solution to post! 🙂 Let's keep it clean here.
Regards,
01-03-2019 06:22 AM
Thank you for your solution.
What is difference between Selecting "Use Lock to Allow only One Thread at a Time to Execute the Step" and "Batch Synchronization -> Serial (one thread at a time)" ?
01-03-2019 06:24 AM
Thank you for your solution.
What is difference between Selecting "Use Lock to Allow only One Thread at a Time to Execute the Step" and "Batch Synchronization -> Serial (one thread at a time)" ?
01-03-2019
11:14 AM
- last edited on
10-21-2024
09:39 AM
by
Content Cleaner
"Use Lock to Allow Only One Thread at a Time to Execute the Step"
"Batch Synchronization"
Here is from the TestStand help:
Hope this helps,
01-04-2019 12:51 AM
Thanks again. But I have one more question.
I have PreUUT.seq defined like this:
if("TestSocket"==0){ "Open_ExcelFile_And_Read/Write_To_it" } elseif("TestSocket"==1){ "Open_ExcelFile_And_Read/Write_To_it" } elseif("TestSocket"==2){ "Open_ExcelFile_And_Read/Write_To_it" } elseif("TestSocket"==3){ "Open_ExcelFile_And_Read/Write_To_it" }
Soo any case belongs to socket number and all cases are in one sequence (PreUUT.seq).
My question:
If I want each of the socket to wait for excel file to be free for use (that it is not used by other socket) the only think that I have to do is to check "Use Lock to Allow Only One Thread at a Time to Execute the Step" at all four VI Calls of "Open_ExcelFile_And_Read/Write" ? Or do I have to define "Lock Name of Reference expression" and pass it to all four VI Calls of "Open_ExcelFile_And_Read/Write"?
01-07-2019 10:01 AM
Just define a lock name and it should be fine. Like the help says "NOTE: If you put a name in the Lock Name it will use that instead of the step ID. Using this you can put the lock on different steps if they share a resource"