Appendix C: SDK Packet Format

The SDK mode receives or sends data in multicast mode. One network segment and port are used for receiving, and another network segment and port are used for sending.

C++ packets are defined as follows.

The packet size is 40 bytes.

1. Signal type using 1 byte, indicating the type of the signal.

Value

Name

Description

0

digit input

Only two states, 0 or 1.

1

encoder

0 represents anticlockwise rotation of one space, and 1 represents a clockwise rotation of one space.

2

analog

The value range is generally from 0 to 4095 or from 0 to 65535.

3

digit output

Only two states, 0 or 1.

4

display

Segment display output.

5

servo

Servo motor signal output, control motor position.

6

pwm

Pulse width modulator signal output, the value range is 0 to 2500.

 

2. Signal id using 4 bytes, indicating the unique ID of the signal.

3. Data accounts using 35 bytes, used to store the signal content. Different signal data has different writing and reading methods.

In general, digit input, encoder and analog are sent to the Send multicast network by iFSim.Ready software. Digit output, display, servo and pwm are sent to Receive multicast network by third-party software. iFSim.Ready software monitors the multicast network and controls the hardware after receiving processing.

Digit input data packet

C++ packets are defined as follows.

Encoder data packet

C++ packets are defined as follows.

Analog data packet

C++ packets are defined as follows.

Digit output data packet

C++ packets are defined as follows.

Display data packet

C++ packets are defined as follows.

Servo data packet

C++ packets are defined as follows.

pwm data packet

C++ packets are defined as follows.

 

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.