Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

PCI 6221Square signal generator

Hi all,

I am trying to generate two independent square signal with the PCI 6221, following the code example in the SDK i got how to output one signal from "ctr0" to the output pinout by means of the next code:

DAQmxCreateTask("",&taskHandle);
DAQmxCreateCOPulseChanFreq(taskHandle,"Dev3/ctr0","",DAQmx_Val_Hz,DAQmx_Val_Low,0.0,Frequency,DutyCycle);  
DAQmxCfgImplicitTiming(taskHandle,DAQmx_Val_ContSamps,1000);
DAQmxStartTask(taskHandle);


My questions are:

 - How can i output the square wave from ctr0 or ctr1 to one specifical channel (not the default one)?
 - How can i output a second signal to another one?
 - How many clocks does the 6221 have?

PD: I am using the SCB-68.

Looking forward to hearing from you.

Thanks in advance

Mensaje editado por jrojfer

0 Kudos
Message 1 of 7
(3,908 Views)

Hi,

From the NIDAQmx C reference help:

The following table lists the output terminals for counter output. You can use a different PFI line for any of the output terminals.

Ctr0 Ctr1
PFI 12 PFI 13

So from that you can select any of the PFI lines....the default ones of course are Ctr0 output and Ctr1 output...

Teorically the counter clocks you talk about you can use the 20 Mhz and the 100 Khz reference clocks for generating your output signal... so precission should be enough...

 

Let me take a look for something more about using two counters with labwindows/cvi...

 

 

Regards,

Jaime Cabrera

NI Applications Engineering Spain
0 Kudos
Message 2 of 7
(3,889 Views)
 Hola Jaime,

Thanks for your reply, but what i need is the function to output one signal onto a specifical channel, and i also need to output one signal onto different channels, I mean something to get "I want to output this signal onto this channel, this one and this one".




0 Kudos
Message 3 of 7
(3,885 Views)
Too late to edit the previous one...

So if I use DAQmxCreateCOPulseChanFreq, how can i export this signal that comes from ctr0 and goes out through PFI6 (default) to, for example, dev0/port1/lines0-7. So in the 8 lines the same signal...

Thanks beforehand
0 Kudos
Message 4 of 7
(3,874 Views)

Hi,

 

1. You can see which routes you can do under Measurement & Automation Explorer (MAX). Go to devices & Interfaces and selecte your board. Then go to the Device Routes Tab. Over there you can see which terminals u can interconnect.

2. Use the Select_Signal function to route those signals.

 

Anyway, I don't understand why do u need that... u can output 8 wires from the counter output and everything is resolved....

 

Regards,

Jaime Cabrera

NI Applications Engineering Spain
0 Kudos
Message 5 of 7
(3,871 Views)
Dear Jaime,

first of all thanks for all your replies you are giving to me, about this:

Anyway, I don't understand why do u need that... u can output 8 wires from the counter output and everything is resolved....


is just because i was thinking about a problem of "fan out", i have to feed 4 devices so i was thinking of using one output channel for each device, but you are right, maybe i can feed all of them with the same, I couldn't check it for the moment, so i think there is no problem! Thank U anyway!!!!!

JRF
0 Kudos
Message 6 of 7
(3,858 Views)

mmm

Well... you can always insert a drive or an optocoupler for every channel u wanna take out...

 

I think is better just to spend a bit (time and money) making that than using extra resources of your board that u can use for another things 😉

 

 

Regards,

Jaime Cabrera

NI Applications Engineering Spain
0 Kudos
Message 7 of 7
(3,848 Views)