Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Send elements from excel to DAQ at 10kHz

Solved!
Go to solution

Hi all,

I am very new to LV and would like some help with my application.  I have attached a copy of my current VI and a sample data file.

 

What I am doing sounds pretty simple to me but I have been having some problems with the implementation.  Basically, I have a spreadsheet and I need to output the values of this file to my DAQ card so I can use the 'signal' on some external hardware.  My rate needs to be 10kHz which I know can be accomplished by using a timed loop and the clk signal from my 6036 E series DAQ (pcmcia).  The main issue that I have been having is how to get each element of the spreadsheet to appear 'outside of the loop' so the DAQ can access it. If the DAQ is inside the loop then it gets called during each iteration and runs much too slow.

 

Any input will help, thanks in advance and let me know if there is anything else that I can provide.

 

-Joe

Download All
0 Kudos
Message 1 of 7
(3,494 Views)

How about reading the excel data first (and complete) and then start sending it to the DAC?

If you run into memory problems: 

- avoid additional copies of the data (seach the KB about memory management of large data sets)

-reduce the data (analog output can bestored as a 16bit value)

 

Next step would be to read the excel data in parts and store it as a 16bit binary file. This could be read a lot faster.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 7
(3,481 Views)

Thanks for the quick reply.  I think that what you are suggesting is already implemented.  The VI will pull all of the data from the excel file and the loop is indexed in a way that it will "scroll" through each element - the iteration number is used to call the row.

 

The problem is that I can't get the information that is being called to apprear outside of the loop where it can be sent to the DAQ.

 

I have updated the VI so the problem can be seen easily.  I have also slowed the loop with a delay so what is happening can be seen easily.  This while loop will eventually be replaced with a timed loop.

 

Using the test data and the VI attached to this message you can see that the indicator inside the loop updates and scrolls through the elements as desired, but does not update outiside the loop (where the daq express is).  How can I get this informationto the DAQ where I need it?

 

Thanks again.

Download All
0 Kudos
Message 3 of 7
(3,472 Views)

Your loop is completely wrong. It's not necessary at all for that matter. all that you have to do is use the Index Array function on the 2D array you have.

 

You might want to take a couple of LabVIEW tutorials to understand why your loop cannot work.

0 Kudos
Message 4 of 7
(3,468 Views)

Thanks for the response.  As I stated in the original post I am new to LV so any real advice is appreciated.  If the VI was "right" and not "wrong" then I obviously would not have posted here.

 

Anyways, in response.  The loop was to be used as a timing mechanism.  I am already using the index array function to access each piece of the data.  How then, would I be able to use the index array to output these data points at a specific rate of 10kHz to my daq?
0 Kudos
Message 5 of 7
(3,461 Views)
Solution
Accepted by topic author JDupe

You don't use any sort of loop operation to configure the DAQ timing. You pass the entire array to the DAQ Assistant and you configure the DAQ Assistant for a sample rate. When you pass a single point at a time to a DAQ device, you are using on-demand timing and you would be very hard pressed to obtain the sample rate that you want. The time between samples would also be highly variable because of the non-determinism of windows timing.

 

You were not using the Index Array function to get each element of the array. Since the only way to stop the loop was to click on the abort button, you were not getting anything out of the loop. Even if you had configured the loop to terminate accorinding to the size of the array, you would only get the very last element. Using the Index Array function on the 2D array, you will get an entire column or row.

Message 6 of 7
(3,454 Views)

Thanks Dennis,

This worked.

-Joe Duperre

0 Kudos
Message 7 of 7
(3,417 Views)