LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Must run twice for daq to work

I have an application I am working on that is giving some minor problems.  When I first boot up the computer, it doesn't seem the DAQ is working at initial startup.  I am using a Daqpad 6016 (I think that is the model, it is the USB daq) and have some digital outs that should turn on some units under test whent he program first runs.  It doesn't turn them on.  If I stop the program, and restart it, it works fine, it just doesn't work on the initial startup.  After that, it works again, until I reboot the computer, than I have to go through that again.
0 Kudos
Message 1 of 5
(925 Views)
It could be that you are initializing the DAQ unit wrong or need to wait a little longer for the DAQ unit to be recognized before you start trying to do things with the program.  It would be helpful to  see the code or at least a screen shot so that we can try to help you further.


Kenny

0 Kudos
Message 2 of 5
(918 Views)

Unfortunately, I don't have the code on this computer, so I can't do that right now, although I'm not sure what screen capture to send, as it is a pretty large project.  Let me try to describe further what my program does.

When started, it pops up a couple of boxes for user input, basically setting up the test (each box is its own sub vi, and no data aquistion is involved).  From there, it moves on to another sub vi which powers up my units that will be tested with the software.  That vi (at least to this point) only contains a DAQmx write to a digital channel (setting to true) which turns on a relay supplying power to my UUTs.  At that point, none of the UUTs turn on (and the digital line never goes high either).  If I stop the program, and restart it from there, it works fine.

All that said, when you talk about initializing the DAQ, I wasn't aware there was anything to initialize.  All I am doing is using a DAQmx write with a task created in the Measurement Explorer (or whatever its called).

0 Kudos
Message 3 of 5
(905 Views)

How are you using DAQmx to write the task?/  Are you using the Create Task.vi and then choosing the task to copy??

Have your tried setting up the task in your program instead of doing it through MAX??  What I mean is by using the Create Task > Create Channel > Write and setting it to what you need.

The screenshot I was talking about is where you intialize or tell the DAQ unit to start outputting data.

Kenny

0 Kudos
Message 4 of 5
(902 Views)
Highlighted
I've got it set up through MAX right now, I haven't tried setting up the task in the program, but will try that tomorrow.
 
I never do "initialize" the DAQ, and I'm only using it for digital outputs to control relays to control some valves and similar stuff like that.  Basically, the first time I do anything with the DAQ, I just do a DAQmx Write Digital Boolean, 1Line 1Point, and it doesn't work until the 2nd time I run the program.
0 Kudos
Message 5 of 5
(899 Views)