Driver Development Kit (DDK)

cancel
Showing results for 
Search instead for 
Did you mean: 

PCIE-6259: register level information on configuring a hardware trigger for AO

Hi,

We have successfully used an NI-PCIE-6259 board with the Comedi driver
collection for Linux. Now we tested external triggering for the first
time. Although we successully used an external trigger at a
PFI-channel for analog input, setting an external trigger at the same
channel for analog output did not work, i.e. AO did not start at the
trigger (the procedure to configure the triggering PFI channel for
input was verified successful by that channels ability to trigger AI).

Studying Comedis driver code for configuring an external AO trigger,
we see that it adheres to NIs DAQ-STC Technical Reference Manual (Jan
1999) and to NIs example code for m-series boards (Oct 2006 ---
although these examples only set a software trigger). So we think that
probably these documents miss some information necessary for
configuring an external trigger for AO in the PCIE-6259 board.

We have listed below the drivers sequence of actions for configuring
an external trigger for AO (the actions for configuring a software
trigger are also listed). Could you tell us what is wrong or missing?
Or in another way provide us with the necessary information
(e.g. register-level example code setting an AO hardware trigger,
working with PCIE-6259)? Or might it be even possible that the board
does not work correctly in this respect (we have no other board of
this type to compare)?

We are aware of the problem inherent to such user-reports that
something overlooked might have gone wrong. But we made some effort to
rule that out. The clear structure of the Comedi driver lets us be
reasonably sure that the below description of its actions is valid and
nothing has been overlooked.

Kind regards,

Olaf Till



####################################################################



With our application, the driver code is caused to perform actions on
the boards registers for configuring an external AO trigger
equivalently to the following sequence:





buffer_ao_mode_1: 2 bytes

buffer_ao_mode_3: 2 bytes

buffer_ao_trigger_select: 2 bytes


both for internal (software) and external trigger:

- unset all bits in buffer_ao_mode_1

- unset all bits in buffer_ao_mode_3

- unset all bits in buffer_ao_trigger_select


- set bit 0 in buffer_ao_mode_1 (AO_Trigger_Once)

- write buffer_ao_mode_1 to register at address hex 14C
  (AO_Mode_1_Register)


only for an external trigger:

- set bits 0..4 in buffer_ao_trigger_select as a 5-bit unsigned
  integer according to trigger input channel:

-- PFI channels 0..9 are mapped to values 1 to 10

-- PFI channels 10..15 are mapped to values 21 to 26

- set bit 5 of buffer_ao_trigger_select (AO_START1_Edge)

(- same result if bit 6 (AO_START1_Sync) is also set)

end <only for an external trigger>


  (instead, this would be done for an internal (software) trigger:

  - set bit 5 of buffer_ao_trigger_select (AO_START1_Edge)

  - set bit 6 of buffer_ao_trigger_select (AO_START1_Sync)

  end <for an internal trigger>)


both for internal (software) and external trigger:

- write buffer_ao_trigger_select to register at address hex 186
  (AO_Trigger_Select_Register)


- write buffer_ao_mode_3 (all bits unset) to register at address hex
  18C (AO_Mode_3_Register)




All (potential) other actions of the driver on the board before and
after the actual occurance of the trigger are identical between an
external and an internal (software) trigger, and the internal trigger
works (streaming output, multiple channels).

Also, setting an external trigger for analog _input_ was successful
(with the same PFI channel), so there was no mistake in configuring
the respective PFI channel for input.

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

Hello Olaf,

 

Thanks for contacting us about this issue.  From your description of the Comedi code, I agree that it follows the DAQ-STC manual closely.  However there could be a mismatch of what is being written to the AO_Trigger_Select_Register and the PFI line that is used.

 

1.  Which line are you using for your hardware trigger?

2.  What is the exact value being written to the AO_Trigger_Select_Register? 

3.  What other registers and values are used when configuring the AO channels?

 

I know that (3) may not be necessary since your analog output task works correctly for software triggered AO, but I want to be sure there is nothing overwritting or negating the AO_Trigger_Select_Register settings.

 

Steven T.

Message 2 of 4
(6,912 Views)

Thanks for looking into that.

 

To your questions:

 

1. I have used line PFI3 (zero based numbering, of corse) for hardware triggering.

2. According to the attached kernel log, the exact value written to AO_Trigger_Select_Register is hex 24 (dual: 100100).

3. A logfile of the driver is attached with all register writes during AO configuration (all values and addresses hexadecimal). If possible, I have logged comments before the register writes saying what was intended; the comments are sequentially numbered, numbers 3) and 4) are not in the sequence because this code was not executed for this type of board. I have also logged comments like --- this one ---, marking some sections. E.g., the configuration of the external trigger is in the section marked --- start configuring signal for starting AO --- and --- end configuring signal for starting AO ---.

 

Olaf

 

0 Kudos
Message 3 of 4
(6,898 Views)

Hello Olaf,

 

Sorry for the delay.  I've checked our Measurements DDK Analog Output section and I noticed that example 3 is very similar to what you would like to do.  In this example (aoex3.cpp), you can replace the aiTrigger function to use kAO_START1_SelectPFI3 instead of kAO_START1_SelectPulse.

 

The register access list of that example when run with PFI3 as the start trigger is attached to this post.

 

Steven T.

0 Kudos
Message 4 of 4
(6,808 Views)