Start and stop the KINGSTAR Subsystem through variables

If the KINGSTAR Subsystem has encountered a problem and stops running, the variable state we get will be incorrect. In PLC, we can check whether the Subsystem is running through variables, and use these variables to start and stop the Subsystem.

  1. In KINGSTAR Control Panel, turn on KINGSTAR PLC.
  2. In the LogicLab toolbar, click Connects to the target.
  3. In the toolbar, click Download PLC code to download your PLC program to the PLC Runtime. Before downloading the program, LogicLab will remind you to set a password for the program if you didn't set it, and ask if you want to cold restart. Click Yes.
  4. On the View menu, click Tool windows > Watch.
  5. In the Resources panel, make sure there are devices in the list. You need to have at least one real or simulated device (axis or I/O module), or you can't start the KINGSTAR Subsystem.
  6. In the Library Tree pane (on the right of the window), click Target variables.
  7. Under KINGSTAR_Subsystem, find and drag ksInitialized, ksStart and ksStop to the Watch panel on the left.
  8. Check the value of KSINITIALIZED. It is FALSE if the KINGSTAR Subsystem is not started and axes and Subsystem's configurations are not downloaded or not downloaded successfully. To start the Subsystem, we use KSSTART. It starts the Subsystem only when its value is changed from FALSE to TRUE. If you find that KSINITIALIZED is FALSE:
  9. NOTE:  You can enter "1" or "0" for TRUE or FALSE, respectively.

    NOTE:  You can drag ksStarted to the Watch panel, but it only checks whether the KINGSTAR Subsystem is started.

  10. After changing KSSTART's value, wait a bit for the KINGSTAR Subsystem to start. When it is started, KSINITIALIZED is changed to TRUE.
  11. NOTE:  If KSINITIALIZED is not changed to TRUE, click Debug (lower-left of the screen) and check the messages in the pane. If there is an error, KSINITIALIZED will remain FALSE and KSSTARTED be changed to TRUE, because the Subsystem is started without successfully configuring every device.

  12. To stop the KINGSTAR Subsystem, double-click KSSTOP's value and set it to TRUE. When the Subsystem is stopped, KSINITIALIZED is changed to FALSE.