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
(163 Views)
Solution
Accepted by topic author Hasham622x

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

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 6
(131 Views)
Solution
Accepted by topic author 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
(105 Views)
Solution
Accepted by topic author 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.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 4 of 6
(93 Views)
Solution
Accepted by topic author 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
(79 Views)
Solution
Accepted by topic author 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

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 6 of 6
(32 Views)