04-24-2011 05:52 PM
I'm working on optogenetic stimulation and silencing of dopaminergic pathways in rat brains. Currently I have a labview program that once triggered, sends a pulse train that controls a laser. However, instead of the user triggering the pulse train, we are now letting the rats press a level to trigger it. The problem arises in that I need to the program to now trigger only after X pulses instead of on every pulse. To make matters more complicated, X is a function not just a variable:
X=5*e^((LaserCount+1)*.2)-5
where LaserCount is the amount of times the program has been triggered and sent the pulse train. I been unable to find away to even set it to trigger after a constant number of pulses. Any help in this matter is appreciated.
- Adonis
04-25-2011 04:27 PM
Hi Adonis,
I came across a Dev Zone article that contains an example VI to do something similar to what you're trying to do. In this VI, a counter is used to generate a start trigger after a number of pulses have been detected. It also contains a stop trigger set up the same way.
Using the DAQmx Export Signal Property node with CtrOutEvent.Output Behavior property, you can select "toggle" to change output states (in the example, they are using a pulse) once a certain number of pulses has been detected on the input counter channel.
You could use some of the math/ numeric functions to set up your equation and use the output of that to set your 'number of ticks before' control as seen in the example.
Hope this helps get you going in the right direction.
DevZone Example:
http://decibel.ni.com/content/docs/DOC-7372