LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to transfer a 4*4 digital array into 4 1*4 digital array and then send to DAQmx Write cyclically?

Solved!
Go to solution

Dear ALL,

 

According to the example - "Digital - continuous output" of LabVIEW 2016, how to change the 1 dimension of digital array into a 4*4 digital array and then send to the DAQmx Write row by row cyclically?

 

Thanks a lot!

 

Best,

 

Jason

0 Kudos
Message 1 of 14
(3,888 Views)

You can auto-index on arrays which will break down (or build up on an exit tunnel) a 1-D array element by element.  For a 2-D array it will do it row by rows.  (If you want column by column, then transpose.)  A 3-D array, page by page.

0 Kudos
Message 2 of 14
(3,883 Views)

Hi RavensFan,

 

Thanks for your post!

 

Since I am pretty new to LabVIEW, could you please show me how to do it in the 2D example with a picture or snippet?

 

Thanks a lot!

 

Best,

 

Jason

0 Kudos
Message 3 of 14
(3,880 Views)

Dear RavensFan,

 

Thank you for your reply!

 

I did a auto-index with a For loop, but I doubt whether the row by row digital data can be write into DAQmx Write cyclically and got no false message? Can you help me about that?

 

Thanks!

 

Best,

 

Jason

微信截图_20180805140357.png

0 Kudos
Message 4 of 14
(3,878 Views)

Hi RavensFan,

 

I have tried your advice in my program as below. May I ask what can I do to write the data row by row with the timing controlled by DAQmx Timing?

 

Thank you for your advice! I really appreciate it!

 

Best,

 

Jason

 

微信截图_20180805141010.png

0 Kudos
Message 5 of 14
(3,874 Views)

Hi Jason,

 

in your image you are using DAQmxWrite in "1 Chan" mode. You need to set it to "n Chan" mode to accept 2D data!

 

I thought you already learned that from your previous threads...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 14
(3,851 Views)

Hi GerdW,

 

Thank you very much!

 

So I should use DAQmx Write -- Nchan Nsamp, right? But in this way, how can I send a 4*4 digital array to the DAQmxWrite row by row cyclically whose speed controlled by DAQmxTiming (the speed to change row by row)?

 

I am not so sure about that. Sorry! If only you can give me some advice or snippet!

 

Thanks a lot!

 

Best,

 

Jason

0 Kudos
Message 7 of 14
(3,848 Views)

Jason,

 

     We understand that you have a 4x4 array of Booleans, and that you presumably want to send them to a Digital Output device.  But there are multiple ways of doing this, and you haven't clearly explained what you want to do, nor given us a good idea of what the 4x4 array represents.

 

     Can you explain what the Array represents?  Do the Rows represent different channels of data?  Do the Columns represent different time points?  One of the curious things is the relative small dimensionality -- one expects # Channels to be small, but number of samples is generally on the order of 100 to 1000.

 

     Yesterday I responded to a Forum poster who was dealing with a 4x4 multiplexer, where the numbers represented the dimensionality of the physical layout of the switches.  I'm guessing you situation is different, but still unclear.  Please help us to understand, so we aren't just "guessing" what you really want to know.

 

Bob Schor

0 Kudos
Message 8 of 14
(3,839 Views)

Hi Bob,

 

Thank you very much for your reply!

 

For example, a 4*4 4-bit digital array:

 

 1111 1110 1101 1100

1011 1010 1001 1000

0111 0110 0101 0100

0011 0010 0001 0000

 

I hope to send the data row by row to DAQmxWrite like 1111 1110 1101 1100, then 1011 1010 1001 1000......0011 0010 0001 0000, then cyclically 1111 1110 1101 1100...

 

I got 4 DO lines to output each row of data time after time. Next question is how to control the speed of change the data and how many samples to write each time each row. So I hope to use DAQmxTiming to control the time or speed of scanning.

 

Do you know active matrix? This part above is for data driver and I got a scanning driver. It's like scanning  a row and then send the row of data into the scanned row. The data will be converted into voltage through DAC from the outside.

 

Thanks. I do really appreciate it if you can give me any advice or example.

 

Best,

 

Jason

                                                                 

0 Kudos
Message 9 of 14
(3,827 Views)

Hi Jason,

 

I hope to send the data row by row to DAQmxWrite like 1111 1110 1101 1100, then 1011 1010 1001 1000......0011 0010 0001 0000, then cyclically 1111 1110 1101 1100...

I got 4 DO lines to output each row of data time after time.

So this still is all about the very same problem as in your other thread(s)…

Do you want to output the "digital arrays" to your 4 DO lines simultanuously (each row to one DO line, at the very same time)?

Or do you want to output the data "each row time after time"? (Why would you need 4 lines then?)

 

Next question is how to control the speed of change the data … So I hope to use DAQmxTiming to control the time or speed of scanning.

As has been said many times before: use DAQmxConfigureTiming toi set the samplerate of your DAQmx task!

 

and how many samples to write each time each row.

Write your 16 bits per channel at once, DAQmx will use some internal buffers to hold the samples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 14
(3,823 Views)