Get I/O and variable descriptions using OptoScript


#1

Is there a way to programatically get at the I/O and variable descriptions using OptoScript? I would like to send the tag names and descriptions to my web server.

Thanks.


#2

For the description, not that I know of.
Pretty sure (99.999%) sure that the description is not even downloaded to the controller.

The only way I can think you could do it is to put the description into a text file that got downloaded and put into a string table.
Either as a persistent, or as something like a recipe file.

Ben


#3

I’m using the method that you developed at http://internetio.com/ using a tcp handle and sending the data in the url GET. Then I’m inserting the data into a couple of DBs.

So, it sounds like we would have to have some sort of “config” or “ini” file on each of controllers that gets pushed or grabbed from the web server with tag names that are being populated to the DBs along with their corresponding descriptions. Is that right? We would just like to have, on our webserver, a more human-readable description of each of the tags as they are being trended.


#4

To take a little step back here, I’d like to comment on correlating data in strategies in general.

Sometimes you’ll have a set of items (people; or I/O points) that have more than one piece of information related to them (name & extension; or tag & description). While you could create a file and read it in, just using some tables might be simpler.

For example, we’re using a [I]groov [/I]Box to keep track of the engineers in the building who are available to support [I]groov [/I]on the phone. I’ve got a list that includes information like name, phone, and what they’re supporting. I’m loading this information into several tables. Here’s a code snippet:

…
stPeopleNames[nTableIndex] = "Ben";      stPeopleExtension[nTableIndex] = "3028";   stPeopleTopics[nTableIndex] = "all groov"; IncrementVariable(nTableIndex);
stPeopleNames[nTableIndex] = "Mary";     stPeopleExtension[nTableIndex] = "3021";   stPeopleTopics[nTableIndex] = "all groov"; IncrementVariable(nTableIndex);
…

In your case especially, the list probably won’t be changing a lot or on-they-fly (if you change any I/O points you’re going to be changing your strategy anyway). So you might consider loading up 2 tables, one for the tags needing human-readable descriptions (I’m using a pointer table here), and one for the descriptions.


// Initialize table index & the tables that go with it (using this index as a key)
nTableIndex = 0;

ptIOPoints[nTableIndex] = &DigIn16;   stPointDescription[nTableIndex] = "Your Pointname/description here";  IncrementVariable(nTableIndex);
ptIOPoints[nTableIndex] = &DigIn02;   stPointDescription[nTableIndex] = "Store Main Switch";                IncrementVariable(nTableIndex);
...

See more tricks/tips on using and initializing tables here.

Hope that helps!

-OptoMary