MATLAB: How to use a single General Standards PCI-ADADIO card with an external trigger in Burst Scan mode with xPC Target 3.2 (R2007a)

Simulink Real-Time

I want to use the PCI-ADADIO card from General Standards with xPC Target 3.2 (R2007a). I understand that this card is supported and that there are blocks for use with this card in the xPC Target library.
However, I wish to use the "Burst Scan Mode" of this card, which allows to convert and read out a single analog value controlled by an external trigger input. Is it possible to have a single card with an external trigger signal to use this mode? How would I have to configure my blocks for this to work?

Best Answer

This is possible, but it will take some effort to do it with xPC Target 3.2 (R2007a). The ADADIO doesn't give an interrupt for a programmable number of samples, but only for half a hardware FIFO full of samples. For this reason, it is never allowed this board to be used in frame mode. Frame mode would give you a buffer completion interrupt. Here it sounds like your frame size would be 1 sample.
If you simply don't use the ADSTART block, then an external pulse can be used to start an acquisition. Unfortunately, it really isn't that simple since you would then wait at the ADREAD block until the external pulse came in. If the model execution and external pulse timing aren't exactly synchronized, you might get an execution overload when the ADREAD finally returns.
So, how do you synchronize model execution with an external pulse? The easiest way is to use the parallel port interrupt. You feed your pulse to both the ACK pin on the parallel port and to the external clock or trigger input on the ADADIO board. You will need to pay attention to which clock edge causes each action. A rising edge on the parallel port causes an interrupt, but it is not clear which edge starts the ADADIO. You should check the manual for that information.
You could also improve this with external logic to delay the parallel port interrupt until your burst time after the trigger pulse, but that is up to you.
The ADREAD block only knows how to read 1 sample from each channel it is configured with so that is your maximum burst size. If you want a frame of data from each channel, you would have to modify the block. However, there are currently no plans to do that for this board.