Matlab command to set PFI as Sampleclock on a USB DAQ?

1 visualización (últimos 30 días)
gujax
gujax el 7 de Feb. de 2023
Respondida: gujax el 28 de Feb. de 2023
Hi,
How do I declare PFI12 for example as sampleclockterminal when PFI0 is declared as sampleclock.source? What is the Matlab syntax for that?I know Labview or NiMax has that option.
Details:
I have a USB 6218 and USB 6366.
Trigger
I am externally triggering using PFI0 terminals in both i.e., signal from a function generator is input to PFI0 of 6218 and PFI0 of 6366
Output
I am deriving 4 analog outputs, two from each for every clock trigger pulse.
These are waveforms going from -10 to +10 V
Question:
However, I also want to output this clock only when DAQ starts its operations to activate another external instrument i.e., it should be a triggered output. Unfortunately, I am not sure how to do that?
Adding triggered digital output port0/line2 does not work because on these devices clocked digital output isn't possible. addoutput(daqObj_1,'Dev2','ao0','Voltage'); %y-direction mirror control addoutput(daqObj_1,'Dev2','ao1','Voltage'); %x-direction mirror control
addoutput(daqObj_1,'Dev2','Port1/Line0','Digital'); %cannot do this for clocked operations
addoutput(daqObj_2,'Dev1','ao0','Voltage'); %y-direction mirror control addoutput(daqObj_2,'Dev1','ao1','Voltage'); %x-direction mirror control
clk1 = addclock(daqObj_1,"ScanClock","External","Dev1/PFI0");
clk2 = addclock(daqObj_2,"ScanClock","External","Dev2/PFI1");
%This statement also does not work clk3 = addclock(daqObj_2,"ScanClock","Dev2/PFI12","External");
Is there a way that I can send the PFI0 input to PFIx output where x is any of amongst 2 to 15?
I tried outputting the PFI10 to 'external' but got an error saying only one clock is allowed. Or is there any other way besides using a third DAQ? Thanks
  1 comentario
gujax
gujax el 28 de Feb. de 2023
I found a solution:
The trick was to use a triggered counter output on both DAQ's.
The counter's duty factor can be independently set irrespective of the input trigger rate which is really good.

Iniciar sesión para comentar.

Respuesta aceptada

gujax
gujax el 28 de Feb. de 2023
use a triggered counter output on both DAQ's.

Más respuestas (0)

Categorías

Más información sobre Simultaneous and Synchronized Operations en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by