How to access variables

This tutorial describes how to access variables in your custom views.

This tutorial assumes you know how to create a Custom view (see other tutorials for more information).

Live demo   Download IOK

Note: Omniscope server does not currently allow the creation of variables. For a file to include a variable, it must first be opened in the old desktop application where it can be created.

How to access variables in Custom view

Let’s assume you have a variable called “My var” which has a numeric value. To access the current value of the variable we need to look into the variables property of the view’s context as this is the place all variables states is stored.

To retrieve the state of the variable we simply need to the following:

...
omniscope.view.context().variables["My var"];
...

You can then use the value as an input into your Query API call or for display purposes.

Demo

Download and open the demo from the link above and change the “Logic choice” or “Integer” variable device to see the results in the custom view.

Next: Advanced - using manual querying and auto-paning