02-20-2013 03:10 PM - edited 02-20-2013 03:12 PM
Hi, here is my code for judging pH and adjusting pH value using state machine.
I only finished the cases when pH >7.5, I havent done the cases for pH<7.5.
I understand its very akward because it lacks of real control alogrithm; But I really dont know how to program a controller to relate time and pH value together.
In the VI, you will see I adjust pH by opening/closing relay board which further drives valve to open/close to let electrolyte flow out/stop.
We will do experiment to determine the time for opening/closing valves... It will invlove a lot of work and I am aware of it.
Any suggestion regarding programing technique, bug, etc will be appreciated. Thank u!
p.s the BEi delay VI is provided by one of NI forum adminstrators.
Solved! Go to Solution.
02-20-2013 03:31 PM
I found one problem myself,
in the case of ''start DAQ'', I want the VI to take measurement for 5 seconds and stop, then it can calculate mean value. The mean value will be used for later cases.
The problem is the start DAQ keeps running, when 5 seconds is reached, the mean pH value is calulated but the Vi is stilling reading data...
02-21-2013 12:02 PM
Hello
-You could wire the stop input in the DAQ assistant and the stopped output to the end condition of the loop to stop the acquisition after 5 seconds.
Regards