Automatically create simulated devices
In LogicLab, you can decide whether the simulated devices are created automatically and how many of them will be created.
To create the simulated axes and I/Os automatically:
- In the Resources panel to the left, click KINGSTAR PLC.
- In the Resources panel in the middle, in Connection Settings, click Devices Settings and make sure the Create simulated axes / IOs automatically check box is selected.
- In this guide, we want to create three simulated axes and two simulated I/Os. To do this, first we add a simulated axis. In the Resources panel to the left, right-click Axes and click Add Axis to add a simulated axis.
- Right-click IOs and click Add IO to add a simulated I/O module. When you add an I/O module, you can edit its name, input and output length, and data type in the Add IO dialog box.
- You now have one simulated axis and I/O module. The index of the simulated axis and I/O module is six and five, respectively. Change the index of the simulated axis to eight, and I/O module to six.
- In the KINGSTAR Control Panel, turn on KINGSTAR PLC.
- In the LogicLab toolbar, click Connects to the target.
- In the LogicLab toolbar, click Download PLC code.
- On the View menu, click Tool windows > Watch.
- In the Library Tree pane (on the right of the window), click Target variables.
- Under KINGSTAR_Subsystem, find and drag ksInitialized, ksStart, ksStop, ksAxesCount, ksIoCount to the Watch panel.
- Double-click the value of KSSTART and set it to TRUE. Wait a bit for the KINGSTAR Subsystem to start. When it is started, KSINITIALIZED becomes TRUE.
- After KSINITIALIZED becomes TRUE, the values of KSAXESCOUNT and KSIOCOUNT become 9 and 7, respectively. We set the index of the simulated axis to 8, and the ending index of the real axis is 5, so LogicLab creates the simulated ones from the index 6. The indexes of simulated axes are 6, 7, 8. Likewise, the indexes of the simulated I/O modules are 5, 6.
- The automatically created simulated axes and I/Os won't be displayed in the Resources panel. You can use KINGSTAR Configuration Tool to check them.
NOTE: If you didn't select the check box but create simulated devices in the following steps, KINGSTAR won't be started successfully and the RtxServer window will display error messages about the simulated devices.
![]() |
![]() |
Axis index – before | Axis index – after |
![]() |
![]() |
I/O module index – before | I/O module index – after |
![]() |
![]() |
NOTE: When you download PLC code, LogicLab asks you some questions. For more information about these questions, See Compile and run your PLC program > Step 4.