Triggering on an event rate

Posted on
Sat Jun 30, 2012 12:15 am
berkinet offline
User avatar
Posts: 3298
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Triggering on an event rate

I have an application where an EasyDAQ input is monitoring a remote relay. The relay has three basic states: Off; slow pulsing and fast pulsing. Slow pulsing is approximately .5 sec. On, .5 sec. Off. Slow pulsing is approximately .5 sec On, 1 sec Off. I can see the pulsing using an EasyDAQ plugin Action. I can also create a simple resettable timer to let me know if the relay is Off or pulsing. But...

My question: Is there a way either directly in Indigo, or through scripting, to determine which of the two pulsing states the relay is in?

BTW, for those that care about such things, the relay is part of an electric gate control and the three states correspond to actual gate state as follows: Off = Fully open or Closed; Fast pulse = gate opening and Slow pulse = gate closing.

Thanks for any ideas.

Posted on
Sat Jun 30, 2012 4:47 am
johnpolasek offline
Posts: 911
Joined: Aug 05, 2011
Location: Aggieland, Texas

Re: Triggering on an event rate

About the only thing I could think of to try would be a pair of triggers. The first with action collection plugin->set timestamp to variable RelayOnTime on relay on and the second trigger on relay off with set timestamp to variable RelayOffTime followed by python conversion of time to float subtracting to get the difference and setting a RelyState Variable to OPENING or CLOSEING depending on whether the time was greater or less than 0.75 sec. And putting an additional delay after 5 seconds on the relay open trigger to strip the "ING". The only thing is that the delays within the Insteon transmissions might kill you.

Posted on
Sun Jun 23, 2013 7:42 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Triggering on an event rate

Berkinet, what was your eventual solution to this problem?

Posted on
Sun Jun 23, 2013 8:09 am
berkinet offline
User avatar
Posts: 3298
Joined: Nov 18, 2008
Location: Berkeley, CA, USA & Mougins, France

Re: Triggering on an event rate

My solution was to redesign the interface and not use the flashing lamp at all. So, no, I haven't resolved the original problem

But, I can think of two possible solutions: I have not used these, but either the 1057 - PhidgetEncoder HighSpeed or the 1054 - PhidgetFrequencyCounter (you have one of these, I think), might do what you want.

The 1057 outputs:
    ...an event that is issued whenever a change in encoder position occurs. This event returns the length of time that the change took (in milliseconds), and the amount of change (positive/negative encoder increments).
Convert time to frequency and you have the answer.

The 1054 outputs:
    ...an event that is issued whenever some counts have been detected. This event will fire at up to 31.25 times a second, depending on the pulse rate. The time is in microseconds and represents the amount of time in which the number of counts occurred. This event can be used to calculate frequency

The Phidgets plugin does not yet support either of these Phidgets. But, if someone were to loan me the appropriate Phidget, I am sure I could get it added.

Let me guess, you are trying to determine your water flow rate ;-)

Posted on
Sun Jun 23, 2013 8:17 am
hamw offline
Posts: 1212
Joined: Mar 31, 2008

Re: Triggering on an event rate

Yes, to detect the difference between a late night toilet flush vs the beginnings of a slow leak. I will post a script to my water meter install thread that looks for consumption over time.

btw I am happy to loan you the 1054. :D

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests