LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stucked in Retrigger option NI-6255 Mass termination device,

Solved!
Go to solution

I am writing code that receives analog input voltage from a sixteen-channel system. The sampling clock is set to a frequency of 40 kHz, continuously sampling one sample per channel. The trigger settings include an analog trigger signal of 1.0 volts at a frequency of 100.0 Hz. I've also attached a copy of the code with this message as an attachment.voltage retrigger2_page-0003.png

 

voltage retrigger2_page-0002.png

 

voltage retrigger2_page-0001.png

 

0 Kudos
Message 1 of 6
(522 Views)
Solution
Accepted by Hasham622x

Please upload the code. We can't test or debug an image.

-------------------------------------------------------
Applications Engineer | TME Systems
Message 2 of 6
(490 Views)
Solution
Accepted by Hasham622x

Hi,

 

Thanks for your reply. I've attached the VI code to this message. My code is taking twice as long to run, and I'd like to reduce the execution time. The retrigger function is working well, as seen in the waveform and Excel data. Could you guide me on how to reduce the time? I tried using a timed loop but need help managing its parameters. I also tried adding the DAQ Task Assistant and DAQ task.

 

Once again thanking you

 

 

0 Kudos
Message 3 of 6
(464 Views)
Solution
Accepted by Hasham622x

You are not using the correct way for the analog retriggerable task. Every time you start and stop the task, it creates overhead and delays.

Refer to Retriggerable Data Acquisition with NI DAQ Devices for a shipping example of M Series USB DAQ device.

-------------------------------------------------------
Applications Engineer | TME Systems
Message 4 of 6
(452 Views)
Solution
Accepted by Hasham622x

Thanks for your reply. In my current code, I am using the committed state VI, which has improved my code optimization.

If you don't mind, could you please guide me on why the minimum number of samples per channel is 2 when I select the finite samples option in the sample clock? I need to set it to 1, but doing so results in an error.

0 Kudos
Message 5 of 6
(438 Views)
Solution
Accepted by Hasham622x

A sample clock defines the interval between samples.  It takes at least 2 samples to define any such interval.  With just 1 sample, a sample "rate" isn't really meaningful because there's no longer any defined interval.  You could probably just run in "on-demand" mode, which would be the default if you never called DAQmx Timing at all.

 

That said, there's also really no *harm* in defining a task for multiple samples and a sample clock, then stopping the task prematurely after reading only 1 sample, the way you do in the code you posted.

 

Is there still an actual problem or are you just looking for understanding?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 6 of 6
(391 Views)