LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay Time Making Delayed Values

I am Using An IR Sensor and USB 6221 To open or close Pneumatic cylinder.

I did that Vi in attachments .. It is working good until i use the delay time in the second frame of flat sequence.

Without Delay It works good but it opens and closes too fast .. i need it to stop a little time before it closes

With Delay it makes the values which are read from the sensor are not accurate so the program isn't working well

So the question is

only what I need is a stop time between the two phases not a delay for the whole program

0 Kudos
Message 1 of 4
(2,219 Views)

Hi El-Awny,

 

only what I need is a stop time between the two phases not a delay for the whole program

You need more than this!

- Get rid of the race conditions you created with those local variables! THINK DATAFLOW!

- Think about the concept of a state machine…

- You surely will only need one of those DAQAssistants to open AND close the cylinder!

- DAQmx is really easy to use - after reading this and looking at the example VIs coming with LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,205 Views)

Thank You for the reply but can explain more how to get over this problem

0 Kudos
Message 3 of 4
(2,181 Views)

Hi El-Awny,

 

I am Using An IR Sensor and USB 6221 To open or close Pneumatic cylinder.

So you could create two loops: one for reading the sensor and one for handling the digital output.

 

With Delay it makes the values which are read from the sensor are not accurate so the program isn't working well

With two separate loops they can operate independently!

 

It is working good until i use the delay time in the second frame of flat sequence... i need it to stop a little time before it closes

Here comes the state machine: you could use 3 states of [open, wait, close].

In the wait state you could also check for changed sensor values…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(2,179 Views)