SimpleMotion V2 subpacket types

From Granite Devices Knowledge Wiki
Jump to: navigation, search

Outbound subpacket types[edit | edit source]

All actions (commands) to target devices are done by atomic operations defined by outbound subpackets. Subpackets are trasnferred to drive with instant commands or buffered commands. Possible outbould subpacket types and their parameters are following:

SM_SET_WRITE_ADDRESS
Parameter sets the SMP parameter address that will be accessed in the subsequenty read/write commands. Consumes 2 bytes from payload.
SM_WRITE_VALUE_24B
Parameter writes value to parameter address defined earlier by SM_SET_WRITE_ADDRESS, parameter value lenght is 22 bits (bits above 22 are set zero). Consumes 3 bytes from payload buffer.
SM_WRITE_VALUE_30B
Parameter writes value to parameter address defined earlier by SM_SET_WRITE_ADDRESS, parameter value lenght is 30 bits (bits above 30 are set zero). Consumes 4 bytes from payload buffer.

Inbound subpacket types[edit | edit source]

Each data reception from target devie will be formed of following subpackets. The type and address whic subpackets are being returned are defined by parameters SMP_RETURN_PARAM_ADDR and SMP_RETURN_PARAM_LEN. Possible inbound subpackets and their respective return data contents:

SM_RETURN_STATUS 3
Holds a execution status report of executed subpacket. For possible return values of this, see list below. Consumes one byte from inbound payload buffer.
SM_RETURN_VALUE_16B 2
Return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR. Consumes 2 byte from payload buffer and can contain value up to 14 bits. Value greater than 14 bits is clipped (padded with 0s).
SM_RETURN_VALUE_24B 1
Return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR. Consumes 3 byte from payload buffer and can contain value up to 22 bits. Value greater than 14 bits is clipped (padded with 0s).
SM_RETURN_VALUE_32B 0
Return value contains a read value from address defined by SMP_RETURN_PARAM_ADDR. Consumes 4 byte from payload buffer and can contain value up to 30 bits. Value greater than 30 bits is clipped (padded with 0s).

Possible SM_RETURN_STATUS values[edit | edit source]

SMP_CMD_STATUS_ACK 0
Subpacket executed with success
SMP_CMD_STATUS_NACK 1
Subpacket was not executed with success
SMP_CMD_STATUS_INVALID_ADDR 2
Subpacket was not executed because target SMP address is unkown
SMP_CMD_STATUS_INVALID_VALUE 4
Subpacket was not executed because value for given parameter is invalid
SMP_CMD_STATUS_VALUE_TOO_HIGH 8
Subpacket was not executed because value for given parameter is invalid (value was too high)
SMP_CMD_STATUS_VALUE_TOO_LOW 16
Subpacket was not executed because value for given parameter is invalid (value was too low)


Usage examples[edit | edit source]

  • if one wants to read values of parameters, set SMP_RETURN_PARAM_LEN as 2,3 or 4 and set SMP_RETURN_PARAM_ADDR to the parameter address to be read. Lengths 2,3 and 4 will return SM_RETURN_VALUE_16B, 24B and 32B respectively.
  • if one wants just status report from each executed subpacket to check correctness of communication, or to save payload amount, set SMP_RETURN_PARAM_LEN to 1 which will then return SM_RETURN_STATUS for each outbound subpacket.

In no event the Product Information or parts hereof shall be regarded as guarantee of conditions or characteristics. The Product Information or any part thereof may also not be regarded as a warranty of any kind. No liability of any kind shall be assumed by Author with respect to Product Information or any use made by you thereof, nor shall Author indemnify you against or be liable for any third party claims with respect to such information or any use thereof.

As content of this Wiki may be edited by user community, Granite Devices Oy or it's affiliates do not take any responsibility of the contents of this Wiki. Use information at your own risk. However, Granite Devices staff attempts to review all changes made to this Wiki and keep information trustworthy.

Without written consent, Granite Devices' Products or Intellectual Property shall not be used in situations or installations where living beings, material property, or immaterial property could be harmed by the operation, features or failures of Product. Products may only be used in a way where hazards like moving parts, electric shock, laser radiation, or fire can't be realized even if the content of this Wiki would suggest otherwise.