LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup DAQ to send data line by line

Solved!
Go to solution

No, I should send 2 samples because there is a strobe function that works on the falling edge of P0.30.

 

Let's say I want to send the data I posted in the previous post all at once or Line by line ( line 0 to line 7). Could you please let me know how can I send it to DAQ. I have also attached my vi in the previous posts

Thanks

0 Kudos
Message 11 of 19
(1,440 Views)
I already told you how to send the data line by line. The shipping example sends data to all 8 digital output pins line by line. I already told you to change the display to binary if you are confused by decimal. The shipping example writes a 00000001 (do0 is high, all others low). The second element in the array is 00000010 (do1 is high, all others low). Each pattern in the array is sent one after the other at the specified rate.
0 Kudos
Message 12 of 19
(1,437 Views)

I think you misunerstood me when I was saying line by line

 

 

Let me describe it better.  by line I mean I want to send this line of binary data to DAQ lines

 

 

                           P0.16     P0.17    P0.18         P0.19            P0.20        P0.21      P0.22    P0.23   P0.24    P0.25         P0.26        P0.27  P0.29   P0.30 P0.31 

 

Line 0                   00          00         00              00                 00             00           00          00        00          00               00            00     00       11          10

 

 

After sending this line   I would like to send the second line which is

 

Line1                    11          00         00              00                 00             00           00          00        00          00               00            00     00       11          10

 

and finally Line 7    11         11         11              00                 11             00           00          00        00          00               00            00     00       11          10

 

The red color bit will update the FPGA

 

Now 1 option is send the data line by line to DAQ lines and the other option is to write the whole data all at once and see of it is working, Using the VI I posted before I can send the data line by line and it is working. The sampling rate is 10 MS/s and I would like to write the data in us time ( 1 us) . However,using that implemnetaion it takes about 10ms to send the whole package.

 

Now could you please help me to implement it in better and correct way ( both line by line and all at once)?  How should I config the  write DAQmx? should it be N channel N sample or 1 channel N sample?  I tried to play with the shipped example ( as you pointed ) but it is not working

0 Kudos
Message 13 of 19
(1,413 Views)

You still make no sense to me. The first line - presumably a single write, has a value of 11 for a single digital line (P0.30) and 10 for a different single digital line (P0.31). Your definition of 'line' is incorrect. Those values would be 2 DAQmx Writes. Please use a normal definition. Use your engineering notebook (or quad ruled paper) and define the logic state of each pin for a single update to the DAQ card. Then each row of your data can be easily understood.

0 Kudos
Message 14 of 19
(1,395 Views)

Ok I can write everything all at once , and hardware wise it is working properly but it is still takes about 8ms to write the data. My sampling rate is 10MHz and I am using NI PXIe 6368, number of samples is also 16 so I expect to write everything in fraction in uS time not 8ms. I would greatly apprecaite if you coudl take a look at my code. I really don't understand why it is so slow

 

Thanks

0 Kudos
Message 15 of 19
(1,374 Views)

How are you calculating that time? Is it for the entire VI to execute or just the DAQmx Write? The entire VI includes creating/configurating the task and then a stop and clear. These functions are time consuming and I believe you have already been told that.

0 Kudos
Message 16 of 19
(1,370 Views)

This code will switch a MUX through FPGA. The switching time should be in us ( max 10 us) . The same code has been implemented in c# and it works properly and can switch this mux 10 times in 10 us with the same ampling rate (10 MHz)

 

Do you mean it is limitaion of LabVIEW in comparison with c#?

How can I make it faster? which one of the DAQ functions takes more time to execute?

 

Thanks, 

 

 

0 Kudos
Message 17 of 19
(1,362 Views)
Solution
Accepted by tintin_99

You still have not answered my questions. If you take a scope and measure the actual burst of digital I/O as opposed to the execution time of the entire VI, what time do you measure? My guess it's going to be exactly what you expect. As long as this time is correct, do you care about the setup and shutdown time of the DAQmx functions? 

 

And no, it will not matter what programming language you are using to configure the DAQmx driver. 

 

 

0 Kudos
Message 18 of 19
(1,355 Views)

Oh, I see. Thanks Dennis

0 Kudos
Message 19 of 19
(1,348 Views)