Re: using an external trigger on NI PCI 6036E

Thanks Jon,

So I should use PFI1/TRIG2 as my trigger source?
So, in the command I should set "cmd.start_arg = 1", right?
If you can send me the modified driver that would be great.

Thanks again
Marc


Jon Erickson wrote:

>i have been using EXT_TRIG with NI6071E with comedilib 0.7.20 and comedi
>0.7.66.
>turns out that the ni_pcimio driver is configured to trigger only on
>rising edge.  i had to hack/modify the driver to get external triggering
>working properly, and can send it to you, if you like.
>also, be careful trying to use extrernal triggering on PFI0.  I
>configured the trigger signal to be on PFI1, becasue there was something
>funky about PFI0/TRIG1 pin being configured, by default, for something
>else other than triggering.
>
>cheers, jon
>On Fri, 2004-01-23 at 11:16, Tim Holt wrote:
>  
>
>>I've tried to do something similar with no luck on an NI PCI 6071E using 
>>latest CVS from a few weeks ago.
>>
>>Marc Rawji wrote:
>>
>>    
>>
>>>Hi,
>>>
>>>I am fairly new at data acquisition and Linux.
>>>I am using comedilib 0.7.20 and comedi 0.7.66.
>>>
>>>I am able to read and write to both analog and digital channels and I 
>>>can perform continuous acquisition using comedi_command.
>>>
>>>Ok, here is the question:
>>>
>>>I want to use an external trigger to start an acquisition. This is 
>>>what I have, and it doesn't work
>>>
>>>{
>>>   ...
>>>   // I set all the DIO channels (subdevices 2 and 7) as input.
>>>
>>>   // create the command structure
>>>   memset(&cmd, 0,sizeof(cmd));
>>>   cmd.subdev = 0;
>>>   cmd.flags = 0;
>>>   cmd.start_src = TRIG_EXT;
>>>   cmd.start_arg = 0;
>>>   cmd.scan_begin_src = TRIG_TIMER;
>>>   cmd.scan_begin_arg = 1e9*sampling_period;
>>>   cmd.convert_src = TRIG_TIMER;
>>>   cmd.convert_arg = 5000;
>>>   cmd.scan_end_src = TRIG_COUNT;
>>>   cmd.scan_end_arg = nchan;
>>>   cmd.stop_src = TRIG_COUNT;
>>>   cmd.stop_arg = totalsamples;
>>>     cmd.chanlist = chanlist;
>>>   cmd.chanlist_len = nchan;
>>>     // test the command
>>>   int ret = comedi_command_test(Dev, &cmd);
>>>   if (ret != 0)
>>>   {
>>>       printf("An error occured in the command\n");
>>>       exit(-1);
>>>   }
>>>     //make sure we are still using the same number of samples
>>>     totalsamples = cmd.stop_arg;
>>>   lsampl_t *data = new lsampl_t[totalsamples];
>>>   int samples_read = 0;
>>>   int buff_size = 32;
>>>   char *buff = new char[buff_size];
>>>     if (comedi_command(Dev, &cmd)<0)
>>>   {
>>>       comedi_perror("Comedi command not sent");
>>>       exit(-1);
>>>   }
>>>
>>>   ... read from /dev/comedi0 and do whatever...
>>>}
>>>
>>>as I understand it, as soon as there is a rising or falling edge to 
>>>PFI0, the board should start the acquisition.
>>>
>>>As of now, no errors are returned by any comedi functions, nor by the 
>>>read function. The read function just waits for data to become 
>>>available. Everything works if I set the trigger to TRIG_INT and send 
>>>a software trigger.
>>>
>>>Thanks,
>>>Marc
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>comedi mailing list
>>>comedi_at_comedi.org
>>>https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi
>>>      
>>>
>>
>>
>>_______________________________________________
>>comedi mailing list
>>comedi_at_comedi.org
>>https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi
>>
>>    
>>
>
>  
>

Received on 2004-01-23Z19:52:25