Configuring and Reading Counters [U3/U6/UE9] | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Configuring and Reading Counters [U3/U6/UE9]

Counter features on UD devices can easily be configured and read without custom software by using our LJControlPanel and LJLogUD/LJStreamUD software on Windows.

Configuring Counters in LJControlPanel

  1. Open the device in LJControlPanel.

    Follow steps 1-6 in our U3/U6/UE9 Quickstart Tutorials.
  2. Click the "Config" button in the Timer/Counter section of the test panel.

    Once pressed a new window should appear with more timer and counter settings.

  3. Enable your counters.

    For this tutorial we will enable one counter on FIO4.

    Ensure "# Timers Enabled" is 0 and click the enable box for Counter 0.

  4. Set the "Pin Offset".

    set the "Pin Offset" box to 4 to put Counter 0 on FIO4. If any timers were enabled they would appear on the DIO before the counters. For example, if two timers are enabled with a pin offset of 4, the timers would appear on FIO4 and FIO5 and Counter 0 would appear on FIO6. Note that the minimum pin offset for the U3 is 4. See the timer/counter datasheet page of the U3 for more information.

  5. Click "OK".

    The smaller timer/counter window will close and you should now see your counter value incrementing if you have a good pulse input attached to the counter 0 DIO pin. If you are unsure if you have a good pulse input, a jumper wire clamped in a GND terminal should produce increments when you tap the other end of the wire to the inside-back of the timer/counter DIO pin terminal[1]. Clicking inside the Counter 0 reset box will reset the counter to back 0.

  6. [Optional] Save your timers and counters in your startup configuration.

    To save your timers and counters for startup you must set up the timers/counters in the "Config Defaults" tab of LJControlPanel rather than the test panel.

    First close the test panel and click "Config Defaults".

    Set up all of your timer/counter settings.

    Click "Write Values". A new window will pop up; Click "Yes" to save your configuration.

    Close LJCP and power cycle the device to apply your changes. Note that the test panel will not load your configurations, so we recommend you test the feature in LJLogUD.  You can also come back to the Config Defaults screen in LJCP to see if it shows the power up defaults you set.

[1] LabJack digital inputs have an internal 100k pull-up that weakly holds them high, so when you connect a GND wire to a digital input it will pull the line low and create a falling edge. When you pull out the wire you get a rising edge.  You are not likely to make a perfectly clean single contact, so a counter will typically increment many counts each time you tap the wire.  Also note that you should touch the ground wire to the inside-back of the counter terminal.

Next Step:

Once you are all set up with a counter, you can move on to Configuring a Timer or subsequently Logging Timers/Counters.