Add variables and function blocks to Watch

After you create a PLC program, you need to connect and download your program to KINGSTAR PLC Runtime to run it. When your program is running, you need to control and monitor some variables and function blocks (FBs) to make sure they work properly. To control and monitor variables and FBs, drag them to the Watch panel.

Topics:


Display the Watch panel

  1. On the View menu, click Tool windows > Watch.
  2. The Watch panel has been displayed.

Add variables and FBs to Watch

There are two ways to add variables and FBs to Watch. Choose the way you preferred. Before you add variables and FBs, you must connect to KINGSTAR PLC Runtime, or you can't add anything to Watch.

Drag to add

  1. In the Local variables pane, drag a variable to the Watch panel. In this guide, we have Execute and Position variables, and MoveAbsolute1 and MoveAbsolute2 FBs. We drag Execute first.
  2. The variable has been added to Watch.
  3. Add the Position variable. In Watch you can see different type of variables have different icons.
  4. Drag MoveAbsolute1 and MoveAbsolute2 to Watch, in which you can see an FB's icon is different from a variable's.

Right-click to add

  1. In the source editor, right-click the Execute variable (or any other variable). In the context menu, click Add to watch.
  2. The variable has been added to Watch.
  3. Right-click the MoveAbsolute1 FB (or any other FB). In the context menu, click Add to watch.
  4. The FB has been added to Watch.

Control and monitor variables and FBs

In Watch, double-click a variable's value to change it. Depending on the variable's type, the value can be changed in different way. For Execute, you can enter 0 or 1 to toggle between TRUE or FALSE. For Position, you can enter a new value or use the initial. For MoveAbsolute1 and MoveAbsolute2, you can expand them to check their states and see whether these states correctly responds to their connected variables or constants, and check errors if they occur. In an FB, you can also double-click a variable's value to change it.