XS Motion Control Manual
XS Motion Control Manual
User instructions
◆ Only operators with certain electrical knowledge can carry out wiring and other operations on the product. If
there is any unknown place, please consult the technical support personnel of the company.
◆ The examples listed in the manual and other technical materials are only for users' understanding and
reference, and do not guarantee certain actions.
◆ When using this product in combination with other products, please confirm whether it complies with
relevant specifications and principles.
◆ When using this product, please confirm whether it meets the requirements and safety by yourself. The
failure of this product may lead to the machine failure
◆ In case of failure or loss, please set up backup and safety functions by yourself.
Statement of responsibility
◆ Although the contents of the manual have been carefully checked, errors are inevitable, and we can't
guarantee complete consistency.
◆ We will often check the contents of the manual and correct them in subsequent versions. We welcome your
valuable comments.
◆ Please understand that the contents described in the manual are subject to change without notice.
For the hardware related and software application of XS series PLC, please refer to the following manual.
◆ XS series programmable controller user manual [hardware]
◆ XS series programmable controller user manual [software]
This material and its contents shall not be copied, transmitted or used without explicit written
permission. Violators shall be liable for the losses caused. All rights provided in the patent license and
November 2021
Catalog
i
4-1. MOTION PROJECT CONTROL ................................................................................................................................... 28
4-2. MULTIPLE POU USAGE........................................................................................................................................... 28
4-3. CALL MODE OF MOTION FUNCTION ......................................................................................................................... 28
5. MOTION INSTRUCTIONS ...................................................................................................................................... 29
5-1. SINGLE AXIS FUNCTION .......................................................................................................................................... 29
5-1-1. Single axis instruction list .............................................................................................................................. 29
5-1-2. Single axis instructions .................................................................................................................................. 30
5-1-3. Single axis function application ..................................................................................................................... 57
5-2. AXIS GROUP FUNCTION ........................................................................................................................................... 58
5-2-1. Axis group instruction list .............................................................................................................................. 58
5-2-2. Axis group instruction introduction ............................................................................................................... 59
5-2-3. Axis group function application ..................................................................................................................... 99
5-3. CAM FUNCTION ................................................................................................................................................... 101
5-3-1. CAM instruction list ..................................................................................................................................... 101
5-3-2. CAM instructions ......................................................................................................................................... 102
5-3-3. CAM function application ............................................................................................................................ 120
6. Q&A ........................................................................................................................................................................... 123
ii
1. EtherCAT overview
1-1. EtherCAT overview
EtherCAT is the abbreviation of Ethernet for control automation technology. It is the open network
communication between master station and slave station for real-time Ethernet developed by Beckhoff automation
GmbH, which is managed by ETG (EtherCAT Technology Group).
Modes of operation
csp Cyclic synchronous position mode
position PP Profile position mode
Modes of operation hm Homing mode
csv Cyclic synchronous velocity mode
speed
pv Profile velocity mode
cst Cyclic synchronous torque mode
torque
tq Torque profile mode
1
Item Specification
Communication object SDO[service data object], PDO[process data object]
Single station PDO maximum allocation TxPDO: 4 [pcs] RxPDO: 4 [pcs]
Single station PDO max bytes TxPDO: 24[byte] RxPDO: 24[byte]
Mailbox communication space in PreOP 1ms
mode
Email SDO request and SDO information
Expansion IO
EtherCAT
The whole bus network is linear structure, in which XS3 series controller is the master station and Xinje DS5C1
series servo station is the slave station. XS3 series PLC has upper and lower network ports. The upper network
port is Ethernet/IP, which is used to connect Codesys upper computer. The lower network port is EtherCAT
connection port, which is used to connect Xinje DS5C1 series servo to realize EtherCAT communication. The two
communication network ports of Xinje DS5C1 series servo driver shall follow the principle of "bottom in and top
out".
2
2. EtherCAT specification
2-1. EtherCAT frame structure
EtherCAT is an industrial communication protocol that can be controlled in real time based on Ethernet. It only
expands the IEEE 802.3 Ethernet specification without any change to the basic structure, so it can transfer the data
in the standard Ethernet frame.
Note: when Ethernet frame is shorter than 64 bytes, add 1~32 bytes.
(Ethernet Header + Ethernet Data + FCS)
Because the EtherType of the Ethernet Header is [88A4h], the subsequent Ethernet data is processed as an
EtherCAT frame. "EtherCAT frame" is defined and analyzed by a certain protocol. As long as the master station
and slave station abide by this protocol, data communication can be realized. Commonly used protocols include
CANopen Over EtherCAT (CoE), Sercos Over EtherCAT (SoE), etc.
3
2-2. ESM
EtherCAT State machine (ESM) is responsible for coordinating the state relationship between master and slave
applications during initialization and operation.
The state change request is executed by the master station. The master station puts forward a control request to the
application layer service, which generates an application layer control event in the slave station. After the state
change request succeeds or fails, the slave station responds to the application layer control service through the
local application layer state write service. If the state change fails, the slave station maintains the state and sets an
error flag.
Communication action
SDO
Slave station status Actions in each state (mailbox) PDO PDO
send & Send Receive
receive
Communication is initialized, SDO and PDO
Init - - -
cannot receive and send messages
Pre-Operational (PreOP) Only SDO can send and receive Yes - -
Safe-Operational (SafeOP) Only SDO can send and receive, PDO can send Yes Yes -
Operational (OP) SDO and PDO both can send and receive Yes Yes Yes
Note: the access from the master station to the ESC register is independent of the above table and can be used at
any time.
PDO (process data object) is used to transmit periodic communication data.
SDO (service data object) is used to transmit aperiodic communication data.
Instruction or interface operation during ESM state switching may cause abnormal communication and error
reporting.
4
2-3. ESC
AutoForwarder+
PDI
Loopback
ECAT Interface PDI Interface
PHY
Management
FMMU
ECAT
Processing SyncManager
Unit
Distributed
Monitoring EEPROM Status
Clocks
5
Length Initial
ESC register byte address Explanation
(Byte) value*1
0008h~0009h 2 ESC Features supported 0184h
Station Address
0010h~0011h 2 Configured Station Address -
0012h~0013h 2 Configured Station Alias -
…
Data Link Layer
…
0100h~0103h 4 ESC DL Control -
…
0110h~0111h 2 ESC DL Status -
Application Layer
0120h~0121h 2 AL Control -
0130h~0131h 2 AL Status -
0134h~0135h 2 AL Status Code -
…
PDI
0140h 1 PDI Control 08h
0141h 1 ESC Configuration 0Ch
0150h 1 PDI Configuration -
0151h 1 SYNC/LATCH PDI Configuration 66h
0152h~153h 2 Extend PDI Configuration -
…
Watchdogs
0400h~0401h 2 Watchdog Divider -
0410h~0411h 2 Watchdog Time PDI -
0420h~0421h 2 Watchdog Time Process Data -
0440h~0441h 2 Watchdog Status Process Data -
0442h 1 Watchdog Counter Process Data -
0443h 1 Watchdog Counter PDI -
…
FMMU
0600h~062Fh 3x16 FMMUs [2:0] -
+0h~3h 4 Logical Start Address -
+4h~5h 2 Length -
+6h 1 Logical Start bit -
+7h 1 Logical Stop bit -
+8h~9h 2 Physical Start Address -
+Ah 1 Physical Start bit -
+Bh 1 Type -
6
Length Initial
ESC register byte address Explanation
(Byte) value*1
+Ch 1 Activate -
+Dh~Fh 3 Reserved -
…
Distributed Clocks(DC)-SYNC Out Unit
0981h 1 Activation -
…
0984h 1 Activation Status -
098Eh 1 SYNCO Status -
…
0990h~0993h 4 Start Time Cyclic Operation/Next SYNC0 Pulse -
…
09A0h~09A3h 4 SYNC0 Cycle Time -
…
2-5. SDO
DS5C1 series supports SDO (service data object). The data exchange of SDO uses mailbox communication, so the
data refresh time of SDO becomes unstable.
The master station side reads and writes data in the records in the object dictionary, and can set the object and
monitor various states of the slave station. The response to the read-write action to the SDO takes time. For
objects refreshed with PDO, do not refresh with SDO, but overwrite with the value of PDO.
16bit 16bit 6bit 2bit 4bit 4bit 9bit 3bit 4bit Max:1478byte
Length Address Channel Prio Type Cnt Number Res Serv Cmd Specific
7
Frame Data area Data type Function
MailBox Header Length WORD Mailbox data length
Address WORD Address of source station
Channel Unsigned6 (Reserved)
Prority Unsigned2 Priority
Type Unsigned4 Mailbox type
00h: error
01h: (reserved)
02h: EoE (not corresponding)
03h: CoE
04h: FoE (not corresponding)
05h: SoE (not corresponding)
06h-0Eh: (reserved)
0Fh: VoE (not corresponding)
Cnt Unsigned3 Mailbox counter
Reserved Unsigned1 (Reserved)
CoE Header Number Unsigned9 Reserved
Reserved Unsigned3 Reserved
Service Unsigned4 Information type
Cmd specific Size Indicator Unsigned1 Data Set Size use license
Transfer Type Unsigned1 Normal transfer/Expedited transfer
Data Set Size Unsigned2 Specified data size
Complete Access Unsigned1 Selection of object access method (not
corresponding)
Command Specfier Unsigned3 Upload/download
Selection of requirements / responses, etc
Index WORD Object Index
Subindex BYTE Object Subindex
Object data or Abort message
8
2-5-3. Alarm information
9
2-6. PDO
DS5C1 series supports PDO (process data object).
EtherCAT based real-time data transfer is performed through data exchange of PDO (process data object).
PDO includes RxPDO transferred from master station to slave station and TxPDO transferred from slave station
to master station.
Send side Receive side
RxPDO Master station Slave station
TxPDO Slave station Master station
The maximum number of application objects that a mapping object can map is as follows:
RxPDO: 4 [Table] (1600h~1603h).
RxPDO: 4 [Table] (1A00h~1A03h).
Usually, one mapping object is enough, so the default one does not need to be changed.
10
Example of setting PDO allocation object:
Allocation of mapping object 1600h to allocation object 1C12h (sync Manager Channel 2).
Index Subindex Object contents
00h 01h
01h 1600h
1C12h 02h 0000h
03h 0000h
04h 0000h
Allocation of mapping object 1600h to allocation object 1C13h (sync Manager Channel 3).
Index Subindex Object contents
00h 01h
01h 1A00h
1C13h 02h 0000h
03h 0000h
04h 0000h
11
2-7. Communication synchronization mode
The DS5C series can select the following synchronization modes.
synchronization content Synchronization method Feature
modes
Synchronize the time
High-precision
SYNC0 event information of other slave
DC Compensation processing is required
synchronization stations based on the time of
at the master station side
axis 1
No transmission delay compensation,
poor accuracy
SM2 event Synchronize according to
SM2 It is necessary to maintain the transfer
synchronization RxPDO receiving time
time on the controller side (special
hardware, etc.)
General
CPU action restart initialization
Time change as the ESM status action
EtherCAT migration instruction
communication *1
state Pre Safe
Init Operational
(ESM state) Operational Operational
SYNC0 signal
from ESC
12
2-7-2. SM2 (SM2 event synchronization)
The local cycle of the slave station starts with the SM2 event.
Since the processing of the slave station starts from the SM2 event cycle, it is always synchronized with the SM2
event.
Since the SM2 event occurs when the receiving of PDO is completed, it must be ensured that the upper (Master)
side sends messages regularly. If the fluctuation (deviation) of the sending time is too large, the synchronization
cannot be completed, or an alarm occurs.
If the above problem occurs, please use DC (sync0 event synchronization).
Approx. 50ms
ON
Flickering
OFF
Approx. 50ms
Approx. 200ms
ON
Blinking
OFF
Approx. 200ms
ON Approx. 1000ms
Single flash
OFF
Approx. 200ms
Approx. 200ms
ON Approx. 1000ms
Double flash
OFF
Approx. 200ms Approx. 200ms
Note: this light is on the PCB inside the servo and cannot be observed outside the servo.
13
2-8-2. L/A IN/OUT
The L/A IN/OUT Indicator indicates the link status and action status of the physical layer of each port.
The light on status is green.
LED status Content
OFF LINK not established
Flickering LINK established, with send and receive
ON LINK established, without send and receive
14
3. EtherCAT parameter configuration
3-1. Master station configuration
3-1-2. General
15
(2) Distributed Clock
Cycle time:
If the distributed clock function is activated, the master station will send corresponding data messages to the slave
station according to the cycle time. Therefore, data exchange can achieve accurate synchronization. This function
is particularly important when synchronous action is required in the distributed process (for example, several
servo axes perform simultaneous linkage tasks). The master clock with signal jitter less than 1 microsecond can be
provided within the network.
Sync offset:
Generally, when the PLC task starts 20%, the synchronization message starts to affect the slave station, which
means that the PLC task cycle can have 80% delay, and no data will be lost within this delay.
Sync window monitoring:
If this option is on, you can monitor the synchronization status of the slave station.
Sync window:
Time used to monitor the synchronization window. If all slaves are within the synchronization window time, the
variable xSyncInWindow (IoDrvEtherCAT) will be set to TRUE, otherwise it will be FALSE.
16
3-2. Slave station configuration
17
(2) Scan th slave station
In the project bar [Device], right click [EtherCAT_Master_SoftMotion], click [Scan For Devices] to scan the
EtherCAT slave station.
Or right click [EtherCAT_Master_SoftMotion], click [Insert Devices], to add the device by manual.
18
In this example, one DS5C1 series servo is connected, the scanning result is shown as below. Click [Copy All to
Project], add all scanned slave stations to the project.
Note: Before using the [scan devices] function, it must be ensured that the EtherCAT device description file of the
slave station has been installed in the Codesys of the commissioning PC, otherwise this function cannot be used.
19
3-2-2. General
(1) Address
AutoInc address:
Determined by the location of the slave station in the network. This address is only used during startup. The
master station needs to assign an EtherCAT address to the slave station. When the first message for this purpose
passes through the slave station, each passing slave station adds its own automatic increment address by 1.
EtherCAT address:
The final address of the slave station, which is allocated by the master station during startup.
20
3-2-3. Expert process data
Select [expert settings] in the general interface, it will show [expert process data] configuration interface.
21
(2) PDO assignment
The larger the PDO data, the longer the transmission time, and it may not be completed within the synchronization
unit cycle. Therefore, the stability of data transmission cannot be guaranteed when there are many slave stations
and each slave station has a large PDO data.
22
3-2-5. Startup parameters
There are three default configurations in the startup parameters, of which 6060h is the slave operation mode, and
the default value is 8 (CSP mode). 60C2-1 and 60C2-2 are synchronization unit cycles, 60C2-1 is the value of
synchronization unit cycles, and 60C2-2 is the unit of synchronization unit cycles.
Start parameters and their execution sequence can be configured through add, edit, delete, move up and move
down.
Note:
The execution sequence is from top to bottom. Different values can be written for the same parameter, indicating
that the parameters are assigned values from top to bottom.
[Error - > Exit]: indicates that if an error occurs when configuring this parameter, all the following configurations
will be skipped.
[Error - > Jump] and [Next line] to specify that when an error occurs, jump to the specified line to continue
configuration.
23
3-2-6. EtherCAT I/O mapping
You can view EtherCAT I/O mapping relationships, function descriptions, actual addresses, and types of mapping
variables.
24
3-3. Axis configuration
Note: If there are multiple slaves, you need to manually add axes for each slave station.
25
3-3-2. SoftMotion drive: general
Axis type:
In order to accurately control the motion position, the controller must accurately calculate the position of the servo
motor. According to the operating characteristics and stroke characteristics of the application system, select [axis
type and limit] so that the controller can calculate the feedback information of the encoder of the reading motor to
obtain the accurate position and avoid the error caused by the accumulated overflow of the encoder pulse number.
If the actual servo motor is not connected, select [virtual mode]. For the reciprocating mechanism of screw type,
its stroke is limited. We often need to know its absolute position within the range of screw stroke. At this time, it is
better to choose [linear mode]. For the rotating shaft of one-way operation type, if the linear mode is adopted, the
position count overflow is likely to occur, resulting in position calculation errors. It is better to select [periodic
mode].
26
3-3-4. SM_Drive_ETC_GenericDSP402: I/O mapping
27
4. EtherCAT control project
4-1. Motion project control
In a project, the instructions used in the program need the support from the file library. Each POU, if not called in
a task, will not be executed. The user can choose to directly configure a task for execution, or select another POU
that is already in the task to call the POU that is the configured task. If the program executed in the POU needs to
interact with external IO or bus, the corresponding high-speed IO module or EtherCAT bus and slave station
equipment shall be configured in the program.
The motion function requires the task with the highest priority, while the logic function generally does not require
the task configuration with that high priority. Therefore, in practical projects, these two blocks are usually placed
in two different POU and tasks. So, how can we control the execution of a motion function in the logic function
even if the motion function is separated from the logic function? Generally, some input variables and output
variables are defined in the motion function for callingby other functions. For example, in the logic POU, if the
motion function needs to be called, the control data is written to the input variables of the motion POU. The
motion POU puts the motion state into the output variable and gives it to the logic POU to judge the motion state
and the execution of program logic.
28
5. Motion instructions
5-1. Single axis function
29
5-1-2. Single axis instructions
30
5-1-2-2. Axis reset [MC_Reset]
31
5-1-2-3. Stop motion [MC_Stop]
Forced
MC_Stop
stop
32
5-1-2-4. Pause the motion [MC_Halt]
Pause the
MC_Halt
motion
33
5-1-2-5. Axis homing [MC_Home]
Axis
MC_Home
homing
For general bus drive homing, the data of index and subindex shall be set as shown in the following table.
34
Index Subindex Explanation
0x6098 00h Homing mode
0x6099 01h The speed from homing start to find the home point, the value is high
to decrease the homing time
0x6099 02h The speed from finding the zero point to homing completed, the value
is low to improve the precision
0x609A 00h Homing acceleration speed
Jog
MC_Jog
operation
35
Initial
VAR_IN_OUT Name Data type Efficient range Description
value
deceleration
Target jerk positive value
Jerk LREAL 0 Jerk speed [u/s3]
speed
Efficient range Initial Description
VAR_OUTPUT Name Data type
value
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Instruction TRUE if the command has been
CommandAborted BOOL TRUE/FALSE FALSE
interrupted terminated by another command
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Absolute
MC_MoveAbsolute
position
36
VAR_IN_OUT Name Initial
Data type Efficient range Description
value
acceleration
Target positive value
Deceleration LREAL 0 Deceleration speed [u/s2]
deceleration
Target jerk positive value
Jerk LREAL 0 Jerk speed [u/s3]
speed
Fastest: automatically select the
3:fastest fastest direction to move
2:current Current: move in current direction
Direction Direction MC_DIRECTION 1:Positive 0 Positive: move forward
0:shortest Shortest: select the direction
-1:Negative according to the shortest path
Negative: move reverse
MC_BUFFER_ if function block is Busy, then only
BufferMode Buffer mode - 0
MODE allow BufferMode=Aborting
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Done Completed BOOL TRUE/FALSE FALSE TRUE after execution
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Change to TRUE in control
Instruction TRUE if the command has been
CommandAborted BOOL TRUE/FALSE FALSE
interrupted terminated by another command
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Position
MC_MoveAdditive
superposition
37
(2) Related variables
VAR_IN_OUT Initial
Name Data type Efficient range Description
value
Axis Axis AXIS_REF_SM3 - - Specified axis
Initial
VAR_INPUT Name Data type Efficient range Description
value
Execute Valid BOOL TRUE/FALSE FALSE Start at rising edge
Distance Position LREAL Data range 0 This data is superposition position data
0, positive
Velocity Target speed LREAL 0 Max speed [u/s]
value
Target positive value
Acceleration LREAL 0 Acceleration speed [u/s2]
acceleration
Target positive value
Deceleration LREAL 0 Deceleration speed [u/s2]
deceleration
Target jerk positive value
Jerk LREAL 0 Jerk speed [u/s3]
speed
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Done Completed BOOL TRUE/FALSE FALSE TRUE after execution
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Instruction TRUE if the command has been
CommandAborted BOOL TRUE/FALSE FALSE
interrupted terminated by another command
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Relative
MC_MoveRelative
position
38
(2) Related variables
VAR_IN_OUT Initial
Name Data type Efficient range Description
value
Axis Axis AXIS_REF_SM3 - - Specified axis
Initial
VAR_INPUT Name Data type Efficient range Description
value
Execute Valid BOOL TRUE/FALSE FALSE Start at the rising edge
Relative distance from the target
Distance Position LREAL Data range 0
to the current position
0, positive
Velocity Target speed LREAL 0 Max speed [u/s]
value
Target positive value
Acceleration LREAL 0 Acceleration speed [u/s2]
acceleration
Target positive value
Deceleration LREAL 0 Deceleration speed [u/s2]
deceleration
Target jerk positive value
Jerk LREAL 0 Jerk speed [u/s3]
speed
if function block is Busy, then
BufferMode Buffer mode MC_BUFFER_MODE - 0
only allow BufferMode=Aborting
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Done Completed BOOL TRUE/FALSE FALSE TRUE after execution
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
39
5-1-2-10. Superimpose relative motion command [MC_MoveSuperImposed]
Superimpose
relative
MC_MoveSuperImposed
motion
command
40
VAR_IN_OUT Initial
Name Data type Efficient range Description
value
ErrorID Error code SMC_ERROR - 0 Error identification
41
VAR_IN_OUT Initial
Name Data type Efficient range Description
value
Negative: move reverse
If the function block is Busy, then
BufferMode Buffer mode MC_BUFFER_MODE - 0
only allow BufferMode=Aborting
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Reach setting The setting speed reached is
InVelocity BOOL TRUE/FALSE FALSE
speed flag TRUE
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Command Instruction TRUE if the command has been
BOOL TRUE/FALSE FALSE
Aborted interrupted terminated by another command
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Position
MC_PositionProfile
profile
42
Initial
VAR_IN_OUT Name Data type Efficient range Description
value
array profile
General
PositionScale LREAL Data range 1 Overall position scale factor
factor
Offset Offset LREAL Data range 0 Position offset
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Done Completed BOOL TRUE/FALSE FALSE TRUE after execution completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Instruction TRUE if the command has been
CommandAborted BOOL TRUE/FALSE FALSE
interrupted terminated by another command
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
43
5-1-2-13. Speed profile [MC_VelocityProfile]
44
5-1-2-14. Acceleration speed profile [MC_AccelerationProfile]
Acceleration
MC_AccelerationProfile
profile
45
5-1-2-15. Actual position read [MC_ReadActualPosition]
Read
MC_ReadActualPosition actual
position
46
5-1-2-16. Read the current torque [MC_ReadActualTorque]
Read the
current
MC_ReadActualTorque
actual
torque
47
5-1-2-17. Read the current speed [MC_ReadActualVelocity]
Read the
MC_ReadActualVelocity current
speed
48
5-1-2-18. Read axis error status [MC_ReadAxisError]
49
5-1-2-19. Read axis bit parameter [MC_ReadBoolParameter]
50
5-1-2-20. Read the axis parameter [MC_ReadParameter]
51
5-1-2-21. Read axis command position [SMC_ReadSetPosition]
Read axis
SMC_ReadSetPosition command
position
52
5-1-2-22. Read function block error [SMC_ReadFBError]
Read function
SMC_ReadFBError
block error
53
5-1-2-23. Set the axis bit parameter [MC_WriteBoolParameter]
54
5-1-2-24. Set axis parameter [MC_WriteParameter]
55
5-1-2-25. Clear the error [SMC_ClearFBError]
Clear the
SMC_ClearFBError
error
Read the
SM3_Error.SMC_ErrorString error
information
56
5-1-3. Single axis function application
Example 1: realize that axis 0 moves in two sections to reach the designated position 0 Pluse, the first section runs
at a speed of 10 pluse/s and an acceleration of 100 pluse/s2 for relative motion, and then runs 100 pluse relative to
the starting position. After reaching the relative position of the target, it runs absolute motion at a speed of 15
pluse/s and an acceleration of 100 pluse/s2 for absolute motion, and moves to the target position as 0 pluse. During
the movement, the real-time position can be read, and the movement can be stopped. If an error is reported, the
axis can also be reset.
57
5-2. Axis group function
58
5-2-2. Axis group instruction introduction
59
5-2-2-2. Remove axis from the axis group [MC_RemoveAxisFromGroup]
Remove axis
MC_RemoveAxisFromGroup from the axis
group
60
5-2-2-3. Release axis group [MC_UngroupAllAxes]
Release
MC_UngroupAllAxes the axis
group
61
5-2-2-4. Enable the axis group [MC_GroupEnable]
Enable the
MC_GroupEnable
axis group
62
5-2-2-5. Disable the axis group [MC_GroupDisable]
Disable the
MC_GroupEnable
axis group
63
5-2-2-6. Reset the axis group [MC_GroupReset]
Reset the
MC_GroupReset
axis group
64
5-2-2-7. Set axis group instruction position [MC_GroupSetPosition]
65
5-2-2-8. Coordinate system conversion [MC_SetCoordinateTransform]
Coordinate
MC_SetCoordinateTransform system
conversion
66
5-2-2-9. Dynamic coordinate system conversion [MC_SetDynCoordTransform]
Dynamic
MC_SetDynCoordTransform coordinate system
conversion
67
5-2-2-10. Axis group continue to run [MC_GroupContinue]
Axis group
MC_GroupContinue
continue to run
68
5-2-2-11. Axis group pause [MC_GroupHalt]
Axis group
MC_GroupHalt
pause
69
interrupted TRUE
Motion TRUE when the module
CommandAccepted BOOL TRUE/FALSE FALSE
accepted successfully calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
TRUE when the motion is
MovementId Motion flag SMC_Movement_Id TRUE/FALSE FALSE
executing or completed
Axis group
MC_GroupInterrupt
interrupt
70
5-2-2-13. Axis group stop [MC_GroupStop]
Axis group
MC_GroupStop
stop
71
interrupted TRUE
Motion TRUE when the module
CommandAccepted BOOL TRUE/FALSE FALSE
accepted successfully calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
TRUE when the motion is
MovementId Motion flag SMC_Movement_Id TRUE/FALSE FALSE
executing or completed
72
velocity factor, and the value is between
[0, 1]
Combined acceleration factor, the
Combined maximum combined acceleration of the
PathAccFactor acceleration LREAL 0-1 1 whole axis group motion track
factor multiplied by this combined acceleration
factor, and the value is between [0, 1]
Combined jerk factor, the maximum
combined jerk of the whole axis group
Combined jerk
PathJerkFactor LREAL 0-1 1 motion track multiplied by this
factor
combined jerk factor, and the value is
between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Overshoot factor setting completed is
Enabled Setting completed BOOL TRUE/FALSE FALSE
TRUE
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Kinematic
MC_SetKinTransform coordinate
transformation
73
value
VAR_OUTPU Initial
Name Data type Efficient range Description
T value
TRUE when instruction
Done Completed BOOL TRUE/FALSE FALSE
execution is completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Absolute
MC_MoveCircularAbsolute circular
interpolation
74
Specify the method of arc
interpolation:
SMC_CIRC_ Border/Center/
CircMode Arc mode - Border: three-point arc
MODE Radius
Center: Center arc
Radius: radius arc
Auxiliary SMC_POS_ Specify an auxiliary point in the
AuxPoint - -
point REF coordinate system. Refer to CircMode
SMC_POS_ Specify the end position in the
EndPoint End point - -
REF coordinate system
Motion direction:
CLOCKWISE/
MC_CIRC_ CLOCKWISE: closewise
PathChoice Direction COUNTER_ -
PATHCHOICE COUNTER_CLOCKWISE:
CLOCKWISE
counterclockwise
Maximum combined speed [command
Velocity Speed LREAL 0, positive value 0
unit/s]
Deceleration positive value Max combined deceleration speed
Deceleration LREAL 0
speed [command unit/s2]
positive value Max combined jerk speed [command
Jerk Jerk speed LREAL 0
unit/s3]
Initial
VAR_INPUT Name Data type Efficient range Description
value
Reference
SMC_COORD_ SMC_COORD_
CoordSystem coordinate - Reference coordinate system
SYSTEM SYSTEM
system
MC_BUFFER_ Specifies the action when multiple
BufferMode Buffer mode - 0
MODE motion commands are started.
TMNone: no mixing
Corner TMNone/
MC_TRANSITIO TMStartVelocity: mix based on speed
TransitionMode transition TMStartVelocity/ -
N_MODE TMCornerDistance: mix based on
mode TMCornerDistance
distance
array
Corner [0..(SMC_RCNS
TransitionParameter transition T.MAX_TRANS 0, positive value 0 Corner transition parameters
parameters _PARAMS - 1)]
OF LREAL
GreatCircle: Move from the start
position to the target position along the
shortest path. In this mode, even if the
start position and the end position are
Interpolation within the specified area, the realized
SMC_ORIEN GreatCircle/
OrientationMode positioning - path may leave the area
TATION_MODE Axis
mode Axis: The positioning axis moves
within the specified area from the start
position to the end position. Not all
kinematic transformations support this
mode
75
Speed factor, the maximum speed of
VelFactor Speed factor LREAL 0-1 1 each axis multiplied by this speed
factor, and the value is between [0, 1]
Acceleration factor, the maximum
Acceleration speed of each axis multiplied by this
AccFactor LREAL 0-1 1
factor acceleration factor, and the value is
between [0, 1]
Jerk factor, the maximum speed of
JerkFactor Jerk factor LREAL 0-1 1 each axis multiplied by this jerk factor,
and the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Instruction
CommandAborted BOOL TRUE/FALSE FALSE Module execution interrupted is TRUE
interrupted
Motion TRUE when the module successfully
CommandAccepted BOOL TRUE/FALSE FALSE
accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
SMC_Movement Valid when CommandAccepted or
MovementId Motion flag TRUE/FALSE FALSE
_Id Done is TRUE
76
5-2-2-17. Relative circular interpolation [MC_MoveCircularRelative]
Relative circular
MC_MoveCircularRelative
interpolation
77
Max combined speed [command
Velocity Speed LREAL 0, positive value 0
unit/s]
Deceleration Max combined deceleration speed
Deceleration LREAL positive value 0
speed [command unit/s2]
Max combined jerk speed [command
Jerk Jerk speed LREAL positive value 0
unit/s3]
Reference
SMC_COORD SMC_COORD_
CoordSystem coordinate - Reference coordinate system
_SYSTEM SYSTEM
system
Initial
VAR_INPUT Name Data type Efficient range Description
value
MC_BUFFER Specifies the action when multiple
BufferMode Buffer mode - 0
_MODE motion commands are started
TMNone: no mixing
Corner TMNone/ TMStartVelocity: mix based on
MC_TRANSITIO
TransitionMode transition TMStartVelocity/ - speed
N_MODE
mode TMCornerDistance TMCornerDistance: mix based on
distance
Array
Corner [0..(SMC_RCNS
TransitionParameter transition T.MAX_TRANS_ 0, positive value 0 Corner transition parameters
parameters PARAMS - 1)]
OF LREAL
GreatCircle: Move from the start
position to the target position along
the shortest path. In this mode, even
if the start position and the end
Interpolation position are within the specified area,
SMC_ORIEN GreatCircle/
OrientationMode positioning - the realized path may leave the area
TATION_MODE Axis
mode Axis: The positioning axis moves
within the specified area from the
start position to the end position. Not
all kinematic transformations support
this mode
Speed factor, the maximum speed of
VelFactor Speed factor LREAL 0-1 1 each axis multiplied by this speed
factor, and the value is between [0, 1]
Acceleration factor, the maximum
Acceleration speed of each axis multiplied by this
AccFactor LREAL 0-1 1
factor acceleration factor, and the value is
between [0, 1]
Jerk factor, the maximum speed of
JerkFactor Jerk factor LREAL 0-1 1 each axis multiplied by this jerk
factor, and the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
78
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Instruction Module execution interrupted is
CommandAborted BOOL TRUE/FALSE FALSE
interrupted TRUE
Motion TRUE when the module successfully
CommandAccepted BOOL TRUE/FALSE FALSE
accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
SMC_Movement Valid when CommandAccepted or
MovementId Motion flag TRUE/FALSE FALSE
_Id Done is TRUE
Absolute position
MC_MoveDirectAbsolute
fast positioning
79
mode T_TYPE priority
Path_Invariant: PTP motion with
fixed path
Reference
SMC_COORD_SYSTE SMC_COORD_
CoordSystem coordinate Reference coordinate system
M SYSTEM
system
Specifies the action when multiple
BufferMode Buffer mode MC_BUFFER_MODE - 0
motion commands are started
TMNone: no mixing
TMNone/
Corner TMStartVelocity: mix based on
MC_TRANSITION TMStartVelocit
TransitionMode transition - speed
_MODE y/TMCornerDis
mode TMCornerDistance: mix based on
tance
distance
Array
Corner
Transition [0..(SMC_RCNST.MAX
transition 0, positive value 0 Corner transition parameters
Parameter _TRANS_PARAMS -
parameters
1)] OF LREAL
Speed factor, the maximum speed of
VelFactor Speed factor LREAL 0-1 1 each axis multiplied by this speed
factor, and the value is between [0, 1]
Initial
VAR_INPUT Name Data type Efficient range Description
value
Acceleration factor, the maximum
Acceleration speed of each axis multiplied by this
AccFactor LREAL 0-1 1
factor acceleration factor, and the value is
between [0, 1]
Jerk factor, the maximum speed of
JerkFactor Jerk factor LREAL 0-1 1 each axis multiplied by this jerk
factor, and the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Instruction Module execution interrupted is
CommandAborted BOOL TRUE/FALSE FALSE
interrupted TRUE
Motion TRUE when the module successfully
CommandAccepted BOOL TRUE/FALSE FALSE
accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
TRUE when the motion is executing
MovementId Motion flag SMC_Movement_Id TRUE/FALSE FALSE
or completed
80
5-2-2-19. Relative position fast positioning [MC_MoveDirectRelative]
81
MS - 1)] OF
LREAL
Speed factor, the maximum speed of
VelFactor Speed factor LREAL 0-1 1 each axis multiplied by this speed factor,
and the value is between [0, 1]
Acceleration factor, the maximum speed
Acceleration of each axis multiplied by this
AccFactor LREAL 0-1 1
speed factor acceleration factor, and the value is
between [0, 1]
Initial
VAR_INPUT Name Data type Efficient range Description
value
Jerk factor, the maximum speed of each
Jerk speed
JerkFactor LREAL 0-1 1 axis multiplied by this jerk factor, and
factor
the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Command Instruction
BOOL TRUE/FALSE FALSE Module execution interrupted is TRUE
Aborted interrupted
Command Motion TRUE when the module successfully
BOOL TRUE/FALSE FALSE
Accepted accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
TRUE when the motion is executing or
MovementId Motion flag SMC_Movement_Id TRUE/FALSE FALSE
completed
82
5-2-2-20. Absolute position linear interpolation [MC_MoveLinearAbsolute]
Absolute
position
MC_MoveLinearAbsolute
linear
interpolation
83
mode ornerDistance TMCornerDistance: mix based on
distance
Array
Corner [0..(SMC_RCNS
TransitionParameter transition T.MAX_TRANS 0, positive value 0 Corner transition parameter
parameter _PARAMS - 1)]
OF LREAL
Initial
VAR_INPUT Name Data type Efficient range Description
value
GreatCircle: Move from the start position
to the target position along the shortest
path. In this mode, even if the start
position and the end position are within
Interpolation
SMC_ORIENTA GreatCircle/ the specified area, the realized path may
OrientationMode positioning -
TION_MODE Axis leave the area
mode
Axis: The positioning axis moves within
the specified area from the start position
to the end position. Not all kinematic
transformations support this mode
Speed factor, the maximum speed of each
VelFactor Speed factor LREAL 0-1 1 axis multiplied by this speed factor, and
the value is between [0, 1]
Acceleration factor, the maximum speed
Acceleration of each axis multiplied by this
AccFactor LREAL 0-1 1
factor acceleration factor, and the value is
between [0, 1]
Jerk factor: the maximum speed of each
JerkFactor Jerk factor LREAL 0-1 1 axis is multiplied by this jerk factor, and
the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block execution
Busy In execution BOOL TRUE/FALSE FALSE
has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Command
CommandAborted BOOL TRUE/FALSE FALSE Module execution interrupted is true
interrupted
Motion TRUE when the module successfully
CommandAccepted BOOL TRUE/FALSE FALSE
accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
SMC_Movement TRUE when the motion is executing or
MovementId Motion flag TRUE/FALSE FALSE
_Id completed
84
5-2-2-21. Relative position linear interpolation [MC_MoveLinearRelative]
Relative position
MC_MoveLinearRelative
linear interpolation
85
Initial
VAR_IN_OUT Name Data type Efficient range Description
value
TMNone/TMS TMNone: no mixing
Corner
MC_TRANSITION_ tartVelocity/T TMStartVelocity: mix based on speed
TransitionMode transition -
MODE MCornerDista TMCornerDistance: mix based on
mode
nce distance
Initial
VAR_INPUT Name Data type Efficient range Description
value
Array
Corner [0..(SMC_RCNST.M
0, positive
TransitionParameter transition AX_TRANS_PARA 0 Corner transition parameter
value
parameter MS - 1)] OF
LREAL
GreatCircle: Move from the start
position to the target position along the
shortest path. In this mode, even if the
start position and the end position are
Interpolation within the specified area, the realized
SMC_ORIENTATIO GreatCircle
OrientationMode positioning - path may leave the area
N_MODE /Axis
mode Axis: The positioning axis moves
within the specified area from the start
position to the end position. Not all
kinematic transformations support this
mode
Speed factor, the maximum speed of
VelFactor Speed factor LREAL 0-1 1 each axis multiplied by this speed
factor, and the value is between [0, 1]
Acceleration factor, the maximum
Acceleration speed of each axis multiplied by this
AccFactor LREAL 0-1 1
factor acceleration factor, and the value is
between [0, 1]
Jerk factor: the maximum speed of
JerkFactor Jerk factor LREAL 0-1 1 each axis is multiplied by this jerk
factor, and the value is between [0, 1]
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
TRUE when instruction execution is
Done Completed BOOL TRUE/FALSE FALSE
completed
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Active In control BOOL TRUE/FALSE FALSE Becomes TRUE in control
Command
CommandAborted BOOL TRUE/FALSE FALSE Module execution interrupted is true
interrupted
CommandAccepted Motion BOOL TRUE/FALSE FALSE TRUE when the module successfully
86
accepted calls the axis group
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
TRUE when the motion is executing or
MovementId Motion flag SMC_Movement_Id TRUE/FALSE FALSE
completed
Read axis
group
MC_GroupReadActualPosition
feedback
position
87
Initial
VAR_IN_OUT Name Data type Efficient range Description
value
a Cartesian coordinate system
(i.e. not set in case of ACS)
Read axis
group
MC_GroupReadActualVelocity
feedback
speed
88
5-2-2-24. Read axis group configuration parameters [MC_GroupReadConfiguration]
Read axis
group
MC_GroupReadConfiguration
configuration
parameters
89
5-2-2-25. Read axis group error [MC_GroupReadError]
Read axis
MC_GroupReadError
group error
90
5-2-2-26. Read the axis group current motion status [MC_GroupReadStatus]
91
dynamic system is currently used
coordinate
system
In continuous interpolation
motion, it is true when the
On path or acquired position belongs to the
InSync already in BOOL TRUE/FALSE FALSE specified path. True when the
place current position is equal to the
target position in ordinary point
position and interpolation motion
Motion 0, positive Identifier of the active move. ID
ActiveMovementId SMC_Movement_Id -
segment no. value is 0 indicates no active movement
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
Identifier of the last accepted
LastAcceptedMovem Motion 0, positive
SMC_Movement_Id 0 motion. ID is 0 indicates that no
entId segment no. value
action has been accepted
92
5-2-2-28. Axis group enable [SMC_GroupPower]
Enable
SMC_GroupPower
axis group
93
5-2-2-29. Interrupt the axis group [SMC_GroupInterruptAt]
Interrupt the
SMC_GroupInterruptAt
axis group
94
5-2-2-30. Restart after error reset [SMC_GroupEnableResumeAfterError]
Restart
SMC_GroupEnableResume
after error
AfterError
reset
95
5-2-2-31. Axis group jogging [SMC_GroupJog]
Axis group
SMC_GroupJog
jogging
96
if it is not used
The Z axis in the coordinate system, set to 0
AxisZ Axis Z IAxisRef - 0
if it is not used
Control the A coordinate (rotation around
AxisA Axis A IAxisRef - 0 the Z axis) or the first tool axis. Set to 0 if
not applicable
Initial
VAR_INPUT Name Data type Efficient range Description
value
Control the B coordinate (rotation around
AxisB Axis B IAxisRef - 0 the Y axis) or the second tool axis. Set to 0
if not applicable
Control the C coordinate (rotation around
AxisC Axis C IAxisRef - 0 the Z axis) or the third tool axis. Set to 0 if
not applicable
If TRUE, the positions of AxisA, AxisB and
AxisC will be interpreted as the target
position of the tool kinematic axis,
otherwise as the ZYZ representation of the
Start
direction.
ABC_as_ACS coordinate BOOL TRUE/FALSE FALSE
If CoordSystem is set to ACS, it will be
conversion
ignored. If TRUE, the kinematic
transformation of the axis group must be
Kin_ Coupled type and support
SMC_ORIENTATION_ MODE. Axis
Initial
VAR_OUTPUT Name Data type Efficient range Description
value
In TRUE when the function block execution
Busy BOOL TRUE/FALSE FALSE
execution has not ended
InitialPosition Received
BOOL TRUE/FALSE FALSE -
Reached position
Command
CommandAborted BOOL TRUE/FALSE FALSE Module execution interrupted is TRUE
interrupted
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error code
97
5-2-2-32. Axis group wait [SMC_GroupWait]
Axis group
SMC_GroupJog
waiting
98
5-2-3. Axis group function application
Example: This example introduces the motion control of a SCARA system that implements two nodes.
Program operation:
(1) click [Application] in the project bar, select [add object]—[AxisGroup], and name as AxisGroup and open it.
Select the SCARA kinematics model through the kinematics model interface.
(2) Configure kinematic parameters: the length of the big and small arms is set to 500, and the angle offset is all
zero. Axis parameter configuration, mapping axis position.
99
(3) According to the motion trajectory, compile the kinematics instructions and configure the motion
parameters.
100
5-3. CAM function
101
5-3-2. CAM instructions
Cam table
MC_CamTableSelect
assignment
102
Valid Select valid Cam_ID, used together with
CamTableID MC_CAM_ID - -
CAMID CamTableID in MC_CamIn
CAM action
MC_CamIn
start
103
Define the use of cam table, used
together with MC_Cam
CamTableID Cam table MC_CAM_ID - -
TableSelect output point
CamTableID
Negative
Maximum speed of superimposed
VelocityDiff Speed LREAL value, 0, 0
motion [u/s]
positive value
Negative
Acceleration Target acceleration LREAL value, 0, 0 Acceleration speed [u/s2]
positive value
Negative
Deceleration Target deceleration LREAL value, 0, 0 Deceleration speed [u/s2]
positive value
Negative
Jerk Target jerk speed LREAL value, 0, 0 Jerk speed [u/s3]
positive value
TappetHysteresis Lag size of tappet LREAL - - Lag size of tappet
104
5-3-2-3. Cam unbinding [MC_CamOut]
Release cam
MC_CamOut
action
105
5-3-2-4. CAM action start [MC_GearIn]
Target
Acceleration LREAL Positive value 0 Acceleration speed [u/s2]
acceleration
106
VAR_IN_OUT Name Data type Efficient range Initial Description
value
TRUE when the function block
Busy In execution BOOL TRUE/FALSE FALSE
execution has not ended
Position assignment
MC_GearInPos
gear action
107
Denominator of
RatioDenominator UDINT Positive value 1 Offset on the slave table
gear ratio
Main axis
Negative, 0, Main position of axis synchronous
MasterSyncPosition synchronization LREAL 0
positive operation
position
Slave axis
Negative, 0, Slave position of axis synchronous
SlaveSyncPosition synchronization LREAL 0
positive operation
position
Perform
Main distance of gears in the
synchronous Negative, 0,
MasterStartDistance LREAL 0 program (start the slave axis to
master axis positive
enter synchronization)
position
MC_BUFFER_
BufferMode Buffer mode - - -
MODE
Set to FALSE, reversed when the
physical position of the slave axis
is advanced. Set to TRUE if the
reverse operation of the slave axis
AvoidReversal Reverse inhibit BOOL TRUE/FALSE FALSE is physically impossible or
dangerous. Applicable only under
modal axis. If reversal cannot be
avoided, the axis will stop for the
error.
Name Data type Efficient range Initial Description
VAR_OUTPUT
value
Start TRUE if the electronic gear starts
StartSync BOOL TRUE/FALSE FALSE
synchronization processing
Arrival Electronic gear command
InSync BOOL TRUE/FALSE FALSE
synchronization completed
108
5-2-3-6. Release gear action [MC_GearOut]
Release gear
MC_GearOut
action
109
5-2-3-7. Master-slave axis phase offset [MC_Phasing]
Master-slave axis
MC_Phasing
phase offset
110
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
111
VAR_IN_OUT Name Data type Efficient range Initial Description
value
between the slave axis and the master axis
is disconnected
TRUE when the function block execution
bBusy In execution BOOL TRUE/FALSE FALSE
has not ended
bError Error BOOL TRUE/FALSE FALSE Function block execution error
nErrorID Error code SMC_ERROR - 0 Error identification
Calculate the maximum position of the
dMaxPos Max position LREAL - 0
slave axis according to the cam table
Calculate the minimum position of the slave
dMinPos Min position LREAL - 0
axis according to the cam table
Calculate the maximum speed of the slave
dMaxVel Max speed LREAL - 0
axis
Calculate the minimum speed of the slave
dMinVel Min speed LREAL - 0
axis
Max Calculate the maximum acceleration of the
dMaxAccDec LREAL - 0
acceleration slave axis
Min Calculate the minimum acceleration of the
dMinAccDec LREAL - 0
acceleration slave axis
CAM position
SMC_CAMBounds_Pos
range
112
value
Execute the current command at the rising
bExecute Valid BOOL TRUE/FALSE FALSE
edge of the signal
Maximum master axis speed in absolute
dMasterVelMax Max speed LREAL - 1
mode
Max Maximum master axis acceleration speed in
dMasterAccMax LREAL - 0
acceleration absolute mode
dMasterScaling Scale factor LREAL - 1 Scale factor in master axis cam application
dSlaveScaling Scale factor LREAL - 1 Scale factor in slave axis cam application
Name Data type Efficient range Initial Description
VAR_OUTPUT
value
TRUE if the electronic gear coupling
bDone Completed BOOL TRUE/FALSE FALSE between the slave axis and the master axis is
disconnected
TRUE when the function block execution
bBusy In execution BOOL TRUE/FALSE FALSE
has not ended
bError Error BOOL TRUE/FALSE FALSE Function block execution error
nErrorID Error code SMC_ERROR - 0 Error identification
Calculate the maximum position of the
dMaxPos Max position LREAL - 0
slave axis according to the cam table
Calculate the minimum position of the slave
dMinPos Min position LREAL - 0
axis according to the cam table
113
5-3-2-10. Show cam table in visualization [SMC_CamEditor]
114
5-3-2-11. CAM tappet control [SMC_CamRegister]
Cam tappet
SMC_CamRegister
control
115
VAR_IN_OUT Name Data type Efficient range Initial Description
value
Curve period TRUE if the master axis position is greater
EndOfProfile BOOL TRUE/FALSE FALSE
completed than or equal to the set cycle
Obtain
SMC_GetCamSlaveSet cam slave
Position axis
position
116
VAR_IN_OUT Name Data type Efficient range Initial Description
value
position table and current master axis information
Slave axis Slave axis speed obtained from cam table
fStartVelocity LREAL - 0
speed and current master axis information
Slave axis Slave axis acceleration obtained from cam
fStartAcceleration LREAL - 0
acceleration table and current master axis information
TRUE when the function block execution
Busy In execution BOOL TRUE/FALSE FALSE
has not ended
Error Error BOOL TRUE/FALSE FALSE Function block execution error
ErrorID Error code SMC_ERROR - 0 Error identification
Obtain tappet
SMC_GetTappetValue
output value
117
5-3-2-14. Read the cam table [SMC_ReadCAM]
Read the
SMC_ReadCAM
cam table
118
5-3-2-15. Change the cam table [SMC_WriteCAM]
Change the
SMC_WriteCAM
cam table
119
5-3-3. CAM function application
Example 1:
The electronic cam is used to realize the master axis running speed mode. The speed is 15 pulse/s, the acceleration
is 100 pulse/s2, and the direction is positive. The slave station operates according to cam table.
Program operation:
(1) right click [application] in the project bar, select the [add object]—[cam table], name as Cam and open.
Add the cam parameters as the following diagram.
(2) Add enable module MC_Power in the main program POU_1, master axis speed module
MC_MoveVelocity, calling cam module MC_CamTableSelect, configure cam module MC_CamIn,
unbinding cam module MC_CamOut.
120
Note:
If the slave axis is in motion during the execution of Camout, the slave axis will continue to run at the original
speed after the command is executed. It can stop through MC_ Stop, MC_ Halt command.
Example 2:
The master axis running speed mode is realized by using the electronic gear. The speed is 15 pulse/s, the
acceleration is 100 pulse/s2, and the direction is positive. The slave station moves according to the electronic gear
ratio of 2. Then the speed of the slave station is 30 pulse/s.
121
122
6. Q&A
When running or debugging PLC, users may encounter some difficult problems due to lack of experience. This
part mainly aims at the problems that users are most likely to encounter, and puts forward solutions for users'
reference.
Q1: When the user newly installs the Codesys software and opens it for compilation, there will be many reasons
for error reporting.
A1: Generally, it is caused by the missing library. Double click the library manager - click download missing
Libraries... And wait for the missing library to be downloaded.
Q3: Reasons for warning prompt after adding multiple EtherCAT slave stations?
A3:
Because the servo station number is repeated, it will not affect the use. If you want to clear the warning and
double blue underline, scan the servo again, and then modify the repeated station number.
Q4: The reason why the communication will be cut off once the EtherCAT axis is running?
A4:
The EtherCAT related POU must be placed under the EtherCAT task. It has a position synchronization cycle.
214072
Tel: 400-885-0136
www.xinje.com