Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting a DAQ

Hey there,

 

I'm having a problem with the PCI-6229 and SCB-68 at the moment. Attached is my code. I feed a 100 kHz square wave (Its a DAQ generated wave) into the DAQ named "Square Pulse"

 

For example, when the "Beacon 1" button is hit, a 500Hz beep is sent out through a speaker using the DAQ "Send Beep" and that same button starts the count. When DAQ "Signal In" has returned a logic 1 I want the "Square Pulse" DAQ to not only stop counting, but reset the count back to zero so that I can repeat the process.

 

***Whats Happening at the moment***

 

It works fine the first time. When I hit the "Beacon 1" button the count runs, it calculates the distance and when the DAQ "Signal In" has returned a logic 1 it resets the count to 0 and outputs the distance. The problem is when I try and run it again, the count will continue from where it left of the last time, thus altering the distance measurement. Its either that, or the count will not work again and it will be stuck between 0 and 2 counts.

 

Can you help?

 

Cheers

 

K  

Download All
0 Kudos
Message 1 of 3
(4,157 Views)

Hi Kamilan,


Very clean and organize coding, congrats for that. When coding in DAQmx you have two options you can either program using the high level express VIs like you are doing, or you can code using the low level VIs.

 

If you run both of the VIs I have attached you will see that the count does goes to zero. “Count Digital Events.vi” is counting the edge of the internal route: “Dev1/Ctr0InternalOutput”. The pulses are been generated by: “Gen Dig Pulse Train-Continuous.vi”. If you run both of them you will see that the count does go to zero. Can you use the indicator instead of the local variable?or Are you using a local variable somewhere else in you code?


A neat way of checking how similar your DAQ assistant code and the example are is to: “right click the daq assistant and generate DAQmx code".


Let me know if it helps.

 

Jaime Hoffiz
National Instruments
Product Expert
Download All
0 Kudos
Message 2 of 3
(4,151 Views)

Hi there,

 

Thank you for the information on DAQs. Could you please resave the attached file to 8.2.

 

Cheers

 

K

0 Kudos
Message 3 of 3
(4,145 Views)