03-11-2021 06:07 AM
Hi
I want to use a APFI (Analog Programmable Function Interface) channel as a analog trigger and I want the trigger output to be connected to a counter. I am using a PXIe-6363 multifunction DAQ. The X Series User Manual describes how this can be done from a hardware perspective.
I have managed to put together a VI that configures the APFI and the counter as intended. I can see that the "Count" is incrementing according to the waveform that I am applying at the physical APFI input. For future reference I want to mention that the key to make this work is using the terminal "AnalogComparisonEvent" which is described here terminals.
My question
Is it really necessary to "create channel" before being able to configure the APFI trigger?
Elaboration
As depicted in the block diagram, it seems that I need to create a AI task to able to configure the APFI trigger. As I see it, there is absolutely no reason to involve the AI channels (in this case ai0) in the APFI configuration from a hardware perspective.
Any good suggestion on how to simplify and/or get rid of the create AI channel is much appreciated.
Best regards
Jesper
03-12-2021 05:24 AM
I'm open to being corrected by someone who knows for sure, but I'm pretty confident that you need an active AI task to be able to use an analog signal to trigger a counter task as you showed. The "AnalogComparisonEvent" is needed to provide a digital triggering signal to the internal counter pins, but such events are only generated while a corresponding AI task is configured for analog triggering and is actively in its run state.
What I could find in the manual was in the section on Counter Triggering which states that the configured trigger signal gets routed to an internal counter pin. That tells me it must be a digital signal, not analog, confirming why you can't *directly* configure a counter task to use an analog signal on APFI0 as a trigger. It was to be indirect, by way of a task that configures and activates the analog comparisons, i.e., an AI task.
-Kevin P
03-12-2021 09:19 AM
Hi Kevin
Thank you very much for your answer.
I believe that the input to the "Analog trigger circuitry" is either an (unscaled) analog APFI input or a ordinary (possible scaled) analog input.
Whatever the source, the circuitry compares the analog input to a programmable trigger DAC (the threshold) and generates a digital output - namely the "AnalogComparisonEvent" signal. This digital signal then act as input to the counter logic, which provenly works fine.
Given that I am correct in my understanding of the hardware, I still do not understand why it should be necessary to create an AI task.
Best regards
Jesper
03-12-2021 09:35 AM
I understand what you mean, but it's not so much that the board *couldn't* have been designed to accomodate analog triggering of a counter task. Just that (to the best of my knowledge) it *wasn't*. I have no insight at all about why.
-Kevin P
03-15-2021 02:29 AM
Hi Kevin
Again, thanks for helping. I think that we are on the same page, but in the hope for somebody to chip-in and prove that it can be done without an AI task, I allowed my self to reiterate below.
Possible reasons why an AI task is needed to be able to configure analog triggering on APFI channel.
Best regards
Jesper