Subsystem Initialization header
This page contains the complete code of the header file in this chapter.
In SystemInitialization.h
, your code should be as follows:
#pragma once
//Using instances other than zero requires a special license.
#define INSTANCE 0
//Base cycle time for the EtherCAT network.
//Require the High Speed Timer license if the cycle time is less than 1 millisecond.
#define CYCLE_TIME cycle500
//Available control modes for the axes.
#define ACCESS_MODE accessPos
//Print logs to RtxServer.
#define VERBOSITY FALSE
//Map the axes digital inputs to the PDO.
#define SERVO_INPUT TRUE
//Map the axes digital outputs to the PDO.
#define SERVO_OUTPUT FALSE
//Map the axes internal position to the PDO.
//It works only when two encoders are connected to the axis.
#define SECOND_ENCODER FALSE
//Map the actual velocity variable to the PDO.
#define ACTUAL_VELOCITY TRUE
//Map the actual torque variable to the PDO.
#define ACTUAL_TORQUE TRUE
//Map the actual current variable to the PDO.
#define ACTUAL_CURRENT TRUE
//Map the following error variable to the PDO.
#define FOLLOWING_ERROR TRUE
//Map the max torque variable to the PDO.
/*If your drive has the Max Torque object and you set this value
to TRUE, you must use WriteAxisMaxTorque to set its value, or
the axis won't move.*/
#define MAX_TORQUE FALSE
//Map the max current variable to the PDO.
/*If your drive has the Max Current object and you set this value
to TRUE, you must use WriteAxisMaxCurrent to set its value, or
the axis won't move.*/
#define MAX_CURRENT FALSE
//Map the Modes of Operation to the PDO.
//It works only when the control mode is changed while the axis is enabled.
#define SYNCHORNIZED_CONTROL_MODE TRUE
//Automatically restart the master when the EtherCAT cable is reconnected.
#define AUTO_RESTART TRUE
//Automatically restart individual slaves when they are powered back on.
#define AUTO_REPAIR TRUE
//Use the automatic EtherCAT configuration feature.
//If this is disabled, most of KINGSTAR feature are disabled.
#define AUTO_CONFIG TRUE
//Use distributed clocks (DC) to synchronize the slaves.
#define ENABLE_DC TRUE
//Wait for the slaves to be synchronized before going to OP.
#define DC_CHECK TRUE
//Use Master shift instead of Bus shift for DC.
//The slave synchronization jitter will be reduced but the master may be less stable.
#define DC_MASTER_SHIFT FALSE
//Allow slaves to be added while in OP.
//Require the Hot Connect license.
#define HOT_CONNECT FALSE
//Connect the last slave back to the computer for cable redundancy.
//Require the Cable Redundancy license.
#define REDUNDANCY FALSE
//Minimum number of axes in the system.
//Simulated axes will be added if there is not enough hardware connected.
#define AXES_COUNT 2
//Minimum number of I/O modules in the system.
//Simulated modules will be added if there is not enough hardware connected.
#define IO_COUNT 3
//Length in bits of the input buffer of simulated modules.
#define IO_INPUT_LENGTH 16
//Length in bits of the output buffer of simulated modules.
#define IO_OUTPUT_LENGTH 16
BOOL StartKingstar();
BOOL StopKingstar();