06-03-2010 04:49 AM
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!
06-04-2010 09:57 AM
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
06-07-2010 04:17 AM
Hi Cheggers,
thank you very much for your answer, this has really helped!
06-07-2010 11:28 AM
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
06-14-2010 08:37 AM
Hi Prevat,
i adapted my example a little bit. Now you have a sample clock for AI and AO.
Hope this helps.
Cheggers
06-15-2010 03:49 AM
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
06-15-2010 03:50 AM
I've forgot to attach the vi, sorry...
06-15-2010 04:34 AM
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
06-15-2010 06:16 AM
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
06-15-2010 09:06 AM
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