LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

200077 error lab view electrical stimulation

Can you show a screenshot of the latest code?

 

Then I can try to reproduce it at my side.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 11 of 19
(1,571 Views)

Hello,

 

You can find my printscreen in the attachement.

Hopefully you can find the problem. Thank for looking.

 

Sincerly,

 

0 Kudos
Message 12 of 19
(1,567 Views)

Hello viki,

 

While stepping back and looking at your code I saw something unusual.

Can you tell me what the actual goal of your code is?

 

It seems like you just want to generate a pulse train.

Right now ir seems like you're trying to do this in a partially software timed and a partially hardware-timed way.


Am i seeing this correctly?

If yes, then should the output voltage be TTL-compatible?

If again yes, then there exist easier methods. (especially with a USB-6251) 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 13 of 19
(1,550 Views)

Hello Thierry,

 

To answer your question:

We are trying to stimulate a certain target area in the brain of a rat using an implanted electrode (deep brain stimulation).

This electrode is connected to a Stimulus Isolator, which is hooked up to the National Instruments card, connected to the computer.

 

We want to stimulate for 60min with a biphasic block stimulus at a high pulse frequency (60Hz) and a low frequency (130Hz) to evaluate the difference in effects. But the stimulus is calculated in such a way that their is a waiting period (interpuls interval) in between each pulse.

In the frontpanel we want to define how long the stimulation has to last (total time 60min), at what frequency we want to stimulate (pulse frequency 60 or 130Hz) and how long the biphasic block lasts (pulsewidth, 200microsec). The other data is calculated in our programme.

example.JPG

I'm not entirely sure wether the signal is TTL compatible as I'm not familiar with the term. However what is important is that their is no raisetime or fall time. The signal has to be given immediately and when the total time has passed the current has to be zero. No direct current can be given during or after the stimulation. Otherwise our data is comprimised.

 

I hope this has answered your question, if not let me know.

Many thanks for keeping an interest in our problem. We hope you can find a solution.

 

Kind regards,

 

Viki


 

 

0 Kudos
Message 14 of 19
(1,546 Views)

Viki,

 

How is 60 Hz a higher frequency than 130 Hz?  Are those the only pulse repetition frequencies you will use?

 

What resolution do you need on the pulse width?  Is 200 us the minimum pulse width you will ever use? What is the maximum pulse width?

 

It appears from your print screen image that you are leaving the amplitude always set at the default 10 V. Is that correct?

 

It is physically impossible to generate a signal with zero rise time.  The 6251 has a slew rate of 20 V/us so the central transition from +10 V to -10 V in your pulse will take about 1 us.  For brain stimulation this is a negligible rise time but you should be careful in your use of terminology.  When you try to publish your results, the reviewers may not be happy with claims of zero rise time and such language may raise doubts about your kowledge and understanding of the measurement instrumentation and process.

 

The AO buffer on the 6251 holds a maximum of 8191 samples. At the 50 kHz sampling rate of the square wave generator that covers <164 ms.  The 1000 samples you generate occupy 20 ms.  This will not give you the pulses you want.  I canot save back to 7.0 but the screen shot below will give you some idea of how you can look at what is going on. Autoscaling (X) is turned off on both graphs. One shows the first 500 us and the other shows 20 ms of the signal you are generating.

 

Lynn

 

Pulse gen.png

0 Kudos
Message 15 of 19
(1,536 Views)

Hello,

 

I'm very sorry for the mistakes I made in my previous reply. Indeed the high frequency is 130Hz and the low 60Hz. Also the rise/fall time is negligble in our case. I had misinterpreted the explantion of the TTL. 

 

Many thanks for your proposal. We tried it out and got the same results as you did, which is a good sign. However we also want to determine the frequency at which the biphasic 200microsec pulses (oscillation frequency 5000Hz) are given, namely at 60Hz or 130Hz (pulse frequency). We are not going to stimulate at another pulse frequency than these two. We are not keeping the amplitude at default 10V, but are going to stimulate at 3V.  

 

Do you know how to apply this pulse frequency with the function generator?

 

Kind Regards,

 

 

 

 

 

0 Kudos
Message 16 of 19
(1,530 Views)

Viki,

 

I suggest generating just one pulse of the desired width using the Pulse Pattern.vi twice.  Then create an array of zeros with the appropriate length to match the interpulse interval. Append the array of zeros to the array for one biphasic pulse. Write this to the AO buffer. Use the regeneration mode to repeat the cycle until the specified stop time occurs.  The image below shows how to generate a 200 us biphasic pulse.  Note that it gets the sampling frequency from the same cluster you used for the square wave. You could provide the frequency by other means.

 

Lynn

 

Biphasic pulse.png

0 Kudos
Message 17 of 19
(1,519 Views)

Hello Lynn,

 

I replicated your design succesfully, which is a great sign. I'm very greatful for the suggestion. 

However, is it possible that I still need to connect the DAQmx write et cetera and the loops to this design in order to get a signal?

If so, at which point do I connect the DAQmx'? And the loops? 

 

Thanks a lot,

 

Kind Regards,

 

Viki

 

 

0 Kudos
Message 18 of 19
(1,505 Views)

Viki,

 

The simplistic answer is to connect the DAQmx Write wherever you want to send the calculated values to the hardware and put a loop around the parts of your code you wish to repeat.

 

Because LV is a dataflow language, that is also the foundation for the complete answer.  I cannot give you a comprehensive solution to your problem without knowing all the specifications, and then you would have to pay me.

 

From what you have described I would recommend a combination of a Producer/Consumer architecture with state machines in some of the loops.  Depending on the details you might have more than two parallel loops.

 

Lynn

0 Kudos
Message 19 of 19
(1,502 Views)