Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Pulse Counting


  • Please log in to reply
8 replies to this topic

#1 embayweather

embayweather
  • Members
  • 30 posts

Posted 03 August 2011 - 03:33 PM

Totally new to DAQFactory, Labjack and scripting. I am trying to build my own weather station, and measuring voltage outputs is not a problem. However, my anemometer also outputs pulses anything from 1 every so often to perhaps 10 per second. I need to count those pulses and display the total. Try as I might I cannot find a way through setting this up. I can get the pulse counting to work with LJcontrolpanel, but further than that I cannot go. Please help, as I am completely lost as to how to begin to set this up. Thanks Best wishes Mike

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 03 August 2011 - 04:00 PM

Have you seen the DAQ Factory application guide and associated examples? There are examples for most of the LabJack's features, including counters and timers.

You can get the examples here:
http://labjack.com/s...ples/daqfactory

And the application guide is here:
http://labjack.com/s...df-lj-app-guide

You should be able to just load up the BasicCounter example and start getting readings. If you want to understand what is going on and how to write your own apps the application guide can provide a great foundation for using LabJack devices in conjunction with DAQ Factory.

#3 embayweather

embayweather
  • Members
  • 30 posts

Posted 03 August 2011 - 04:42 PM

Thank you for the quick reply. I have read and re read the manual but find it way beyond me at the moment as the logic of it, for me at least, is not very clear. i was not aware of the examples so I am downloading them now to see if there is anything there that can help. i will report back. Thanks once again Best wishes Mike

#4 embayweather

embayweather
  • Members
  • 30 posts

Posted 03 August 2011 - 05:13 PM

Thank you. I am now working in a simple form using TimerIn, which is whatI had used before but would not work, except I had forgotten to put the Expression in the Variable Value Component. Thank you for pointing me in the right direction. Back to building the weather station, I think that your thermocouple example will be very useful there. Best wishes Mike

#5 eka

eka
  • Members
  • 30 posts

Posted 04 August 2011 - 11:02 AM

Totally new to DAQFactory, Labjack and scripting. I am trying to build my own weather station, and measuring voltage outputs is not a problem. However, my anemometer also outputs pulses anything from 1 every so often to perhaps 10 per second. I need to count those pulses and display the total.
Try as I might I cannot find a way through setting this up. I can get the pulse counting to work with LJcontrolpanel, but further than that I cannot go.
Please help, as I am completely lost as to how to begin to set this up.

Thanks

Best wishes

Mike


In DF set channel type to counter. You have to read the docs about offset, etc. Depending on the pulse type (Most Davis anemometers just grd on "count"), you can choose how to set up the circuit. For Davis you will probably have to do an RC circuit to debounce the signal.

for a Davis anemometer

This DF code gives mph
// NOTE: Receiving inherits 2nd Params TIME
private xxx =(((-W_count[1] + W_count[0]) / (-W_count.Time[1] + W_count.Time[0])) /0.44444)

#6 eka

eka
  • Members
  • 30 posts

Posted 04 August 2011 - 11:05 AM

see documentation here for what I've done with a LJ U3

http://sbcglobalpwp....-osos408weather

#7 embayweather

embayweather
  • Members
  • 30 posts

Posted 24 August 2011 - 01:08 PM

Thank you for your help eka. I regret not being able to reply more quickly but we have had a death in the family so we have been a little pre occupied. I will study the pointers you have given me and see what progress I can make. Once again, many thanks Best wishes Mike

#8 embayweather

embayweather
  • Members
  • 30 posts

Posted 18 February 2013 - 05:22 PM

I now want to connect up the anemometer that closes a switch every time 1.25m of air has passed by. I cannot use the Counters as both have been taken up by other sensors, so the method above cannot be used any more. However, I was considering using the time between the switch being closed and converting that in to wind speed. I had thought about using a method similar to that in 10.5.2 of the Guide. Is this possible, or is there a more effective way ? Your advice , as ever, would be appreciated. Thanks Best wishes Mike

#9 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 19 February 2013 - 09:25 PM

Yes, in general timing pulse period is another way to measure frequency, besides counting for a set time:

https://forums.labja...?showtopic=1105

Section 10.5.2 of the DF-LJ App Guide is applicable, and see "Simple PeriodIn32 Example.ctl":

http://labjack.com/s...ples/daqfactory

If you want to stick with the counting over time technique, you can actually use the timers in mode 5 or 6 where they act like counters:

http://labjack.com/s...s-guide/2.9.1.5

http://labjack.com/s...s-guide/2.9.1.6


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users