How to read a frequency (t7 pro python LJM library) | LabJack
 

How to read a frequency (t7 pro python LJM library)

4 posts / 0 new
Last post
gigabyte323
gigabyte323's picture
How to read a frequency (t7 pro python LJM library)

Hello,

 

I am trying to interface a sensor with my labjack t7 pro. The sensor outputs a frequency of 30-500 Hz. I imagine I should use a digitial "FIO" pin for DIO input. I can attenuate the freuqncy input as needed with a voltage divider as needed to provide the correct peak voltage for this input.  is there some sort of example code available for reading a frequency ?

Thanks

LabJack Support
labjack support's picture
A zip with our Python

A zip with our Python examples can be found on the following page. The examples are also available on GitHub:

https://labjack.com/support/software/examples/ljm/python

Unfortunately, we do not have any examples specifically for frequency measurement, but the following page demonstrates how to set up a PWM output and counter input, which uses many of the same configuration registers as our frequency input feature. I would recommend reviewing our frequency input feature documentation, then work off of the PWM/counter example:

https://labjack.com/support/datasheets/t-series/digital-io/extended-feat...

https://github.com/labjack/labjack-ljm-python/blob/master/Examples/More/...

Hardware wise, your signal must be dropped down to TTL logic levels.

gigabyte323
gigabyte323's picture
I managed to read frequency

I managed to read frequency in using the PWM/counter example. I also dropped the signal to TTL logic levels. I made a 555 timer oscillator to produce my test signal.

The one problem I am currently having is that I can only manage to read frequncy via the DIO18 pin which is labeled as CIO2 on the labjack. Should I be able to read the frequency via a pin labeled "FIO" or do I need a "CIO" pin ?

Thanks!

 

LabJack Support
labjack support's picture
What DIO you can use depends

What DIO you can use depends on the frequency of your signal. A sub-500Hz signal could certainly be measured with one of the DIO_EF on the FIO such as our frequency input feature. Each of our DIO_EF feature pages have a section about relevant edge rates for the feature.

There is a table with which DIO_EF are supported on each DIO on our main DIO_EF documentation page:

http://labjack.com/support/datasheets/t-series/digital-io/extended-featu...