Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a ramp for a stepper on PCI-6221

Hello, I am the follow-up of Oliver and have to implement/use the code in LabView.

@ John P:

Many thanks for the link, I think it will be helpful for me (hopefully)

 

I am still using PCI-6221 card (16 bit, 250 kS/s, 16 AI, 2AO, 10 DI/O, 2 Counters,  37pins)

It should be somehow possible to make a ramp:

startpoint: 1kHz

endpoint: 15kHz

time for Ramp: 1s

 

I think, the sample from https://forums.ni.com/t5/Example-Code/Reconfigurable-Finite-Counter-Output-Using-DAQmx-on-E-or-M/ta-...

is a good starting point, but how to implement it for the ramp?

 

Thank you.

-------------------------------------------------------------------
Eugen Wiebe
Bernstein AG
CLAD - Certified LabView Associate Developer
0 Kudos
Message 11 of 14
(1,130 Views)

Hi EWiebe,

 

That example is useful if you need a specific number of pulses.  If you need a specific amount of time, you might as well just use the continuous counter output and stop it in software (since any updates to frequency have to come from software anyway).  You'll have to define an array of frequencies that you want to be generated, then write them to the counter output task in a loop.  You can control the loop rate in software.  Of course, this would be non-deterministic, but you can get pretty close to what you need.

 

It's worth noting that X Series boards have a counter output buffer and deterministically output an array of pulses.

 

 

Best Regards,

John Passiak
0 Kudos
Message 12 of 14
(1,126 Views)

Hello,

now I am using X-Series PCIe-6323 board

 

how to make frequency output ramp there?

Thanks.

-------------------------------------------------------------------
Eugen Wiebe
Bernstein AG
CLAD - Certified LabView Associate Developer
0 Kudos
Message 13 of 14
(1,090 Views)

Hi EWiebe,

 

You could do something similar to this, where each period of the counter output is buffered ahead of time and implicitly clocked out.  This has the benefit of only requiring one counter but you have to make a much larger buffer.

 

Or, you could use a sample-clocked counter output task to write only one sample of each specific frequency you want generated, then use a clock to advance the generation to the next sample.  This method is a bit easier to define the buffer, but you need a clock source (probably use a 2nd counter).

 

 

Best Regards,

John Passiak
0 Kudos
Message 14 of 14
(1,088 Views)