Add variables

Variables are used to access specific addresses. Global variables can be used anywhere. Local variables can be used for one program, or shared by multiple PLC programs if the variables are in the same folder. In this section, you'll learn how to add variables.

Add global variables

  1. In the Project panel, right-click KINGSTAR Project (your project name) and select Add > New global variables group.
  2. A new variable group is added. Right-click New_var_group1 and select Rename.
  3. Enter a meaningful name for the group and press Enter. We name it "Sensor."
  4. Right-click Sensor (your group's name) and select New variable to add a global variable.

Add local variables

  1. In the Project panel, double-click main (or your PLC program).
  2. In the main panel, in the Local variables editor, right-click an empty area and select Insert.
  3. A local variable is created. Click its Name cell.
  4. Enter a meaningful name for the variable and press Enter. You can click other cells to change their content.

SFC local variables:

All the actions and transitions of a single sequential function chart (SFC) program are considered parts of the SFC program. They share the same local variables.