01-28-2021 03:47 PM
Hello,
To control a chamber valve, I need to turn ON a digital output for 60ms and turn it OFF. Here is an attachment jpg that shows how I am achieving it. My valve currently stays open for some seconds before closing again. I don't know how to achieve 60ms. Furthermore, I am using the Labview version 2018. I used the timer functions where I have no idea for how long time my while loop is iterating. can you suggest some suggestions regarding my VI.
Thanks.
01-28-2021 04:29 PM
To get precise timing control you would need to implement the timing on a hardware level and not on software (note, there is always software overhead when communicating with hardware). To achieve the exact 60ms, you need Hardware timed Digital Output on the instrument and you must load the waveform to generate to the instrument and start.
01-28-2021 04:39 PM - edited 01-28-2021 04:40 PM
Let's evaluate what your VI currently does.
1. It sets up the DAQ task.
2. It gets an initial time.
3. It starts a loop.
4. It get the time again and compares it to the time from #2.
5. If the time difference is less than Y, the result is False.
6. The result goes through NOT turning it to True. The True value gets written out and your digital output turns on.
7. Because the boolean from 5 is false, the loop does not stop and begins again starting at #3
8. If the time difference is greater than Y, the result is True.
9. The result goes through NOT turning it to False. The false value gets written out and your digital output turns off.
10. Because the boolean from 8 is now True, the While Loop will stop and it will exit.
11. Outside the loop, the task is stopped, cleared, and any error messages are displayed.
12. The VI ends.
So you got a pulse on for Y milliseconds, then turns off. VI is done.
What value is in your Y control? How is your VI behaving differently than what I described above?
If you want to know how long your VI has been operating, but an indicator on the output of the subtraction and it will tell you how many milliseconds.
01-28-2021 06:34 PM
As you said I have kept an indicator in order to know how many milliseconds. The problem is let us say the x value is 3525 which is less than the y value which is 3600 number then it is true. But when is it true the pump turns on few seconds and turns off. Now I want to control this few seconds and make it to 60 milliseconds when the y value is true which means greater than x. I named the y value as pulse width.
01-28-2021 06:43 PM
Can you guide me to achieve I am very new to LabVIEW?
01-29-2021 07:14 AM
There is only one way I know that this entire loop iteration would take several seconds to run.
Are you running this VI with Highlight Execution turned on?
01-29-2021 02:13 PM
yes I have highlighted and after checking it only i told you the value of x .
01-30-2021 11:29 AM
Do you know what highlight execution does?
It shows you the data flowing down the wires, and so that you can actually see that, it intentionally slows down the execution of the code. There is now way you could see the values if the code was executed at full speed where loop iterations are in the millisecond level.
Turn off highlight execution and you'll be fine!
01-31-2021 12:16 AM
Thank you for your help. Here I am attaching a png file in this I want to turn off the second digital output in 30 milliseconds before my VI stops can you guide me on how I can achieve it. For now, the second digital output is turned on even the VI stops.