11-27-2006 11:02 PM
Hi bawuer2,
As Christian pointed out, the NI Examples are exactly what you need to get started with your program.
As far as the tables are concerned, they should be built just like a 2D array, so you can simply acquire all of your data in the loop, and then format the tables afterwards. I’ve attached a small example of how a table can be built like the one you’ve described.
Best regards,
Ed W.
11-28-2006 09:40 AM
Hi Brandon,
Part of the reason why I believe your code is running slowly is because you are continuously creating and destroying your tasks. Typically you would create the task outside of your loop and close/clear it after the loop as well.
As I understand it, you would like to acquire a single point of data each time you see a rising edge from your digital signal. This is generally done by running a continuous or finite timed acquisition. You would connect the digital signal to a PFI line and specify the PFI line as your external clock. This should only require one loop(not multiple nested loops). This is assuming you would only like to acquire 1 point for each rising edge of the digital line. If you need to acquire multiple samples for each digital edge then the retriggerable option that Christian suggested would be the way to go. Note that the finite retriggerable option requires 2 counters.
If you must provide a clock to your external device, you can set up a counter frequency output. This task would be in the same VI but would run independently of the analog task. Take a look at the Acq.&Graph Voltage-Ext Clk.vi example as well as Gen Dig Pulse Train-Continuous.vi.
As for working with the table... You can use an Invoke Node to specify which cell to write to. One way to do this would be to use the Quotient&Remainder function. You could increment a number each time you receive a sample. Then you can use the Quotient&Remainder function to divide by 64. The quotient and remainder would be used to specify the row and column to write to. Depending on the order you choose the data will be written in rows or columns of 64.
If these suggestions do not work for you please post back with the problems or errors that you are having.
Hope this helps.
Jennifer O.
Applications Engineer
National Instruments
11-29-2006 07:41 PM
"As I understand it, you would like to acquire a single point of data each time you see a rising edge from your digital signal. This is generally done by running a continuous or finite timed acquisition. You would connect the digital signal to a PFI line and specify the PFI line as your external clock. This should only require one loop(not multiple nested loops). This is assuming you would only like to acquire 1 point for each rising edge of the digital line."
This is what I did. In my code attached I have attached the top two lines send the two signals that I want. The third one reads in the analog line. I want it to have it read in one sample everything the external sample clock goes high which I think is what I have. The waveforms are in real time (it seems that there is no delay) however I do not get the number of samples at the speed of the sample clock. For example, my sample clock would be running at 138kHz which would mean that my analog read while loop should run 2170 times per second (138k/64) because it reads in 64 samples at a time. But it seems that it runs much slower when I monitor the while loop iterations. Am I missing something or is there anything to speed it up? Thanks.
11-30-2006 08:39 AM
11-30-2006 09:19 PM
11-30-2006 11:19 PM
Yeah I'll take a look at that information , thanks. I am using LabVIEW 7.1. but I also have an evaluation copy of 8.2 for another couple of days if you cant convert it. I worked on it today again and I think but I am not sure that the lower number of samples is because of the fact that the two counter outputs aren't exactly synchronized but I got very close to synching them so I can get the sampling rate close enough to what I should be getting.
However, it seems that if I go above a certain sampling rate (about 5000 line scans per second) the waveforms begin to become delayed. Before I couldnt get above 3000 line scans per second without delay but I changed the number of data points in the waveform buffers to 200 and I made them have a greater amplitude range. That seemed to help. Also, in case your wondering I am using a computer with windows xp, 900MHz processor, and 512MB of RAM. Thanks for all of your help.
12-01-2006 08:45 AM
12-01-2006 04:37 PM
12-04-2006 09:15 AM