Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

6601 retriggerble finite pulse gen. with user function call

Hi..
I have PCI-6601 counter board.
My task is following (attached figure)
 
TTL level trigger input :  pulse width 3 micro sec,   freq: 1 ~ 10 Hz (not regular, it vary with time)
output : retriggerble finite pulse train ( max number : 20)
 
programming lang. : C#
DAQ driver : DAQmx 8.0
 
I want some userfunction call after  each finite pulse train is ended,
because after each finite pulse train is ended I want to read some other equipment by GPIB.
 
I download example of retriggerble finite pulse train and it works fine without userfunction call for every pulse train end.
I tried some event like task done, but it doesnt work. it fires for just one time.
 
what is a soluton of this task?
Every comment will be greately appreciated.

메시지가 01-22-2006 08:38 PM에 oldfark에 의해 편집되었음

메시지가 01-22-2006 08:39 PM에 oldfark에 의해 편집되었음

0 Kudos
Message 1 of 6
(4,673 Views)

Hi oldfark-

The behavior you're seeing with the DAQmx Is Task Done function is expected; it should only fire when the task is done, and that situation technically never occurs for a retriggerable finite pulse generation.  Your best bet would be to create a finite triggered pulse train (non-retriggerable) and monitor the DAQmx Is Task Done property.  When the finite task is complete, you would then simply reset the task in software by stopping and restarting the task.

Hopefully this helps-

Tom W
National Instruments
Message 2 of 6
(4,654 Views)
Actually, the property you should read for this is the "Pulse Done" property.  This is a channel property located in "Counter Output: General Properties: More: Pulse Done".  This should return true every time a set of finite pulses is completed.  Let me know if you have any problems using this property.
 
gus....
Message 3 of 6
(4,649 Views)
Hi All-
 
In case it's not obvious, Gus' solution will work considerably better.Smiley Very Happy
 
I have attached a modified C# shipping example that shows how to set up monitoring for this event.  Hopefully this helps-

Message Edited by Tom W [DE] on 01-23-2006 06:32 PM

Tom W
National Instruments
0 Kudos
Message 4 of 6
(4,641 Views)
Thanks for your really good suggestions.
Because of my short business trip, my response is delayed ^^;
 
I success to solve my problem from Tom's solution.
 
I changed your attaced file like as following.
It works fine.
I do not consider pulse done property,
because It is not event and I don't want to use .Net timer ( its accuracy is really not good)
 
-----------Changed code--------------------------------------------
private void startButton_Click(object sender, System.EventArgs e)
{
   ........
    myTask.Triggers.StartTrigger.Retriggerable = false;    // change to not retirggerable
  .........
    myTask.Done += new TaskDoneEventHandler(myTask_Done);   //add event handler function.
    myTask.Start();
}
 
void myTask_Done(object sender, TaskDoneEventArgs e)
{
            myTask.Stop();
            i = i + 1;
            this.textBox1.Text = i.ToString();
            myTask.Start();
}
0 Kudos
Message 5 of 6
(4,625 Views)

Hi oldfark-

Glad to hear you're up and running- let us know if you run into any other problems.

Thanks-

Tom W
National Instruments
0 Kudos
Message 6 of 6
(4,613 Views)