07-11-2010 06:30 PM
Hi Everyone,
I am a newbie to LV. I have been just using it for the last 3 weeks for my summer research project in which I am working with a professor on artificial neural networks. For the past week, I have been asigned to code a program in LV that will act as an interface between the user and the MEA via a STIMULATOR BOARD. I have successfully done the binary addressing part of the deal, but am stuck where I have to have a user-interface that will allow a user to generate an analog (AO) output of a single biphasic pulse to stimulate the neural network.
The user has to have a choice of the pulse width (aka the duration), and the volt (aka height) of the pulse. Also he/she should be able to produce either a mono or biphasic simple SINGLE pulse (not a continuous pulse). I have been digging in examples but my efforts have not gotten me anywhere useful.
Therefore, to all the LV experts...can anyone help me out with a VI that produces a SINGLE BIPHASIC PULSE for a finite time?
Any pertinent help will be appreciated.
Thanks,
UE
07-12-2010 05:07 AM
Go to Waveform-> Analog Waveform->Waveform Generatoin pallete & read the help on it.
It will solve all ur queries.
07-12-2010 09:02 AM
Thanks for the reply, but if you can be a little for specific, I will be grateful. I am pretty new to LV and I have read the examples. However, I was unable to find the one pertinent to my problem.
07-12-2010 10:38 PM
I can surely help you if you can please post the image of waveform that u want to generate. Let it be any pulse width & amplitude.
07-13-2010 08:00 AM
I wish I could generate a picture, but if a description helps:
Imagine a single square pulse--A single one with both +ve and -ve amplitude starting at 0V. The user can define the duration it stays +ve and the duration it stays -ve. Also he/she can flip the signle, ie, decide whether th -ve side should be genrated first and then the +ve side.
Hope this helps.
07-13-2010 11:17 PM - edited 07-13-2010 11:23 PM
Ok.Here is the solution to ur problem.
What u should use is the SQUARE WAVEFORM.VI, where user can specify the peak to peak value,offset & phase as well.
Now inorder to generate the single square wave,its very simple.Under sampling inforamtion specify the Fs as 100 times the required frequenct Fout & no. of samples #s as 100(i.e.Fs/Fout). This will result in only one square wave.
Then while writing on to your DAQ card select mode as "FINITE SAMPLE" mode.ith no of sample may be1.
Let me give u a simple example. Suppose u want to generate the one square wave of 10Hz with +ve magnitude 5V& -ve to be 3V.
The
1.Peak to peak is (5+3) = 8.
2. Offset is (5-3)=2.
3.Phase is 0 or 180 depending on +ve or -ve pulse o/p first respectively.
4.Frequency is 10.
5.Fs is 1000 & #s is 100.
6.Select the sample mode in "DAQMX timing.vi" as finite mode & no. sample per channel as 1.
Also disable the REGENERATION PROPERTY od DAQ & try. It should help.
07-16-2010 08:44 AM
THanks a lot! After following your example and few minor tweakings of my own, I have finally done it! YAY!!
But now I face another issue, my professor wants me to put in an option whereby the user can generate a paired pulse and the inter-pulse-interval has be user defined.
In short, now I have to come up with a VI that generates a paired pulse (aka two pulses) of the same width, amplitude and everything but the interval between them (in ms) has to be defined by the user. I di a lot of research of retriggerable waveforms but they have not proven to be so much useful. The whole concept is simple, but is hard to generate in labview.
Can you help me out with this one?
Thanks,
Upol
07-16-2010 09:30 AM
Upol,
Generate one copy of the pulse (which you now know how to do). Create a waveform with an amplitude of zero and duration equal to the inter-pulse interval. Append the zero waveform to the pulse waveform. Then append another copy of the pulse waveform.
Lynn
07-16-2010 12:34 PM
Thanks a lot for the prompt answer.
Okay, I tried to do that. I problem that I can foresee is the following:
the inter-pulse-interval (referred to as IPI from hereon) should be very accurate and in the order of 5-20ms. Therefore, my advisor wanted it to be hardware timed. I have no clue what he was talking about and he was also talking about using counters on the NI boards.
I tried appending two waveforms like you said, but the dt of the second waveform (the one with the zero amplitude) is different to that of the dt of the first single pulse. What I could not do is append two waveforms with different dts. that is, it was not possible to output a single pulse with a 200us pulse width followed by a zero amplitude waveform with a 10ms pulse width.
Labview takes on the lower dt value and outputs the final waveform. Hope you can help me out here.
07-16-2010 01:23 PM
You have not specified what kind of hardware you are using, so it makes it difficult to give applicable suggestions.
Let me try to make a little example with ASCII graphics.
One pulse: 0000--++0000
Two pulses: 0000--++00000000--++0000
Two pulses with long IPI: 0000--++0000000000000000000000000000000000000000000000000000000000000000000000000000000--++0000
If the --++ part is 200 us wide, then each character represents 50 us. So you would need 200 zeros between the pulses for a 10 ms IPI.
It is easy to make the dt of the waveforms all the same. Use the Build waveform primitive from the Waveform palette.
Here is a little VI I put together to show how it works. (LV2009)
Lynn