Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneously AI and AO

Thanks, I have a question about the write LVM and read LVM functions. I write a sample VI to generate a 2-array, shown by a intensity picture. The generator output a sin-wave at 100Hz, The sample rate is 100k, and I get 2k samples (2 periods), and the output of the graph and intensity are shown as:
 the x axis is the loop times 10, the y axis is sample number 2000, and the z axis is the data of the 2-xy array, from 0 to 1. The output file writen by the WRITE LVM function is attached. But when I use Read LVM function to input data from the same file and shown by the intensity files, there is somethong wrong. The diagram is:
, the output of the intensity graph is 
 
 I think there should be something wrong in my using those two functions.
 
0 Kudos
Message 11 of 23
(2,223 Views)
Hi, I have got the answer by myself. Just not to write the time is ok.
0 Kudos
Message 12 of 23
(2,218 Views)
Hi, I don't know while I can not reconstruct the waveform as the timestamp? for example, my sample rate is 100kHz, and sample data is 2000, so the total waveform time should be 0.02s, but when I read the data from file, it becomes 2000 which is the number of samples? I do not know why?
The waveform I write to file is, while after I read it from file, it becomes , I have wrote the time to the data.lvm, but when I open it with notepad, I find that the time column is also from 0 to 1999, not 0 to 0.02. It make a wrong result of signal analyze of spectrum. Could you please give me some advice on how to keep the time as the real sample rate.
0 Kudos
Message 13 of 23
(2,217 Views)
Hello Jason,

Can you repost your images/waveform files as attachments to the post rather than placing them directly into the message body?  I think looking at these images would help me to get a better idea of what your describing.  Also, in your program, are you using the Sample Clock or Use Waveform instance of the DAQmx Timing VI to set your sample clock rate?

Travis G.
Applications Engineering
National Instruments
www.ni.com/support

Message Edited by Travis G. on 09-22-2006 02:57 PM

0 Kudos
Message 14 of 23
(2,202 Views)
Smiley Happy
Thanks, my intention is to record the DAQ data to a file for later signal processing. So I just write a example to test such method. One is to generate a waveform and write the data to a certain file, then using the read LVM function to acquire the same data again.
 
Download All
0 Kudos
Message 15 of 23
(2,196 Views)
Jason,

It appears you are converting the Dynamic datatype (Navy) wire to a 2-D floating array.  The Dynamic datatype contains the timing information associated with the signal.  You will want to wire the dynamic wire directly to the Write LVM Express VI.  Since this is happening outside a loop and the Express VI wants a one dimension array, it would probably be best to do the file write inside the loop. Be sure to turn on the Append option.

Likewise, in the read function, make sure the wire is blue when it goes into the Waveform graph. This ensures the timing information is transferred.

Hope this helps.
--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 16 of 23
(2,157 Views)

Thanks. I have another question about the Intensity graph and writing files.

I write a DAQ program, in this program, the sample rate is 200kHz. Each time I read 4000 samples to form a 1-D array, and I use another while loop to form 2-D array. At the end of loop, I want to write the 2-D array data to the intensity graphy and also store it to a file. However, when the program stops, there is always only 1-D array shown in the Intensity graphy, and also 1-D data writen to a file. I do not know the reason.  Because I write a demo program to test the intensity graph and the writing. It works. In the demo program, for example the loop run 10 times, the X axis of intensity graph will show 10, and also 10 column data will be recorded in the file.

Please help me. The two program are attached.

Download All
0 Kudos
Message 17 of 23
(2,113 Views)
In the Writetest example, when you exit the while loop, you've selected 'Enable Indexing'. This was the correct thing to do so that every iteration of the while loop is captured. This is what creates a 2D array. In your other VI, you've got a Convert from Dynamic Data and you've selected 2D array as the output but this doesn't really do anything since you've only got 1D data in the first place. I also don't understand the purpose of the Absolute Value function. If you would simply wire the output of the DAQmx Read through the while loop and enable indexing, you could wire that to the graph and the write function.
Message 18 of 23
(2,113 Views)
Thank you sir, I'll try it.
0 Kudos
Message 19 of 23
(2,104 Views)
Hi,
Thanks for your advice.
Now I get another question that I want to change the name of intensity graph axis. I have a 2-D array and want to use intensity graph to show it. However, the x and y axis always show the number of the 2-D array, for example, the array is 100*200, the x shows 100, and y shows 200. In fact, the 100*200 data array is the samples from a 1mm*2mm, so I want to change the maximum x axis value to 1mm, and the maximum y axis value to 2mm, could you please tell me how to change the axis. When I change the x axis maximum to 1 and y axis maximun to 2, the intensity graphy only shows the data 1*2, not the total array.
 
Thanks,
0 Kudos
Message 20 of 23
(2,081 Views)