LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

New problem: How can I use DAQmx timing in the loop instead of "wait" vi?

Solved!
Go to solution

Sorry, i am recently moving and my PC is in a box somewhere in a truck 🙂 I only have a smart phone, so i cannot really help you right now. Maybe someone will help you in the meanwhile in the forum...

Message 11 of 18
(1,451 Views)

Hi GerdW,

 

Thanks for your reply!

 

But how to switch off the LEDs right after the loop? Can you show me that?

 

Thank you!

 

Best,

 

Jason

0 Kudos
Message 12 of 18
(1,433 Views)

Hi Jason,

 

But how to switch off the LEDs right after the loop?

The same way as you switch them in the loop: using a DAQmxWrite function!

 

Some pseudocode:

DAQmxInit
DAQmxWrite(TRUE)   ; before the loop
FOR x = 0 to n
   DAQmxWrite(random bool)
NEXT x
DAQmxWrite(FALSE)  ; after the loop
DAQmxCleanup
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 18
(1,430 Views)

Dear NI family,

 

I am new with LabVIEW. For example, I want to output digital data 15 (which is 1111) to a shift register and then a DAC on the outside breadboard. How can I do to make the digital data 1111 send out like serial way of 1-1-1-1 only through 1 line or 1 channel?

 

The shift register can change the serial input into parallel output for the DAC. And then DAC will output a DC voltage to the circuit connected on breadboard.

 

Thank you very much!

 

Best,

Jason

 

0 Kudos
Message 14 of 18
(1,416 Views)

Hi leo,

 

why do you start new threads for the very same topic again and again? Why don't you stick with your threads?

 

Have you tried the example VIs coming with LabVIEW?

There is a "Write Dig Chan-Ext Clk" example (LV2011) showing how to output more than one value per channel. (A similar example is named "Digital - Finite Output" with LV2017.)

 

It's the very same as with analog channels: you create a waveform, then you output that waveform with a predefined sample clock!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 18
(1,414 Views)

Hi GerdW,

 

Thanks for your reply!

 

Sorry I just don't get it. Because what I need is a little different from the example. I hope to 4*4 data in advance and then the data should output row by row to a 4*4 matrix which means when scan1a opens the 1st row, the first row of digital data should send to the first row, since each row of the matrix has 4 pixel, each data should send to the pixel only by 1 line (serial data->1 line->shift register->dac->pixel). 

 

The timing control should control the scan and data but the high of data should larger or contain the high time of scan to ensure the data sent successfully.

 

I am still not sure how to do it. Can you help me or give me some advice about that?

 

Best,

 

Jason

0 Kudos
Message 16 of 18
(1,407 Views)

Hi Jason,

 

Last time you asked for:

I want to output digital data 15 (which is 1111) to a shift register and then a DAC on the outside breadboard. How can I do to make the digital data 1111 send out like serial way of 1-1-1-1 only through 1 line or 1 channel?

Now you ask for:

I hope to 4*4 data in advance and then the data should output row by row to a 4*4 matrix which means when scan1a opens the 1st row, the first row of digital data should send to the first row, since each row of the matrix has 4 pixel, each data should send to the pixel only by 1 line

You are not very consistent in waht you ask for…

 

But anyway: the same example applies for both cases!

First you asked for "1 channel N samples", now you ask for "N channels, N samples" mode: simply change the instance of DAQmxWrite (and adapt the data input array as needed)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 17 of 18
(1,398 Views)

Hi GerdW,

 

Thanks for your reply!

 

So the data sent to shift register and then DAC, after DAC the data will become analog data - voltage. Next, the analog data will be sent to DAQ again through AI0, but how can the data of AI0 be calculated mathematically with nodes in the numeric panel such as add/multiple some number and then send out the final result? How to insert the data of AI0 into a mathematical calculation in LabVIEW and return the answer to the front panel?

 

Many thanks!

 

Best,

 

Jason 

0 Kudos
Message 18 of 18
(1,391 Views)