Using a macro to read values – Echelon IzoT Commissioning Tool User Manual

Page 211

Advertising
background image

Data Point SmartShape ID index refers to the numeric digits at the end of the Data Point
SmartShape name. For example, if the name of Data Point SmartShape is Data Point.53, you will
enter Sheet.53!User.MonValue (essentially, replace “Data Point” with “Sheet”).

• To change the color for the “on” state, you can perform some arithmetic function on the Data

Point SmartShape value. For example, to change the color of the Visio SmartShape to yellow
when the lamp is on, enter the following function: Sheet.<Data Point SmartShape ID
index
>!User.MonValue *5.

• If you are monitoring the lamp value, you can change the color of the Visio shape based on

the brightness of the lamp. To do this, enter the following function: Sheet.<Data Point
SmartShape ID index
>!User.MonValue/10.

4. Click the accept button (

) in the Formulas box.

Using a Macro to Read Values

To read from a Data Point SmartShape value using a Macro, follow these steps:

1. Click the Developer tab, and then click Macros. The Macros dialog box opens.

2. In the Macros Name: dialog box, enter a name for the Macro. Click Create. The Network

Passwords dialog opens if this is the first time you are creating a Macro or entering VBA code in
your OpenLNS CT drawing.

3. Enter enumerate in the Password box.

4. The Visio VBA editor opens.

5. In the right pane, enter VBA code for the Visio shape to read from a data point. The following

code is used to change the text in the Visio shape to “ON” and the color to yellow when the state
of the lamp is on (1). If the state of the lamp is off (0), the text in the Visio shape changes to
OFF” and the color changes to black.

Sub LED

Dim vsoPage As Visio.Page
Dim myShape As Shape
Dim myShape2 As Shape
Set myShape = ActivePage.Shapes("Circle")
Set myShape2 = ActivePage.Shapes("Data Point.50")

IzoT Commissioning Tool User’s Guide

195

Advertising