LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay to start while loop / delays to activate certain daq inputs

I've got a couple of case structures with while loops embedded in them to send out pulses for a given duration.  They are working fine individually, but now I need to find some way to link them.

 

Basically I need to run the first case structure with some changes to some DAQ outputs and then run the second structure with some different changes to the DAQ outputs.

 

On top of that I need to put a delay between some of the DAQ outputs going high.  Such as a relay that needs to be given time to switch before activating a high voltage across it. 

 

Should I create another case that implements these outputs?  Is there a way to wire a delay in between the activation of different outputs?  I'm sorry if I'm being vague, I'm not quite sure how to phrase the question.

 

Thanks,

Colin

0 Kudos
Message 1 of 5
(3,164 Views)

Hi Colin,

you should use only one event structure. You can use a parallel running loop to communicate to your boolean outputs. See the Producer/Consumer Design Pattern. You can use the second loop also as state machine to realize the delay between some state changes.

 

Hope it helps.

Mike

Message 2 of 5
(3,147 Views)

Thanks for the reply!  So I have an event structure that I've created that will run when a button is pressed. 

 

I've attached a screenshot of what I plan to implement for each step of the automation.  Is this a valid way to accomplish what I'm after?

 

The first 2 outputs of the daq are activated when the run button is pressed, then the next 2 are activated after 20ms.  Then I plan to have the next event case to occur when "x > y ?" value changes.  I'm hoping that this is a logical method to in a sense have a chain of outputs activated/deactivated with a certain delay between each one.

 

Again, thanks for the help.

 

-Colin
0 Kudos
Message 3 of 5
(3,128 Views)

Hey guys, unfortunately the  screenshot from the last post doesn't seem to be calling the second event in the structure...  I've attached a screenshot of the second event with this post.  I'd appreciate any ideas to what I'm doing wrong.

 

Am I going to need to have one big event that has iteration counts multiple seconds into the future without depending on any of the events firing in the past?  I think I can do that, it'll just be a massively complicated VI that I could see hogging a lot of processor power.

 

Thanks.

0 Kudos
Message 4 of 5
(3,118 Views)

Hi, Colin.

 

The reason that you're never able to call the "x>y? value change" event is because the value of the indicator "x>y?" is being changed programmatically.  This is not an event.  Check out this KnowledgeBase article for more information regarding this issue.

 

I hope you're having a great day!

Regards,

Sara Lewandroski
Applications Engineer | National Instruments
0 Kudos
Message 5 of 5
(3,073 Views)