12-16-2012 05:15 PM
You can run the code in Highlight and Retain values mode and it should be pretty clear what happens.
/Y
12-17-2012 03:11 AM
I have been testing the code and there is a problem with the control of the relay, this is what happens: If I enter a value for the first time the relay is switched on and the value is stored (perfect!) when I increase the value of the flowmeter above the entered value the input of the case structure changes from FALSE to TRUE but the relay stays on. The input condition for the relay in the event "value change" stays TRUE. The only way to reset the relay is to give a reset in MAX. Do we need to change the input to false in the event "value change", reset this condition together with the value in the numeric?
12-17-2012 06:20 AM
This seems to do the trick. I have made some modification to the relay control, now it's turning on and off, i have added the reset for the numeric. When I had figured that one out the relay whas switched on again because off the "change in value". I have solved this one with a case statement in the event "value change" so it only runs when the value is greater than zero. If you have any comments on the modifications please let me know!
12-19-2012 10:59 AM
Looks like you can simplify it to include both on/off in the flow:value change, if 0, turn it off, else turn it on. Nice and clean.
(codewise you only need to move the daq assistant from the timeout case to the value change.)
/Y