Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Improved While Loop Speed/Timing

$
0
0

I am controlling two solenoid valves using an NI 9482 relay. The first valve will open 500 ms after beginning the program, and the second needs to open anywhere from 15-50 ms after the first valve. There is also a pressure check which will terminate the while loop and close the valves if the pressure does not reach 50 psig within a specified amount of time. When I write to the file to determine when the valves opened, the difference between the x-values are about 100 ms, when I need the while loop to iterate at most every 5-10 ms. What are some suggestions for timing this while loop to run every 5 ms OR just run faster so that the x-values have a deltax of less than 5 ms? Thanks.


Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>