Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ 6036 Digital Output duration

Hallo,
I'm using a DAQ 6036 and trying to send to Digital Output Port 8 bits words for a home made external multiplexer/amplifier (strain gauge application).
I configure my DigOutPort with DIG_Prt_Config() function called with (dev,0,0,1) parameters.
Then, I send the word out with DIG_Out_Prt() function called with (dev,0,my word) parameters, but no way to keep the digital word on output lines for the desired time duration T. In my case I wish T be at least 10 ms (but even 1 sec is ok).
Could you help me? Thank you all and Great 2005!

andrea
0 Kudos
Message 1 of 10
(3,771 Views)
Andrea,

the operations you are doing are correct.
The only problem that I see is that you keep calling the DIG_Prt_Config() inside a loop and call it before you pass the word to write to your DAQ board. This would reset your lines befor you actually write to them.
Can you post an excerpt of your program to see if there is anything wrong?

AlessioD
National Instruments
0 Kudos
Message 2 of 10
(3,757 Views)
Dear Alessio,
here you find the excerpt you asked for. Thank you for your prompt answer!
Yes, the DIG_Out_Prt is in a loop but I tried also to insert either a Sleep() or a NIDAQDelay() to slow down the cycle time; the loop slows down hanging on the sleep (or delay), but the leds of my channels on my mux/amp turn off immediately (just a flicker since the digital lines are set to the desired channel number only for a while).

Thank you again
andrea
0 Kudos
Message 3 of 10
(3,740 Views)
You are not doing anything special in your code.
Can you post a built Exe so that I can test it with my board and see what happens?
I was not able to reproduce the problem you are seeing
Regards,

AlessioD
0 Kudos
Message 4 of 10
(3,740 Views)
Hallo Alessio,
sorry for the delay but I have had problems in getting a clean .exe file without debug information within.
Here you find a .exe file: launch it and 48 channels + some buttons appear; all the channels are grayed; you must press CONFIG and load the configuration file I have attached; this enables the first three channels; then you press SAVE and the button OFFSET enables; if you press OFFSET then you start an acquisition on the three channels, that is the loop you have seen in the excerpt of some days ago. You should see three different digital words with channels 0, 1 and 2; the most significant bit is a flag bit.
Now you should see the digital lines that don't hold the high bits, falling down to 0 in a while, as I noticed on my mux/amp leds.
Use the x button upper right to close the program; the EXIT button is disabled.

Thank you again for your effort.
andrea
0 Kudos
Message 5 of 10
(3,698 Views)
I cannot attach the file (113 kB zip file)
0 Kudos
Message 6 of 10
(3,690 Views)
Here is what I see.

Starting from a situation where all digital lines are in a HIGH state. I have leds attached to each digital line and all the leds are lit.
1) after pressing CONFIG and selecting the configuration file you attached, I see ch0, ch1, ch2 are checked while all others are not.
2) press SAVE, then the OFFSET button is enabled and all digital lines are set to LOW state, all leds are off.
3) press the OFFSET button, there is a delay of approximately 20 seconds during which the leds remain off. I guess this is where the acquisition is done
4) after 20 seconds I see DIO7 turn on and stay lit
5) then DIO0 lights up then it turns off and DIO1 turns on.
6) operations terminate with DIO7 on (never went off) and DIO1 steady on.

I also tried to turn on up to 20 channels and the pattern that I see on the digital port is a number corresponding to the sequential number of channels, while DIO7 is always up (guess this is the flag).

Is the behaviour I described similar to what you see or is it what you expect it to be?
Regards,

AlessioD
0 Kudos
Message 7 of 10
(3,675 Views)
The sequence is what I expect.
The 20 seconds "blank time" is due to initial SELF CALIBRATION of the DAQ card, performed when you press the OFFSET button, then Acquisition starts.
One question: how long the DIO0 stays on? It should be on for approximately 0.7 seconds, but what I see on my mux/amp at home is a rapid flicker, much shorter than 0.7 sec. This is my problem, I hope that your answer will be DIO0 stays on long enough, so maybe the problem is related to specific DAQ-laptop configuration issue or some mistake in the mux/amp (I don't believe because it was tested with a wire-wrapped hardware simulator). And I can manage them, or at least I should... thanks
andrea
0 Kudos
Message 8 of 10
(3,671 Views)
Andrea,
the leds stay lit for approximately .5 seconds. I don't see flickerings at all.
I suggest you monitor the digital lines using a scope. If you acquire DIO0 line you should see it go up and down with the correct timings.
Regards
0 Kudos
Message 9 of 10
(3,668 Views)
Thanks Alessio. Now I know that my code (function calls) is correct and I'll look for troubles elsewhere.
regards
andrea
0 Kudos
Message 10 of 10
(3,664 Views)