Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ weird initialization

Hi all,

I`m a labview newbie and I`m facing some weird behavior that i`d like to clarify.

I`m writing a code to count pulses out of a avalanche photodiode and at some point of it I have the initialization of the DAQ card using the "DAQmx Create channel" followed by the "DAQmx timing" and the "DAQmx start". The program written like this won`t work but surprisingly if at the same time I create another channel (without ever using it) than it works.

Does anyone know the reason for this behavior? I`ve attached the initialization part of the code with the 2 channels for reference, thank you all!

 

Cheers,

Paolo

0 Kudos
Message 1 of 6
(3,517 Views)

Is there a reason that you set the sample clock to /Dev1/ai/SampleClock?

 

Just delete that and it will use the internal clock for that channel. That might be all...

 

-gaving

0 Kudos
Message 2 of 6
(3,512 Views)

Thanks for your prompt answer gaving!

I've been told that it's necessary to tell the DAQmx timing which the clock source is in the case of pulse counting.. I'm not sure why but if i take it away it doesn't work both with one and 2 open channels.

 

Paolo 

0 Kudos
Message 3 of 6
(3,508 Views)

It depends on the board you are using...so...what board are you using?

What do you mean by 


...it doesn't work...


Does it return an error? Does it not return any data? Maybe you should verify that you are doing all the other parts correctly...I'd suggest looking at the example 

C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\DAQmx\Counter Input\Counter - Count Edges (Continuous Clock).vi

(change "program files (x86)" to "program files" and use the correct version of LabVIEW to find it)

 

-gaving

0 Kudos
Message 4 of 6
(3,500 Views)

Sorry, I should have been more precise.

The program runs but it doesn't return any data, only zeros.

I'm using a NI usb-6259 DAQ.

I'll try to check the examples you suggested too, thanks a lot!

0 Kudos
Message 5 of 6
(3,464 Views)

The example indicated

C:\Program Files (x86)\National Instruments\LabVIEW 2012\examples\DAQmx\Counter Input\Counter - Count Edges (Continuous Clock).vi

is the best way to start using your hardware because it's a good example about what is necessay to initialize an acquisition task before using the same task to acquire data continuosly.

0 Kudos
Message 6 of 6
(3,444 Views)