Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

generate analog voltage square stimulus and acquire the voltage-response stimulus

Hello everyone,

 

I am trying to build a program to record whole cell patch clamp experiments. What I need is to generate a set of square stimuli (mV) and then register the answer coming from an external amplifyer (mV again), in order to analyze it.

I also would like to change the stimulus parameters (width, height, etc.) without having to restart the VI.

 

I'm Working with Labview 2009, and I have a NI PCI-6221 Mseries connected to a BNC-2090A connector block.

 

I've tried to do it using the daqmx vis, but I couldn't get what I want. I've already looked at the examples like multifunction sync AI AO VI... I'm especially wondering how to record just the response stimulus and not all the rest of data I don't care.

 

I'm just looking for suggestion on how to do it, not a complete solution 😉 I hope someone has some ideas to share!

 

bests!

 

 

 

0 Kudos
Message 1 of 12
(4,760 Views)

Hi Prevat,

 

i have a little example in the attach. I synchronized a finite AI/AO task by sharing the same sample clock source (from the AO task). You can adapt your settings for the analog output (for example duty cycle) and start the vi again (event-driven). If you measure finit you only measure the response stimulus.

 

Hope this will help!

 

Cheggers

 

 

Sascha
0 Kudos
Message 2 of 12
(4,738 Views)

Hi Cheggers,

 

thank you very much for your answer, this has really helped!

 

 

 

0 Kudos
Message 3 of 12
(4,716 Views)

Dear cheggers,

 

I have a question again... It's the whole day that I try to get this program work. The example you gave me is actually very good, but since I need high acquisition rates (~150kHz) I tried to modify your example in order to being able to have AO and AI working with different clocks.

 

More precisely, since I just need to generate 1 pulse at a time (1- 2 ms width)  I store the pulse as an array of say 100 point. Then I need that the analog input records the data during the same amount of time of the pulse duration and I always need that these two things are synchronized.

 

I'm not sure on how I should use the trigger vi and the sample clock source, and I couldn't get the program run properly... any suggestion?

 

Thank you in advance!

 

attached the vi part, maybe someone can find major mistakes....

 

Bests,

 

Prevat

 

0 Kudos
Message 4 of 12
(4,708 Views)

Hi Prevat,

 

i adapted my example a little bit. Now you have a sample clock for AI and AO.

 

Hope this helps.

 

Cheggers

Sascha
0 Kudos
Message 5 of 12
(4,655 Views)

Hi Cheggers,

 

thank you for the help! I really appreciated this.

Meanwhile I think I've reached a solution to the solution of my problem, it is pretty much like yours.

 

I've attached a shrinked version of my vi, maybe it will be useful fore someone else...

Can you take a fast look at it? Just to know if you see something badly programmed.. and maybe you have some porecious advice..

 

Thank you again,

 

Regards,

Prevat

0 Kudos
Message 6 of 12
(4,638 Views)

I've forgot to attach the vi, sorry...

 

0 Kudos
Message 7 of 12
(4,636 Views)

Hi Prevat,

 

nice to hear that you found a solution. There are a few points in your VI which can be improved. I think the most important point is the architecture. If you choose an architecture like a producer/consumer (Event) (the template can be found under File>New...). Such a standard architecture/pattern is readable and scaleable, two very important attributes of a good application. In addition with this architecture you can reduce or even completely avoid your local variables (race condition, does not follow the data flow ..)

 

If you are interessted in designing a good application architecture you can find many informations online. (http://zone.ni.com/devzone/cda/tut/p/id/5237). There are also NI courses like LabVIEW Core 3 which shows the different architectures and the software engineering.

 

Good luck with your application!

 

Cheggers

Sascha
0 Kudos
Message 8 of 12
(4,633 Views)

Cheggers, thank you very much for your help!

I'm going to change the architecture as you suggested: A producer loop for the handling of the events and other slave loops for data acquisition, let's see what comes out 🙂

 

thank you again,

 

Regards,

Prevat

0 Kudos
Message 9 of 12
(4,627 Views)

dear cheggers, sorry if I bother you again...

I just have a short question, not so inherent with the topic sorry... I have a Ni PCI-6221 M Series, and I am trying the whole day to acquire from multiple channels but at different clocks, and I want to start the acquisitions independently...

 

Is this possible?

 

thank you in advance,

 

Prevat

0 Kudos
Message 10 of 12
(4,611 Views)