LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting devices and counter states

How frequently should one make use of Reset Device? I have placed it at the start of a LabView program so that it runs every time this program is called. This is because we sometimes use Traditional DAQ applications and sometimes DAQmx. Is this necessary?
    Also, I would like the counter to initialize at 0V. Now it puts out 5 V after Reset Device. I am using the NI6715 PCMCIA card. Right now, I reset the device and then ask for 2 ticks high (the minimum) and 1000 ticks low with the Idle State on Low. Then I call for Start Task and Wait Until Done to force the counter low. There are times when the counter needs to be forced high. With DAQmx, what is a good way to toggle the counter as needed? The counter is controlling a switch that sometimes needs to pulse and sometimes needs to remain in one position or the other.
    Thanks,
Peg
0 Kudos
Message 1 of 2
(2,504 Views)
Hello Peg,

Reset device is only necessary if the device is left in a state that the driver will not be able to communicate.  This can happen if a previous task is not stopped/cleared and a new task is created or sometimes when going from one driver to another (Traditional DAQ to DAQmx or vice versa). 

If you are not getting an error when you start your code, the reset is not necessary. If you happen to get an error, you can manually reset your device in MAX, or you can even conditionally reset the card in your code (i.e. try to create and start your task and if an error occurs, call the reset device function and rerun the code.

You do not need to completely run a task to set the idle state.  You can use a DAQmx Control Task function with the action set as "commit" to make the idle state take effect.  First you would configure the task you eventually want to run on the counter, then commit it.  Later when you want the counter output pulse to run you can call the DAQmx Start Task function. When you need to change the idle state, simply clear the task and begin a new one in the same manner with the appropriate idle setting.  A digital line is an alternate option which can be simply written high or low.

Hope this helps,

Jennifer O.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,488 Views)