07-12-2005 10:54 AM
Thus far, i have been advised that the attached VI will do the trick but could someone please help me remove the Trigger VI and Insert the " Write Waveform to File.vi" to save the acquired signals? Then how do i modify the VI to acquire 10 signals instead?
If i am posting in the wrong forum, can someone please advise me??? Thanks a lot.
Regards,
Vipin S.
07-12-2005 10:35 PM
First, the code you have should be able to acquire multiple channels as is. The help file for the Physical Channels input says:
"physical channels specifies the names of the physical channels to use to create virtual channels. The DAQmx Physical Channel Constant lists all physical channels on devices and modules installed in the system. You also can wire a string that contains a list or range of physical channels to this input. "
One thing that might have been confusing you is that the top-level VI you posted calls that input physical channel (singular--hence implying single-channel acquisition).
Are you not familier with editing LabVIEW code?
Mike...
07-13-2005 04:48 AM
07-13-2005 06:48 AM
07-13-2005 02:30 PM
07-13-2005 03:48 PM
Vipin,
For your reference, you should be able to find help on the VI in question by clicking on help->Show Context Help. This will give you help for the element on your block diagram that the mouse is hovering over. File path is the path/name of the file you would like to write to. If it is not wired, LabVIEW will prompt you for this. Append to File is used to specify whether you want to write over any existing data in the specified file, or append to the end of it.
For your case, I would actually recommend that you don't use the Write Waveforms to File.vi at all. If you open it's block diagram, you will see that it will both open and close the file specified. However, it is MUCH more efficient to open a file once, write to it multiple times, then close when you are done. In the attached example, I basically opened the block diagram for the Write Waveforms to File.vi, and placed it's sub-VI's into your VI. If you look at what I've done, you'll see that I open the file to write to at the very beginning of the program. I then configure the acquisition. Next, in the while loop I read data and write it to the file we opened at the beginning of the program. At this point the program will continue to acquire data and write it to the file. Finally, after the acquisition is stopped, the file is closed.
The error you were receiving is likely do to the fact that since you had the file path unwired, you were prompted for file. While this occurs, you are unable to read data out of the buffer from your acquisition. As a result, your DAQ device continues to write data to the buffer, and eventually overflows it, hence the error you received. Try running the attached example and see if this does what you would like. Also, I strongly encourage you to use the context help if you have questions about the VI's that ship with LabVIEW. I've been using LabVIEW for a few years, and I still find it to be very helpful.
07-14-2005 07:27 AM
07-14-2005 08:20 AM
07-25-2005 06:13 AM
Hi Vipin S
The VI you attached looks like it will acquire data ok. Generally you would not mix the DAQ assistant with lower level DAQmx VIs. Is there a particular reason you have done this?
The waveform to file functions you are using appear to create a binary file. You will be able to load this data back into a LabVIEW VI, however an ASCII text editor will not be able to open it. There are examples which show how to create ASCII file, shipped with LabVIEW, if you require it. Do you still have a need for this?
Regards
SimonS