04-09-2014 01:24 PM
Hello,
I am using a USB-6341 XSeries multifunction DAQ system to control an experiment involving a heated pipe. I am using MATLAB to read a number of analog sensors, and the Digital Outputs to activate relays to control some heaters and a pressure relief valve. My problem is that if I lose power, someone kicks a cable, or my computer crashes mid-test, I want the relays to turn off (ie return all the digital outputs to 0), for safety reasons.
I have figured out how to have the default output on power up be 0, but I havent come across anything describing how to do the same thing if a connection with the computer is lost. Is there a property inside the DAQ that I can program to do something like this?
Thanks
Jimmy
Solved! Go to Solution.
04-09-2014 02:17 PM
you need to send some ack commands set by your self like PC send ack code and from DAQ you sent a counter value to PC, every time ack recieved , increment the counter and sent it PC. the ack and counter exchange interval should be set after every 1 sec or even less its upto you. make a check timer in your DAQ which check whether ack recived or not . if it is not recived for 1 sec means PC lost comm so THE check timer set you DAQ Digital IOs to boolean 0.
04-09-2014 04:33 PM
The 6341 has a built-in watchdog timer for the digital I/O lines which is mentioned in the X Series User Manual in chapter 6 (pdf link).
You reset the watchdog timer from your software loop--if the timer expires the hardware goes into a pre-defined state.
I have no idea how it is configured in MATLAB, but in the C API the functions used are DAQmxCreateWatchdogTimerTask to create the task and DAQmxControlWatchdogTask to reset the timer.
Best Regards,