NI 6034E, EXT_TRIG

Hello Frank, comedilist users,

thanks for the fast answer, but now, i have a long mail ;-)

I compiled the code from cvs und this time it seems more friendly. The 
EXT_TRIG works for all three *_src.

For the test a modified cmd.c.
First i want to describe the requirerment, then i answer your question.
I get an Startsignal from a mesurerment system and a clock (trigger) signal. 
For each clock signal i have to read 2 analog channels (only once) and all 8 
digtital inputs. For this i set "cmd->flags |= TRIG_WAKE_EOS", so after each 
scan (not convert ?!) the read() function comes back and i can read the 
DIO's.
When i set TRIG_WAKE_EOS the read() - Function comes always back with "read: 
broken pipe". So i compiled the driver with  "#undef PCIDMA" (in 
ni_pcimio.c), i read this in the Mailinglist. This time it seems better.
For the first step (without the startsignal and the clock) i use this 
configuration:

	cmd->start_src = TRIG_NOW;
	cmd->start_arg = 0 ;
	cmd->scan_begin_src =   TRIG_TIMER;
	cmd->scan_begin_arg =   1e9/freq;
	cmd->convert_src =  TRIG_TIMER;
	cmd->convert_arg =  5000;      /* in ns */
	cmd->chanlist_len is always cmd->scan_end_arg ;

and now your question ...

> How many scans do you get back? scan_begin_src = TRIG_EXT may work if you
> set the CR_EDGE bit in the scan_begin_arg.  I put some fixes in cvs for
> the convert_src = TRIG_EXT case which might help there.
How many scans .... good question. When i set this (Example 1):
	cmd->scan_end_src =	TRIG_COUNT;
	cmd->scan_end_arg =	2;
	cmd->stop_src =		TRIG_COUNT;
	cmd->stop_arg =		1;
i got more than one scans or converts !? ... it's endles. After each convert 
the read comes back. I thought after each scan the read() comes with the 
analog values and after that with an ret Value 0 !?

In this case (Example 2):
	cmd->scan_end_src =	TRIG_COUNT;
	cmd->scan_end_arg =	2;
	cmd->stop_src =		TRIG_COUNT;
	cmd->stop_arg =		2;
the read() - Funktion returns two analog values from each channel. After this 
the Returnvalue from read() is 0.

When i use this:
	cmd->scan_begin_src =	TRIG_EXT;
	cmd->scan_begin_arg =	PFI0|CR_EDGE;
it aborts sometimes with "read: broken pipe" .... in both example ... depends 
this on the input signal, at the moment its only an push-button and is not 
very good.

My questions:
1. Is this the right way to read from the analog channels and the dio's ?
2. Why is it endless with cmd->stop_arg = 1 
3. Can i set the Number of converts to 1 .... how many converts did i get with 
each scan, i don't understand this.

I hope you can help ... thanks
Martin

Received on 2003-05-29Z18:15:55