LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with VI modification - See attachment

Hello!
 
Could someone please help me? Basically, i need to record the velocity of nerve signals over 10 channels and then save the data to disk(ASCII). With regards to the parameters, i believe the basic aspects that would be important to record about the electroneurogram (ENG) would be: Sample range, Size, Frequency, Resolution, Amplitude, Duration... 
 
Relevant details - Using: LavView 7.1; DAQCard-6062E for PCMCIA; NI-DAQ Software; SHC68-68-EP Shielded Cable; CB-68LPR I/O connector block with right angled connector, Dell Inspiron Laptop with 60GB dedicated to saving acquired data.

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.

0 Kudos
Message 1 of 9
(3,843 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 9
(3,825 Views)
Hello Mike,
 
Thanks for the advice. I still don't really understand whether this code can record 10 channels at once because every time i have to run it, i have to choose 1 channel, e.g Dev1/ai0. So do i have to replicate the same layout 10 times on the same VI and specify different channels for each?... Dev1/ai0, Dev2/ai1, Dev3/ai2..., Dev10/ai9.
 
Also, i have removed the trigger and inserted 'write to file.VI'. Have i connected them properly?
 
As for familiarity with LabView, I have started weeks ago and reading through the manuals... but still not grasping it properly unfortunately.
 
Hope you can help me out sometimes soon...
 
Kindest Regards,
 
Vipin S.
0 Kudos
Message 3 of 9
(3,810 Views)
To read multiple channels do like the help file I quoted says. Wire to that input a list or range of channels that you want to read.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(3,807 Views)
Hello!
I have finally managed to acquire and display my 10 signals over the 10 channels. I now need some help on the connections of the "write waveforms to file.vi" - I understand where to connect the 'error in', 'error out', and 'waveform' ports but what about 'file path', 'new file path', and 'append to file'. Do i just leave them? This is what error i get:

---------------------------------------------------------------------------------------------------
Possible reason(s):

Attempted to read samples that are no longer available. The requested sample was
previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a
fixed number of samples to read instead of reading all available samples might
correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value: 0


Task Name: _unnamedTask<88A>
-----------------------------------------------------------------------------------------------------
 
Can someone please help???
 
Thanks,
 
Vipin S.

0 Kudos
Message 5 of 9
(3,789 Views)

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.

Message 6 of 9
(3,784 Views)
Dear Mcdan,
 
Thanks a lot for the help and guidance. I have added your components along with some modifications of my initial design, Please see attached. Everything works perfectly fine and the file is saved in a specified folde that i choose. However, once i finished doing the aquisitions, how do i make use of the data? How do i recall the recordings i mad to that file. i noticed that on the front panel, there is an option to open, create, open/create, create/replace. To save a session, i chose the 'create' option. I tried using the 'open' option to actually try open the save file but nothing happens. Is the file saved as ASCII? This is what my supervisor wanted it as. Could you please help???
0 Kudos
Message 7 of 9
(3,766 Views)
Could you please advise me if my attached vi is fine? Also, once i have saved the waveformas ASCII, how do i look at it again for analysis??
0 Kudos
Message 8 of 9
(3,755 Views)

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

 

 

 

Message 9 of 9
(3,729 Views)