07-29-2021 05:09 AM
I am trying to bring up a re-entrant LabVIEW module which should behave as below.
PreUUTLoop - Initialization - Open References for each test socket
PreUUT - SetupPart - Run something before UUT starts
MainSeq - ProcessPart - Run something while UUT runs
PostUUT - CleanupPart - Run something after UUT finishes
PostUUTLoop - Deinitalization - Close References for each test socket
With 2x test sockets in parallel sequence, I notice that new VI is cloned for each callbacks in Teststand. However the TestStand thread ID remains same throughout the runs whcih you can observer in the below screenshots of attached sequence & VI. Why is new VI is cloned under the same thread IDs? I expected same VI clone would be reused under same thread ID.
PreUUTLoop:
PreUUT:
MainSeq:
PostUUT:
PostUUTLoop:
Only 2 threads (ID 34 & 33) spawned between all callback sequences.
However 12 clones of the VI spawned under the same thread viz.
3950003
3950004
3950005
3950006
3950007
3950008
3950009
3950010
3950011
3950012
Why is new VI is cloned under the same thread IDs? I expected same VI clone would be reused under same thread ID.
Attached sequence and re-entrant VI for reference.
07-29-2021 02:01 PM
Hi Ajay,
My understanding based on discussion with some NI TS R&D folks is that TS does not decide whether to create/reuse clones but rather just request LV for a reference, if the VI was configured to be re-entrant, LV just creates a clone and gives the references of clone to TS for use.
07-30-2021 05:30 AM
good to know that Santhosh.! (How are you keeping?!)
I just noticed for even within MainSequence if I call the same VI again it creates a new clone. I would say its completely an unexpected behavior that new VI keeps generated for same thread in TS. I would need to go for a non-reentrant for TS interfacing VIs.
Regards,
Ajay.
07-30-2021 06:34 PM
Hi Ajay,
What is the version of TS are you using?
Anand Jain
NI
07-30-2021 10:03 PM