Author Topic: Configuring Rules for Elk Zone Change  (Read 3238 times)

MavRic

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Configuring Rules for Elk Zone Change
« on: September 24, 2011, 07:15:18 am »
I have a rain meter that closes and then opens again the contact on an Elk zone whever 0.01" of rain has fallen.

I want to record this and set up a rule for 'Zone Logical Status Changed' for the Elk driver.

On the rules tab is says the Event arguments are 'Index', newValue' and 'previousvalue'.

However on the 'whenever' page only the 'index' argument shows up.

Since when the contact is closed it goes open to close to open i only want to record 1 of the transitions and not the transition back to open but since the new and previous values are not available as arguments i cannot do this and am recording 2events events rather than 1.

Any suggestions? Is this is bug in the Elk driver?

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Configuring Rules for Elk Zone Change
« Reply #1 on: September 24, 2011, 08:51:17 am »
Since that event doesn't expose the value as an option you can use the Action List editor to add a condition when uses the event args, or you can add a script which would look something like:

Code: [Select]
if (eventargs.newvalue = 255)
{
    //... do something here
}
John Hughes
Codecore Technologies

MavRic

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Configuring Rules for Elk Zone Change
« Reply #2 on: September 24, 2011, 12:36:19 pm »
Thanks for the suggested workaround.

Since the description says it has these arguments...is this just a small bug in the driver that can get fixed?


John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Configuring Rules for Elk Zone Change
« Reply #3 on: September 25, 2011, 09:47:11 pm »
This is not a bug, event arguments are different than whenever filters criteria.

Event arguments are data provided to the rule's script via a variable named EventArgs.
John Hughes
Codecore Technologies

MavRic

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: Configuring Rules for Elk Zone Change
« Reply #4 on: September 26, 2011, 04:31:28 pm »
Thanks for the clarification.  I seriously need to read up a bit on the scripting language so i can start doing some of the fancier stuff.