03-02-2020 02:49 AM
Hi,
I Just designed the GUI based on the teststand default simple GUI. I just add the function that is to transport the variable between Teststand and labview . Attached please find software. The running process is OK but it would get an error the picture shows after I click the "EXIT" button. I am very confused about it .
I really hope someone can help me find the reason.
Thank you in advance!
open28
Solved! Go to Solution.
03-02-2020 09:56 AM
Generally that error occurs because you are not releasing a sequence file or other TestStand object properly. I ran you code (GUI and foo.seq) and didn't see any issues. My guess is that you are passing the sequence context into a VI in a different sequence file and using the TestStand API to open objects and do stuff to them and not closing the references properly.
03-02-2020 07:23 PM
HI, jigg
Please allow me ask you a follow up question.
How can I release the a sequence file or other TestStand object in the GUI code? Actually, I think when i close the GUI, it may release all resource. Because in the GUI shutdown case, i saw there is a process to release the teststand engine resource. If the Teststand engine resouce released, all resources of teststand would be released.
Besides, do you mean this error happen in the teststand code? not in the GUI code?
Thank you for your response!
open28
03-03-2020 12:16 AM
Hi, jigg
attached please find my sequence file.
I have found the main error happened at using the PostUImessageEX to pass the thiscontext reference to labview GUI.
Actually i don`t know why it could occur this error.
03-03-2020 11:48 AM
Ok this one was a tricky one but I think I figured it out. You actually have 2 issues happening.
The first is captured in UIMessageConvertSequenceContext.png attached. For some odd reason you need to convert the sequence context from a variant to a reference before passing it to your event. Also, I highly recommend that you move the property node for doing this inside of the case structure. You never know when another UIMessage will send ActiveX data that is not a sequence context and then you'll run into worse issues.
The second one is that you need to close the sequence context inside of your event (CloseSequenceContext.png attached).
Also, my advice is that what you are doing seems like it could be a huge cause for worse headaches down the road. I would just handle the issue inside of your callback VI and not try to pass the sequence context back to your main VI. The reason I recommend this is that once your callback VI completes execution it returns back to TestStand. TestStand will then continue on and could be done with that sequence context by the time your UserEvent starts to handle it. Therefore you could be dealing with a destroyed sequence context in your user event. Basically you are opening up yourself to race conditions.
Hope this helps,
03-03-2020 10:48 PM
Hi, jigg
Thank you for your help . I have solved this problem after follow your advice.
Besides, I want to know. If there is any good idea to pass the variant between Teststand and LABVIEW? I am a newcomer of teststand.
Thank you again!