Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 1. Brief introduction. _________________________________________________________________________- 4 - 2. USB and Ethernet data communication basis __________________________________________________- 4 - 3.Default settings ____________________________________________________________________________- 4 - 4. The structure of data transfer packets ________________________________________________________- 5 - 4.1. The purpose of the XOR_SUM field _______________________________________________________- 5 - 4.2.
SMSD-4.2LAN and SMSD-8.0LAN 1. Brief introduction. The controller SMSD-4.2LAN (further in the text - Controller) is intended for control of stepper motors and provides programming and control via USB or Ethernet. SMSD-4.2LAN is designed as a circuit plate with electronic components, indicators, control elements, terminal blocks and connectors installed on a heat sink plate.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4. The structure of data transfer packets The data transfer packet structure is the next: typedef struct uint8_t XOR_SUM; uint8_t VER; uint8_t CMD_TYPE; uint8_t CMD_IDENTIFICATION; uint16_t LENGTH_DATA; uint8_t DATA[LENGTH_DATA]; }LAN_COMMAND_Type; XOR_SUM – checksum – low-order byte off the amount of all bytes in the packet.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.3. The purpose of the CMD_IDENTIFICATION field 1 byte field. The field CMD_IDENTIFICATION is intended for unique identification of a response to a sent command. The User should provide unique values during data transfer process.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.1 Beginning of data transmission and data transmission command CODE_CMD_REQUEST The data transmission command CODE_CMD_REQUEST is used for authorizing purpose. The data transfer packet with CODE_CMD_REQUEST code is sent from the controller to the user as a response to a LAN connection event (only for LAN connection, not used for USB connection).
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN LENGTH_DATA (High byte) 0x00 DATA [0] - Low byte (COMMANDS_RETURN_DATA Low byte) DATA [1] DATA [2] = ERROR_OR_COMMAND DATA [3] DATA [4] DATA [5] DATA [6] - High byte (COMMANDS_RETURN_DATA High byte) In case of the correct password, the Controller allows the further access to the controller and...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.3 Data transmission command CODE_CMD_POWERSTEP01 The data transmission command CODE_CMD_POWERSTEP01 is used to control the stepper motor. Data field of the packet contains SMSD_CMD_Type structure. Please, learn detailed information about the stepper motor control commands and SMSD_CMD_Type structure below in this manual.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN quantity of the commands in a sequence – 255. The code distance in the address space is 4 bytes. Every command corresponds to SMSD_CMD_Type structure. From the User: Field Value Packet data order XOR (1 byte)
Page 11
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the User: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_POWERSTEP01_R_MEM0 = 0x07 or CODE_CMD_POWERSTEP01_R_MEM1 = 0x08 or CODE_CMD_POWERSTEP01_R_MEM2 = 0x09 or CODE_CMD_POWERSTEP01_R_MEM3 = 0x0A CMD_IDENTIFICATION (1 byte)
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 4.6.6 Data transmission command CODE_CMD_CONFIG_SET The data transmission commands CODE_CMD_CONFIG_SET is intended to change LAN connection parameters of the controller. The DATA field of the packet contains LAN parameters as a SMSD_LAN_CONFIG_Type structure. From the User:...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN LENGTH_DATA (High byte) DATA [0] (SMSD_LAN_CONFIG_Type – Low byte) ………………… …….. ……. DATA [24] (SMSD_LAN_CONFIG_Type – High byte) 4.6.8 Data transmission command CODE_CMD_ PASSWORD_SET The data transmission commands CODE_CMD_PASSWORD_SET is intended to change the authentication password.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the Controller: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_ERROR_GET = 0x0E CMD_IDENTIFICATION (1 byte) LENGTH_DATA (Low byte) 0x44 (=17*4) LENGTH_DATA (High byte) Data[0] ………………….. …………….
Page 16
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN typedef struct { uint32_t RESERVE uint32_t ACTION uint32_t COMMAND uint32_t DATA :22; }SMSD_CMD_Type; RESERVE – 3 bit field, not used; ACTION - 1 bit field – for internal use, send as 0; COMMAND - 6 bits field - the executing command code;...
Page 18
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN From the User: Field Value Packet data order XOR (1 byte) VER (1 byte) CMD_TYPE (1 byte) CODE_CMD_POWERSTEP01 = 0x02 CMD_IDENTIFICATION (1 byte) LENGTH_DATA (Low byte) 0x04 sizeof(SMSD_CMD_Type)=0x04 LENGTH_DATA (High byte) 0x00 DATA [0] (SMSD_CMD_Type Low byte)
Page 19
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.3 Executing command CMD_PowerSTEP01_STATUS_IN_EVENT The executing command CMD_PowerSTEP01_STATUS_IN_EVENT = 0x02 is intended for reading information about current signals inputs state. Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code...
Page 20
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN MOTOR_TYPE – motor type for the voltage control mode: Value Max. current Resistance Inductance per phase, per phase, per phase, Step angle Motor model SMSD-4.2LAN SMSD-8.0LAN No motor 1.33 1.33 1.68 1.65 1.68 1.64 1.68...
Page 21
7 - Microstepping: 1/128 WORK_CURRENT – operating current for the current control mode. The motor operation current is calculated as 0.1Amp*Value; 1<=Value<=80. Available range for controllers SMSD-4.2LAN: 1 – 42; for controllers SMSD-8.0LAN: 1 – 80. The values are the next: 1 - 0.1A...
Page 22
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN STOP_CURRENT – holding current – as a percentage of an operating current: 0 - 25% 1 - 50% 2 - 75% 3 - 100% As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK. 6.7 Executing command CMD_PowerSTEP01_SET_MAX_SPEED The executing command CMD_PowerSTEP01_SET_MAX_SPEED = 0x06 is intended for setting the motor maximum speed.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.10 Executing command CMD_PowerSTEP01_SET_FS_SPEED The executing command CMD_PowerSTEP01_SET_FS_SPEED = 0x09 is intended for setting the running speed, when the motor switches to a full step mode. The DATA field should contain the speed value in range 15 –...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte [3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = 0x00 CMD_PowerSTEP01_ Action Reserve GET_ABS_POS = 0x0B Bit value As a response the Controller sends a data transmission packet with CMD_TYPE =...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.15 Executing command CMD_PowerSTEP01_RUN_F The executing command CMD_PowerSTEP01_RUN_F = 0x0E is intended to start motor rotation in forward direction at designated speed. The DATA field should contain the final rotation speed value in range 15 – 15600 steps/sec.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK. 6.18 Executing command CMD_PowerSTEP01_MOVE_R The executing command CMD_PowerSTEP01_MOVE_R = 0x11 is intended for motor displacement in backward direction.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Desired position CMD_PowerSTEP01_ Action Reserve GO_TO_R = 0x13 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Motion Speed CMD_PowerSTEP01_ Action Reserve SCAN_ZERO_F = 0x16 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Motion Speed CMD_PowerSTEP01_ Action Reserve SCAN_LABEL_R = 0x19 Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = specified position CMD_PowerSTEP01_GO_TO = Action Reserve 0x1C Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_ Action Reserve SOFT_STOP = 0x1F Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_HARD_HI_Z Action Reserve = 0x22 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.38 Executing command CMD_PowerSTEP01_CLR_RELE The executing command CMD_PowerSTEP01_CLR_RELE = 0x25 is intended to turn off the controller relay. Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_WAIT_IN1= Action Reserve 0x28 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Page 36
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation Data = Command and Program numbers CMD_PowerSTEP01_ Action Reserve GOTO_PROGRAM_IF_IN0 = 0x2A Bit value Depend on Data value The Data field bit mapping: Byte[3] bits 7..0...
Page 37
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN The DATA field contains the information about commands number and cycles number: bits 0..9 of the DATA field contain the commands number, bits 10..19 of the DATA field contain the cycles number. Bit mapping of the SMSD_CMD_Type structure:...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN 6.47 Executing command CMD_PowerSTEP01_RETURN_PROGRAM The executing command CMD_PowerSTEP01_RETURN_PROGRAM = 0x2E is used to specify the end of a subprogram and to return back to the main program. If previously the command CMD_PowerSTEP01_CALL_PROGRAM was not called, the executing of CMD_PowerSTEP01_RETURN_PROGRAM will call an error.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code Designation CMD_PowerSTEP01_ Action Reserve STOP_PROGRAM_MEM = 0x33 Bit value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = COMMAND_GET_MIN_SPEED, RETURN_DATA – the value of the current set minimum motor speed.
Page 41
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN The RETURN_DATA field bit mapping: Byte[3] bits 7..0 Byte[2] bits 7..0 Byte[1] bits 7..2 Data bit 21 20 19 18 17 16 15 Program Number Command number 6.55 Executing command CMD_PowerSTEP01_GOTO_PROGRAM_IF_ZERO The executing command CMD_PowerSTEP01_GOTO_PROGRAM_IF_ZERO = 0x39 is intended for conditional branching –...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Data field DATA[3]=0x00 DATA[2]=0x00 DATA[1]=0x00 DATA[0]=0x10 byte Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code CMD_PowerSTEP01_GOTO Designation Data = Command and Program numbers Action Reserve _PROGRAM _IF_IN_ZERO...
Data communication protocol SMSD-4.2LAN and SMSD-8.0LAN Bit mapping of the SMSD_CMD_Type structure: Byte[3] Byte[2] Byte[1] Byte[0] Bit № 7..2 Command code CMD_PowerSTEP01_SET_ WAIT_2 Designation Data = Waiting time Action Reserve = 0x3C Bit value Depend on Data value As a response the Controller sends a data transmission packet with CMD_TYPE = CODE_CMD_RESPONSE, the DATA field of the packet contains COMMANDS_RETURN_DATA_Type: ERROR_OR_COMMAND = OK.
The byte 0xFE inside the packet should be replaced by the pair 0xFE 0x7E. 9. Manufacturer information Smart Motor Devices adheres to the line of continuous development and reserves the right to make changes and improvements in the design and software of the product without prior notice.
Need help?
Do you have a question about the SMSD-4.2LAN and is the answer not in the manual?
Questions and answers