From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using more than one time delay in a thread

Solved!
Go to solution

Hello,
     I need to use two non-consecutive time delays in a thread. My thread typically proceeds as follows:
1. Tell an oriel MS257 to change wavelengths
2. Time delay #1 to give the MS257 time to change
3. Tell HP 4156C to start sweeping
4. Poll the 4156C until sweeping is complete
5. Time delay #2 to give 4156C time to load data
6. Read/parse/save data

My problem is that the second time delay seems to start counting immediately after the first one - it does not wait for the sweeping to complete before counting. My VI is attached. It's a bit messy - organizational tips are also welcome!

Thanks,
Ying 

0 Kudos
Message 1 of 5
(2,331 Views)

i will geusse that your dealy sub-VI is not re-aentrant so the execution of the second only starts when the first completes.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,324 Views)

I'm not sure how re-entrancy should affect this VI. The second time delay shouldn't be running simultaneously with the first. Also, this is an express VI included Labview 2010 - I'm not sure if this changes anything.

0 Kudos
Message 3 of 5
(2,315 Views)
Solution
Accepted by topic author YingCai

Looking into the sources show: Cleanup is a nice tool (even thought it is far from perfect 😉 )

 

Well, nevertheless, from the wireworking, it seems alright that the second Time Delay express VI should indeed wait for the loop to finish. Therefore, i am wondering why it is skipped. And the only reasonable explanation: You have an error on the error cluster.

 

So please debug into it using highlight/probes on the error cluster to make sure that you are not running into issues here.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(2,298 Views)

Clean-up wanted to make my flowchart three screens wide... took ages just to drag and drop something on the other side of the diagram.

In any case, I've looked into it, and it turns out my polling comparison was faulty. Time delay is indeed working perfectly fine. Thanks for the help everyone. 

0 Kudos
Message 5 of 5
(2,289 Views)