Accessing timers via groov (and other reasons NOT to edit your idb.txt file)


#1

As all you pro [I]groov [/I]users know, your [I]groov [/I]Box (or Server) uses the .idb.txt text file generated by PAC Control to “learn” what tags exist on your controller. Since this file is just text, it’s easy to edit. But why might you want to do that? I’ve come across two (admittedly a bit obscure/unusual) reasons:

  1. De-clutter your tag choices--if you're connecting to a controller with a ton of tags, most of which you won’t be needing in your [I]groov [/I]HMI (or perhaps you don't want the person developing the [I]groov [/I]interface to be distracted by ALL the variables in your strategy--more on that later)
  2. Allow groov to see/change the not-yet supported (in version 1.0) timer values in your strategy--BUT ONLY IN CERTAIN CASES, other easier-to-maintain options exist... see below.

I can also think of many reasons [B]why you should NOT edit this text file[/B]: insert standard disclaimer here… and also consider:

  1. if you edit the file (without renaming the new one to something else), the very next time you compile/download your strategy, it will be overwritten--you just added a layer of complexity you many not want/need
  2. this "trick" may not be supported by future versions of the [I]groov [/I]App,
  3. you could cause big trouble if you make a typo while editing, danger park ranger, Will Robinson and all the ships at sea.
But, if you’re like Ben and enjoy voiding warranties and want your [I]groov[/I] to be able to change values for timers (withOUT changing any strategies), this post [I]may [/I]be for you.

First some background, in case you’re wondering how OptoMary comes up with these crazy ideas. [B]NORMALLY[/B] to access your timers via [I]groov[/I], consider:

  1. Currently [I]groov [/I]only updates every 1 second, so that's BEST resolution you might get on changing your timer values.
  2. Adding a little logic (looping, with a short delay) in a chart to copy a float or integer into your timer is simple at the [B]RECOMMEND [/B]method.
  3. If you have LOTS of strategies running, like the customer who brought this dilemma onto my radar, or have other reasons for not wanting to change your existing strategies, you can use [this peer-to-peer method](http://www.opto22.com/community/showthread.php?t=491), just use the float subroutine to poke a new value into your (unchanged) strategy. This poking could be done by a new "master" (perhaps running on SoftPAC) strategy or as a new chart on one of the existing strategies which would be the least difficult to update.

So, if you’re one of those people who’s replaced the firmware on your router and like to take things apart just to see how they work (and you can even those things back together and they still work), here’s my DON’T TRY THIS AT HOME info on that idb.txt file…

NOTE: Your idb.txt includes a lot of “comments” which start with a # and which you might be tempted to remove while you’re de-cluttering. Don’t remove the line that starts with:

[INDENT][B]# NAME :
[/B][/INDENT]
Otherwise [I]groov [/I]won’t know this strategy’s name and you’ll see a blank in [I]groov [/I]where it’d be really handy to see that strategy name for reference.

Side note: when naming or re-naming your tags in PAC Control, you might choose a naming convention such that the tags you want to include in your HMI start with HMI_ (or something) so they’re easier to spot. For more on Best Practices (including naming conventions) see this document.


Now, about those timers. Here in my .idb.txt file, I’ve commented out (added a # at the start) the line that PAC Control created for my timer called dtDownTimer. Order of these lines/variables is not important, so sometimes I’ll re-arrange things in an order that I like better.

This is how I can fool [I]groov [/I]into thinking that dtDownTimer is just a regular float and let me read/write to it. That second highlighted line is the one I created, which you’ll notice looks like the float variable below it.

[B]The last big hex number on the right[/B] just needs to be changed [B]from 00000020 to 00000010. [/B]

Neat-o!

-OptoMary