Features, discussions, tips, tricks, questions, problems and feedback

Check if Agent exists

Hi, is it possible to check if an agent exists via spiders or script in a grafik form and depending on outcome view the agents value?

When you use standard ReadDataElement function and tag doesn’t exist your methodreturninfo object property success will return false, also there will be error message in the return information property that tag does not exist


You can also make use of VariableDataElement and ExtendedDataElement spiders in order to check if an Agent exists and to provide the values thereof:


An example graphic form can be downloaded here: ExtendedDataElement.viz (21.8 KB)

Hey Frits,

I’m in a similar situation as Blue. I’ve tried the spider method you mentioned with no success. My agent is a Custom agent, and all I need is to be able to Enable/Disable a button when a specific tag doesn’t exist. This button is meant to open a Graphic form with the agent I’m validating.

When the agent exists, it returns a “Good” value, but when I delete the agent to test the spider, I get no response it keeps the previous value. Shouldn’t this return a “Bad” value instead? I’ve set up a Multistate spider to map these values to “True” and “False.”

I’m still relatively new to Adroit, so is there a better way to achieve this? I’m not familiar with the C# scripting side.

The following graphic form is an example on how to determine whether a tag exists / do not exist and can be downloaded here:

tmplCheckIfElementExists.viz (21.2 KB)

It makes use of a script spider, and will change the colour of the button depending on whether the tag exists


or doesn’t exist:


It combines a script and multi-color spider and can be adapted for different purposes: