Remote control interface protocol v2


  1. Overview
  2. Axis bitmask
  3. Remote control configuration
  4. State control
  5. Simulation control
  6. Settings control
  7. Profile control
  8. Input control
  9. Reading data
  10. Reading/Writing IO2CAN Gateway data
  11. Setting IO2CAN Gateway output communication timeout
  12. Override control



To understand the protocol and be able to avoid pitfalls, please read "General information" before attempting to build packets.
Go to top

Overview

The Remote control protocol v2 has been introduced to cope with the increasing amount of controllable axes in CLS2Sim. It allows issuing commands for multiple or single axes by using a bit field. Additional commands for controlling the state of the control loading system have been implemented. This allows the initialization, stop, or fault reset of any axis over the remote control interface. If you are using profiles, the active profile can no be selected by name over the remote interface.

All settings written by the remote interface will NOT be displayed in the Profile manager.
Only state changes and selecting a profile triggers a visible change.
Clicking on "Ok" or "Apply" in the profile manager will override all settings done over the remote interface.


The size of response packets can vary.


Addresses for writing are not allowed to be read and will always return 0 when reading.


In a dual-seat set-up, all Settings and Data except reading force information (Data ID 0x20/0x21 Applied Force) and button presses (Data ID 0x30 Button presses) is synchronized. Therefore it is only exposed as a single value regardless if the hardware set-up is single- or dual-seat.

Go to top

Axis Bitmask

The Axis Bitmask allows the selection of axes to execute commands for. Axis Values can be ORed to control multiple axes simultaneously. The device ids are the CAN node ids of the drives. They are used in the response of the GetStatus command and identify the status packets.
When working with a command, that responds with device ids, please note:The size of response packets can vary.



When sending the GetStatus request, the response will contain ALL requested devices, including not connected ones.
Example: Requesting Elevator, Aileron and Rudder Status will always return the packet body six times, once for pilot and once for copilot, even if the setup is only one yoke.
Even if there are no second yoke and no rudder pedals connected, the selected ids will be returned. The not existing ones will have the status 0x00 (Not connected) and a temperature of 0.


When sending the GetError request, only connected devices respond. Devices with no errors will send no data and devices with multiple errors will send a packet body for each error.


NameAddressDevice IDs (Pilot, Copilot)
Elevator 0x1 2, 4
Aileron 0x2 1, 3
Rudder 0x4 5, 6
Collective 0x8 7, 8
Brakes left 0x10 101, 103
Brakes right 0x20 102, 104
TrimElevator 0x40 105, 106
TrimAileron 0x80 107, 108
TrimRudder 0x100 109, 110
Throttle1 0x200 111
Throttle2 0x400 112
Throttle3 0x800 113
Throttle4 0x1000 114
SpeedBrake 0x2000 115
NoseWheel 0x4000 116, 117



Go to top

Remote control configuration

Remote control settings


Setting name Setting id Value type ( Range ) Description
Communication timeout watchdog 0x00 Uint16 ( 0..65535 )
Time in milliseconds
Setting the value 0 deactivates the watchdog behind this setting.
Setting any other value, activates a watchdog, which waits X milliseconds, with X being the set value.
The watchdog is activated and also reset, by sending this command. After activating this setting with a value other than 0,
the thirt-party application connected via remote interface has to constantly resend this command, to reset the watchdog timer again.
The passed value determines each time, how long the watchdog will wait for the next reset command.
If the third-party application does fail to send the command in time, the watchdog is triggered and it will stop all drives connected to CLS2Sim. Also If a timeout has been set for any IO2Can device, that device will have its outputs pulled low.
Setting 0 also deletes all configured IOdevice timeouts, so those will have to be set again.


Request for remote control config commands


Command
Type: UInt32
Setting id
Type: UInt32
Setting value
Type: See remote control settings table
0xD8 : RemoteControlConfig 0x00 : Communication timeout watchdog set time & reset See remote control settings table

Response for remote control config commands


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command
0x04 : BadLength 1 byte actual length, 1 byte required length



Go to top

State control

State machine


The remote interface exposes 3 commands for controlling the state of the hardware.
  • The Init command triggers drive calibration and initialization.
    After initialization the drive is ready for use.
  • The Stop command shuts the drive down.
    It removes all power from motors, but does not brake actively.
  • The FaultReset command brings a drive out of fault mode into stop mode.
Additionally there are 2 commands for information retrieval.
  • The GetStatus command returns state and temperature information.
  • The GetErrors command returns error information.

Request for state commands


Command
Type: UInt32
Axis
Type: UInt32
State command
Type: UInt32
0xCD : State control 0x00000001 : Elevator
0x00000002 : Aileron
0x00000004 : Rudder
0x00000008 : Collective
0x00000010 : Brake left
0x00000020 : Brake right
0x00000040 : Elevator Trim Wheel
0x00000080 : Aileron Trim Wheel
0x00000100 : Rudder Trim Wheel
0x00000200 : Throttle 1
0x00000400 : Throttle 2
0x00000800 : Throttle 3
0x00001000 : Throttle 4
0x00002000 : Speedbrake
0x00004000 : Nosewheel
0x00 : Get status
0x01 : Initialize
0x02 : Stop
0x03 : Fault reset
0x04 : Get errors

Response for GetStatus command


Repeated for each device id
Packetlength
Type: UInt16
Status
Type: UInt8
Device id
Type: UInt16
Device state
Type: UInt16
Device temperature
Type: UInt16
Length of the
rest of the packet
0x00 : Success See Axis Bitmask 0x00 : Not connected
0x01 : Operational
0x02 : Not initialized
0x03 : Error in drive
Degrees Celsius

Response for Init, Stop and Faultreset commands ( and GetStatus command in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command
0x04 : BadLength 1 byte actual length, 1 byte required length

Response for GetErrors command ( in case of success )


Repeated for each error in devices specified in the axis bitmask, that are also connected.
Packetlength
Type: UInt16
Status
Type: UInt8
Device id
Type: UInt16
Errorcode
Type: UInt16
Timestamp
Type: UInt32
Length of the
rest of the packet
0x00 : Success See Axis bitmask 0x1000 : General Error
0x1001 : Emergency Stop
0x2311 : Error Continuous Over Current
0x2320 : Error Over Current
0x3210 : Error Overvoltage DC Link
0x3220 : Error Undervoltage DC Link
0x4210 : Error Overtemperature Motor
0x4310 : Error Overtemperature Drive
0x5113 : Error Undervoltage internal 5V Supply
0x5114 : Error Feedback
0x5115 : Error Overspeed
0x8611 : Error Following Window
0x8620 : Error Negative Limit Switch
0x8621 : Error Positive Limit Switch
0x8622 : Error Soft Limit Switch
0xFF01 : Error Force Sensor
0xFF02 : Error Sync IP Mode
0xFF03 : Error Safety IN1
Unix UTC Timestamp
Seconds since
01.01.1970 00:00:00

Response for GetErrors command ( in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command
0x04 : BadLength 1 byte actual length, 1 byte required length



Go to top

Simulation control

Sim IDs


Sim name Sim id
X-Plane 0x00
Microsoft Flight Simulator X 0x01
Prepar3D 0x02
USB Emulation Mode 0x03


GetSimStatus Request


Command
Type: Int32
Sim Control Command
Type: Int32
0xD3 : Simulation control 0x00 : GetSimStatus


Response for GetSimStatus command (in case of succes)


Packetlength
Type: UInt16
Status
Type: UInt8
Selected Simulation (Sim ID)
Type: UInt8
Is Sim Connected
Type: UInt8
Simulation Update Rate
Type: UInt16
Length of the
rest of the packet
0x00 : Success 0x00 : X-Plane
0x01 : MSFX
0x02 : Prepar3D
0x03 : USB Emulation
0x00 : Disconnected
0x01 : Connected
Updates per second
Undefined if not connected!


SelectSim Request


Command
Type: Int32
Sim Control Command
Type: Int32
Sim ID
Type: UInt8
0xD3 : Simulation control 0x01 : SelectSim 0x00 : X-Plane
0x01 : MSFX
0x02 : Prepar3D
0x03 : USB Emulation


Response for SelectSim command (in case of succes)


Packetlength
Type: UInt16
Status
Type: UInt8
Length of the
rest of the packet
0x00 : Success


ConnectSim Request


Command
Type: Int32
Sim Control Command
Type: Int32
IP Address (optional)
Type: UInt8[4]
0xD3 : Simulation control 0x02 : ConnectSim OPTIONAL
4 Bytes containing an IPv4 Address.
Example: 127.0.0.1 = byte[]{127,0,0,1}


Response for ConnectSim command


Packetlength
Type: UInt16
Status
Type: UInt8
Length of the
rest of the packet
0x00 : Success
WARNING! This command will always return success. Use GetSimStatus command to determine connection state.


DisconnectSim Request


Command
Type: Int32
Sim Control Command
Type: Int32
IP Address (optional)
Type: UInt8[4]
0xD3 : Simulation control 0x03 : DisconnectSim


Response for DisconnectSim command


Packetlength
Type: UInt16
Status
Type: UInt8
Length of the
rest of the packet
0x00 : Success
WARNING! This command will always return success. Use GetSimStatus command to determine connection state.


Response for all Simulation commands in case of error


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command
0x04 : BadLength 1 byte actual length, 1 byte required length
0x06 : InvalidSimState
(The command can not be executed in the current connection state)



Go to top

Settings control

Setting IDs


Setting name Setting id Value type ( Range ) Description
Force profile 0x10 Uint16[9] ( 5..99999 ) Defines a force profile for the axis. Values have to be bigger than 0. Equivalent to the force values in the axis forces tab of the profile manager. This field should be updated as little as possible during flight, as it slows the update rate down.
Force scale factor 0x20 Uint16 ( 20..999 ) Percent value, Scales the force profile. Use this to dynamically change forces on the axis.
Friction value 0x25 Uint16 ( 0..65535 ) Friction value in internal units.
Friction value eng 0x26 float (range not defined) Friction value in engineering units (N for linear motion, Nm for rotational motion).
Profile mode 0x30 Uint8 ( 0..1 ) Boolean value, defines if all 9 values of the force profile will be used. When the value is 0, the first value of the force profile will be used for the whole range of the axis.
Move back enable 0x40 Uint8 ( 0..1 ) Boolean value, defines if axis wants to go back to its center. When the value is 0, the force profile will be used as friction values.
Autopilot force 0x50 Uint16 ( 5..99999 ) Defines the force the autopilot will use to reach its target position. This does not influence the autopilot speed, only its resistance against interference. For finding the best value, start with 1500 and gradually decrease by 100.
Autopilot speed 0x60 Uint16 ( 5..9999 ) Defines the speed at which the autopilot moves to its target position. For finding the best value, start with small values ( < 10 ) and increase gradually.
Autopilot enable 0x70 Uint8 ( 0..1 ) Turns on/off the autopilot. When set to 1, the Autopilot will continuously move the axis to its target position (Autopilot position) with the configured strength and speed.
Autopilot position 0x80 float (-1..1) Normalized value, defines the target position of the autopilot.
Trim position 0x90 float (-1..1) Normalized value, defines the position, the axis wants to go back to, if "move back" is enabled.
Virtual force enable 0xA0 Uint8 ( 0..1 ) Turns on/off the reading of the virtual force. When on, the data id 0x50 can be read to obtain simulated deflection force information.
Override Position 0xB0 Int32 ( Device specific range. ) Writing to this field will override the current position.
This can be used to calibrate devices, who do not have a distinct start position.
Do NOT use this command without understanding its implications.
Using this command undermines several safety features of the drive and may cause damage to material or personnel.
VibrationActive 0xC0 Uint8 ( 0..1 ) Turns on/off vibrations on / off. Enables vibration for the following commands. There are 2 vibration settings. A fast and a slow one. They can be overlaid. If one of the 2 vibrations aren't used, the corresponding force setting can be set to 0. If both vibrations are not used, this setting must be set to 0 again.
You need to set the vibration override on the axes you want to use this feature, even If you use the remote interface without a simulation! (See Override control)
Vibration Speed for fast vibrations. 0xC1 UInt32 (Device specific range) Vibration interval in milliseconds. The lower the value, the faster the vibration.
You need to set the vibration override on the axes you want to use this feature on! (See Override control)
Vibration Force for fast vibrations. 0xC2 UInt32 (Device specific range. (Force limit / 2) ) Vibration force in internal force units. (The possible max value is half the limit of the force profile diagram)
You need to set the vibration override on the axes you want to use this feature on! (See Override control)
Vibration Speed for slow vibrations. 0xC3 UInt32 (Device specific range. (Minimum value is 10) ) Vibration interval in milliseconds. The lower the value, the faster the vibration.
You need to set the vibration override on the axes you want to use this feature on! (See Override control)
Vibration Force for slow vibrations. 0xC4 UInt32 (Device specific range. (Force limit / 2) ) Vibration force in internal force units. (The possible max value is half the limit of the force profile diagram)
You need to set the vibration override on the axes you want to use this feature on! (See Override control)
Force offset 0xD0 Int32 (Device specific range. (Force limit / 2) ) Active force into the specified direction (+/-). You need to set the vibration override on the axes you want to use this feature on! (See Override control)
Toggle feedback for Force offset 0xD1 UInt8 (Boolean: 0 / 1)
Default: 1
This setting will be lost on device state change and therefore has to be set after each device initialization.
If this setting is set to 1, force that has been set through force offset will be reflected in the Data ids 0x20 and 0x21 (Applied force)
If set to 0, force offset applied by user will not be visible in read out force, so only user input will show up in the applied force.
P Force Numerator & Denumerator 0xD2 Int16[2] (Fraction, ex: 1/20)
Int16[0] = Numerator
Int16[1] = Denumerator
This setting will be lost on device state change and therefore has to be set after each device initialization.
Sets the force P factor of the axis as a fraction. The value inversely affects dampening (smaller values increase dampening).

Do NOT use this command without understanding its implications.
Increasing the value may destabilize the axis!

Test with small increments and with the force profile and the scale factor set to the maximal values you want to use. Move the axis to give an impulse and check that the axis does not begin to oscillate.
P Move back 0xD3 UInt32
(0 - 530)
This setting will be lost on device state change and therefore has to be set after each device initialization.
Sets the P Move back factor of the axis. The value affects spring force (bigger values increase the spring force).

Do NOT use this command without understanding its implications.
Increasing the value may destabilize the axis!

Test with small increments and with the force profile and the scale factor set to the maximal values you want to use. Move the axis to give an impulse and check that the axis does not begin to oscillate.
Trim Step 0xD4 UInt16
(0 - 65535)
This setting will be lost on device state change and therefore has to be set after each device initialization.
Sets how close the axis tries to get to the trim position.
Trim Ramp 0xD5 Int16
(1 - 20)
This setting will be lost on device state change and therefore has to be set after each device initialization.
Sets how fast the axis tries to reach the Trim positision.
Extended Force Profile 0xE0 array[18] of struct {
 UInt16 force value;
 Int32 position
}
= 18 * 6 bytes
This setting will be lost on device state change and therefore has to be set after each device initialization.
The extended force profile allows setting an asymetric force profile with 9 values for each side.Index 0 is the first negative value from the center, while index 8 is the negative axis limit. Index 9 is the first positive value from the center while index 17 is the positive axis limit. The position field allows the alignment of these 18 points along the axis range. the units for position are the same internal units as when reading "Axis position raw".
Extended Friction Profile 0xE1 array[18] of struct {
 UInt16 friction value;
 Int32 position
}
= 18 * 6 bytes
This setting will be lost on device state change and therefore has to be set after each device initialization.
The extended friciton profile allows setting an asymetric friction profile with 9 values for each side. Index 0 is the negative axis limit, while index 17 is the positive axis limit. The position field allows the alignment of these 18 points along the axis range. the units for position are the same internal units as when reading "Axis position raw".
Friction by velocity 0xE2 Float[2] (Factor, Limit)
Float[0] = Factor
Float[1] = Limit
This setting will be lost on device state change and therefore has to be set after each device initialization.
The friction by velocity setting allows settings velocity controlled friction using the formula:
Rotational axes: deg/s * Factor = Nm
Translational axes: mm/s * Factor = N
The Limit value defines an upper limit for the friction force in N or Nm.
Axis range limits 0x95 Int32 Lower limit (from - to 0)
Int32 upper limit (from 0 to )
Limits the travel range of the axis to a user defined range. The maximum allowed range can be read with the corresponding GetData command "Axis range limits".


Request for writing setting


Command
Type: Int32
Axis
Type: Int32
Setting id
Type: Int32
Setting value
Type: setting specific
0xCE : Settings control 0x00000001 : Elevator
0x00000002 : Aileron
0x00000004 : Rudder
0x00000008 : Collective
0x00000010 : Brake left
0x00000020 : Brake right
0x00000040 : Elevator Trim Wheel
0x00000080 : Aileron Trim Wheel
0x00000100 : Rudder Trim Wheel
0x00000200 : Throttle 1
0x00000400 : Throttle 2
0x00000800 : Throttle 3
0x00001000 : Throttle 4
0x00002000 : Speedbrake
0x00004000 : Nosewheel
0x10 : Force profile
0x20 : Force scale factor
0x30 : Profile mode
0x40 : Move back enable
0x50 : Autopilot force
0x60 : Autopilot speed
0x70 : Autopilot enable
0x80 : Autopilot position
0x90 : Trim position
0xA0 : Virtual force enable
0xB0 : Override position
0xC0 : Vibration active
0xC1 : Vibration speed fast
0xC2 : Vibration force fast
0xC3 : Vibration speed slow
0xC4 : Vibration force slow
0xC0 : Force offset
0xE0 : Extended Force Profile
0xE1 : Extended Friction Profile
0x95 : Axis range limits
See Setting id table


Response for writing setting


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent id
0x03 : BadArgumentLength 1 byte actual length, 1 byte required length
0x04 : BadLength 1 byte actual length, 1 byte required length



Go to top

Profile control



Request for SetProfile command


Command
Type: Int32
ProfileCommand
Type: Int32
Profilename length
Type: UInt8
Profilename
Type: char[]
0xCF : ProfileControl 0x01 : ChangeProfile Length of Profilename without zero terminator Profilename without zero terminator


Response for SetProfile command


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x04 : BadLength 1 byte actual length, 1 byte required length
0x05 : InvalidProfileName sent profile name


Request for ListProfiles command


Command
Type: Int32
ProfileCommand
Type: Int32
0xCF : ProfileControl 0x02 : ChangeProfile


Response for ListProfiles command


Repeated for each profile
Packetlength
Type: UInt16
Status
Type: UInt8
ProfileCount
Type: UInt16
ProfileNameLength
Type: UInt8
Profile string
Type: char[]
Length of the
rest of the packet
0x00 : Success Number of profiles Length of profile string profile string
(without zero terminator)


Request for GetActiveProfile command


Command
Type: Int32
ProfileCommand
Type: Int32
0xCF : ProfileControl 0x03 : GetActiveProfile


Response for GetActiveProfile command


Packetlength
Type: UInt16
Status
Type: UInt8
ProfileNameLength
Type: UInt8
Profile string
Type: char[]
Length of the
rest of the packet
0x00 : Success Length of profile string profile string
(without zero terminator)



Go to top

Input control

Button actions, that can be mapped in CLS2Sim can also be triggered over the remote protocol.
The SetDigitalInputs command below allows setting the digital inputs over the remote inteface.
The behavior is like a bitmask. Actions that are sent in the command will be 'pulled high' or active.
Actions that are not included in the request will be 'pulled low' or inactive.
So if you want enable the autopilot, you will send 2 packets.
The first contains the id 9003.
The second should arrive about 100ms later, to give CLS2Sim enough time to update the value in the simulation.
Of course you can send other SetDigitalInputs requests in between, but please note that you will
have to include the id 9003 on all SetDigitalInputs packets during that 100ms to keep the 'input' high.

Input Ids

NameIdSupported ion X-PlaneSupported in MSFX/Prepar3D
AP - Disable autopilot (CMD) 9001 X X
AP - Activate Flight director 9002 X X
AP - Enable autopilot 9003 X X
AP - Control Wheel Steering 9004 X X
AP - Take off go around 9005 X
Trim - elevator up 1002 X X
Trim - elevator down 1003 X X
Trim - aileron left 1004 X
Trim - aileron right 1005 X
Flaps up 1026 X X
Flaps down 1027 X X
View - Look forward 1100 X
View - Look up 1107 X
View - Look down 1108 X
View - Look left 1109 X
View - Look right 1110 X
View - Glance left 1111 X
View - Glance right 1112 X
Radio - Contact ATC 1120 X




Request for SetDigitalInputs command


Command
Type: Int32
Input Ids
Type: UInt16[]
0xD5 : InputControl Array of Input Ids to be high
All unsent Ids are pulled low.


Response for SetDigitalInputs command


Packetlength
Type: UInt16
Status
Type: UInt8
Invalid input Ids
Type: UInt16[]
Length of the
rest of the packet
0x00 : Success
0x02 : BadIdOrCommand
In case of error:
All input ids that are invalid



Go to top

Reading data

In a dual-seat set-up, all Data except force information and buttons is synchronized. Commands will send data for each connected device, but will limit the selection to the chosen axes. In a dual seat, data for pilot and copilot devices is returned. See device id's at the top.

Data IDs


Data name Data id Value type ( Range ) Description
Axis position 0x10 Int16 ( -32767 - 32767 )
Brakes: UInt16 ( 0 - 65535 )
Position of the Axis. Brakes and Throttle is handled differently as these axes have no negative range.
Axis position normalized 0x11 Float (-1.0 - 1.0)
Brakes: Float ( 0.0 - 1.0 )
Position of the Axis, normalized. Brakes and Throttle is handled differently as these axes have no negative range.
Axis position raw 0x12 Int32 (undefined range)
Position of the Axis as raw value. Different ranges per device type and axis.
Applied force 0x20 Int16 ( -32767 - 32767 ) The force applied to the axis. Force reading for brakes is deactivated until further notice.
Applied force, normalized 0x21 Float ( -1.0 - 1.0 ) The force applied to the axis, normalized. If force reaches 1, the device will throw a force sensor error. Force reading for brakes is deactivated until further notice.
Digital inputs
(deprecated! Use 'Digital inputs extended')
0x30 Int32 Bitmask A bitmask containing all digital inputs of a drive.
Digital inputs extended 0x31 UInt16 Number of digital inputs. (Also number of used bits)
Byte[number of used bits / 8 and rounded up) ] Bitmask containing digital input states.
All digital inputs of the device id.
Analog inputs 0x40 UInt16 number of analog inputs
UInt32[] analog input value
All analog inputs of the device id. Input values are NOT normalized.
Virtual force 0x50 UInt32 (Device specific range)
If virtual force has been enabled for this axis (Set setting value 0xA0 to 1), this data will show the simulated deflection force for this axis.
Axis Range limits 0x60 For each selected device id:
struct {
 UInt16 device ID;
 Int32 MinLowerLimit;
 Int32 MaxUpperLimit;
 Int32 CurrentLowerLimit;
 Int32 CurrentUpperLimit;
}
Returns the total available range for each device id of the selected axes. Can be used as min and max value when using the SettingsCommand "Axis Range Limits".


Request for reading data


Command
Type: UInt32
Axis
Type: UInt32
Data id
Type: UInt32
0xD0 : Read data 0x00000001 : Elevator
0x00000002 : Aileron
0x00000004 : Rudder
0x00000008 : Collective
0x00000010 : Brake left
0x00000020 : Brake right
0x00000040 : Elevator Trim Wheel
0x00000080 : Aileron Trim Wheel
0x00000100 : Rudder Trim Wheel
0x00000200 : Throttle 1
0x00000400 : Throttle 2
0x00000800 : Throttle 3
0x00001000 : Throttle 4
0x00002000 : Speedbrake
0x00004000 : Nosewheel
0x10 : Axis position
0x11 : Axis position normalized
0x20 : Applied force
0x21 : Applied force normalized
0x30 : Digital inputs (eg. buttons)
0x40 : Analog inputs (eg. brakes)
0x50 : Virtual force
0x60 : Axis Range limits


Response for reading data ( in case of success )


Repeated for each device id
Packetlength
Type: UInt16
Status
Type: UInt8
Device id
Type: UInt16
Data
Type: Type specific
Length of the
rest of the packet
0x00 : Success See Axis Bitmask See Data Id table


Response for reading data ( in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command
0x04 : BadLength 1 byte actual length, 1 byte required length



Go to top

Reading/Writing IO2CAN Gateway data

Request for reading IO2CAN Gateway data


Command
Type: UInt32
Device ID's
Type: Byte[]
0xD2 : Read IO2CAN Gateway data Any number of bytes.
Each byte is a device id as shown in Profilemanager - > Buttons / Analog inputs


Response for reading IO2CAN Gateway data ( in case of success )


Repeated for each device id
Packetlength
Type: UInt16
Status
Type: UInt8
Device id
Type: UInt16
Num DIn
Type: Byte
Num AIn
Type: Byte
Din bitmask
Type: byte[num digital inputs / 8]
Analog inputs
Type: UInt16[num analog inputs]
Length of the
rest of the packet
0x00 : Success Device id as shown in
Profilemanager - > Buttons / Analog inputs
Number of digital inputs. Number of analog inputs. Digital inputs bitmask consisting of ceil([Num Din] / 8) bytes Analog input values.


Response for reading IO2CAN Gateway data ( in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x01 : Unknown Error
0x02 : BadIdOrCommand sent command


Request for writing IO2CAN Gateway outputs


Repeated for each device id
Command
Type: UInt32
Device ID
Type: Byte
Output bitmask
Type: Byte
0xD6 : Set IO2CAN Gateway outputs Device id as shown in
Profilemanager - > Buttons / Analog inputs
Bitmask that controls ouput 0 to 3 using the lowest 4 bits.


Response for writing IO2CAN Gateway outputs ( in case of success )


Packetlength
Type: UInt16
Status
Type: UInt8
Length of the
rest of the packet
0x00 : Success


Response for writing IO2CAN Gateway outputs ( in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Type: UInt8
Length of the
rest of the packet
0x02 : Id of a not existing or connected IODevice was used Nonexisting device Id






Go to top

Setting IO2CAN Gateway output communication timeout

For the IO2Can Gateway outputs a watchdog can be activated. If the timeout is not set to 0, the watchdog is active.
If the IO2Can device does not receive CAN packets for the set duration, all outputs will be set to low.
This allows a connected hardware to react, if the control software controlling the IO2Can device crashes.
To deactivate the setting again, set it to 0.

Request for setting IO2CAN Gateway output communication timeout


Repeated for each device id
Command
Type: UInt32
Device ID
Type: Byte
Timeout
Type: UInt16
0xD7 : Set IO2CAN Gateway output communication timeout Device id as shown in
Profilemanager - > Buttons / Analog inputs
Timeout in milliseconds


Response for writing IO2CAN Gateway outputs ( in case of success )


Packetlength
Type: UInt16
Status
Type: UInt8
Length of the
rest of the packet
0x00 : Success


Response for writing IO2CAN Gateway outputs ( in case of error )


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Type: UInt8
Length of the
rest of the packet
0x02 : Id of a not existing or connected IODevice was used Nonexisting device Id



Go to top

Override control

When using the remote interface in combination with a supported simulation, trim, force and autopilot will be controlled by the simulation. To control these features over the remote interface, overrides have to be set active. The following command allows setting this for any axis. The settings that need an override are "Force scale factor", "Autopilot enable", "Autopilot position" and "Trim position". For details on those, read "Settings control" further up.

Setting an override is done by specifying for which axes this override is active. Each axis bit defined in the axis field will set the override for that axis. Axes that are not included in the Axis field will be unset.

To disable all overrides, pass zero for the axis field.

Override IDs


Override name Override id Description
Scale factor override 0x01 Allows overriding the force scale factor, which is normally calculated from force factor and current airspeed.
Trim position override 0x02 Allows overriding the trim position.
Autopilot enable override 0x03 Allows overriding the state (on/off) of the autopilot in the hardware.
Autopilot position override 0x04 Allows overriding the target position of the hardware autopilot.
Vibration override 0x05 Allows overriding the vibration settings of the hardware.
To manipulate vibrations, or the force offset, this command needs to be applied, even if no simulation is connected.
Take care when setting vibrations!
Start with a force of 50 and work you way up in increments of 100
to get a feel for the strength of vibrations or force offset.


Request for writing override


Command
Type: Int32
Axis
Type: Int32
Override id
Type: Int32
0xD1 : Override control 0x00000001 : Elevator
0x00000002 : Aileron
0x00000004 : Rudder
0x00000008 : Collective
0x00000010 : Brake left
0x00000020 : Brake right
0x00000040 : Elevator Trim Wheel
0x00000080 : Aileron Trim Wheel
0x00000100 : Rudder Trim Wheel
0x00000200 : Throttle 1
0x00000400 : Throttle 2
0x00000800 : Throttle 3
0x00001000 : Throttle 4
0x00002000 : Speedbrake
0x00004000 : Nosewheel
0x00000001 : Force scale factor override
0x00000002 : Trim position override
0x00000003 : Autopilot enable override
0x00000004 : Autopilot position override
0x00000005 : Vibrations override
0x00000006 : Positions override (Positions will not be sent)


Response for writing setting


Packetlength
Type: UInt16
Status
Type: UInt8
StatusArguments
Status value specific
Length of the
rest of the packet
0x00 : Success
0x01 : Unknown Error
0x02 : BadIdOrCommand sent id
0x04 : BadLength 1 byte actual length, 1 byte required length




©,2017 Brunner Elektronik AG
CH-8335 Hittnau 
http://www.brunner-innovation.swiss