From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate pulses in NI-ELVIS II to be used as an external clock

I am using the NI ELVIS II counter for edge counting and to set the clock for Sample clock function I have to use an external clock but I am not sure how to do it. I suggest I have to use Counter Output/ Pulse generation to generate a pulse with a desire frequency and output it on pin PFI12 or PFI13 or even Freq-Out pin and then use this pulse as the external sample clock.

I can do pulse counting withough using a sample clock function but I would like to sample as high as possible to have more points and less oscillation. Would you please help me with this vi. I have attached the vi to this post.

0 Kudos
Message 1 of 2
(2,356 Views)

Hi tintin99,

 

I'd recommend checking out the NI Example Finder, found in <LabVIEW> » Help » Find Examples... 

Then navigate through Hardware Input and Output » DAQmx » Counter Measurements.

 

In particular, I'd suggest that you load up Count Digital Events.vi which shows how to implement simple Counter based Edge Counting measurements. These are useful for interacting with peripheral hardware such as Quadrature Encoders. With this VI running, you could also concurrently execute the Gen Dig Pulse.vi  found in the 'Generating Digital Pulses' section also within the Counter Measurements category. These are both good demonstrations on how to efficiently create Counter I/O DAQmx tasks within LabVIEW and will serve as a great foundation for your own code.

 

As a general overview, there are three main terminals you will need to be aware of when dealing with Counters:

 

Source - The counter input signal, effectively the signal we wish to count.

 

Gate - An input signal which determines whether we should continue counting, based on digital highs, lows, active edges and falling edges. These can all be preconfigured in software.

 

Out - The counter terminal output. This will be used in pulse generation.

 

As you want to perform two Counter based tasks, you will need to make use of two different onboard counters.  You can find out which pins can be used to access these different counter terminals by loading up the Measurement and Automation Explorer (MAX) and selecting your device under the Devices and Interfaces tree from the left hand pane. With the device selected, click on Device Pinouts, found on the toolbar. This tab could be hidden, so I suggest either maximising the MAX window or clicking on the double arrows on the right hand side of the toolbar to display any missing options.

 

Best of luck with your application. 

 

Kind Regards,


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 2
(2,344 Views)