BIDS Specifications

en_US en_USja ja

I would like to write about the specification of BIDS here.
In addition to having some unimpremented functions at this time, specifications may differ from those released in beta version etc. and softwares adopting special specifications. Version of this specification is “v201”.

Abbreviation List

On this page, it may be abbreviated as shown in the table below.

Abbreviation Stands for
csdll BIDScs.dll (Unless otherwise noted, it refers to client mode)
Sv BIDS_Server.exe (Including display software incorporating server mode “csdll”)
SvCp Computer which started both BVE and BIDS_Server.exe
ClCp Computer which started Sv which established communication with SvCp’s BIDS_Server.exe
OpeReq Abbreviation of Operation Request

System Link Image

This is an image diagram of how BIDS realizes device interlocking. Connection method etc. may be changed while developing development.
Details of communication process will be prepared at a later date.

Sender : Mother Side

Sender : Client Side

Request Process

Communication between Sv

TCP/IP is mainly used for communication between Sv. As an option setting, it is also possible to communicate via UDP/IP. It convert the operation information of BVE into a byte array of its own structure from Sv of SvCp to Sv of ClCp. You can send information from Sv of ClCp to Sv of SvCp, to operate BVE, but you can not change the values ​​of Panel and Sound.
Sv-Sv communication has the following five modes. The default is “Full”, and you can select a mode other than “Full” if there is not enough bandwidth or information you want is limited.

Num Mode Basic Panel Sound Security
0 Full
1 Old(※1) ※2 ※3 ※4 ×
2 Lite+ × ×
3 Lite × × ×
4 Req

※1 :It is a data structure to keep the compatibility with old generation.
※2 : Some information may be restricted.
※3 : You can only get 256 data from Panel[0] to Panel[255].
※4 : You can only get 256 data from Sound[0] to Sound[255].

However, BIDS_Server.exe does not support Old mode and Req mode.

Basic Information Group

In the basic information group, basic info such as speed info and position info is grouped and transmitted.
The information to be sent is as follows. Please use INum * 4 for index number of transmission information.

Group of Constant Info

This group deals with basic information group whose numerical value is fixed.

INum Type Name Unit Info
0 byte[4] Header The contents are {0x54, 0x52, 0x62, 0x01}.
1 UInt16[2] Version It is the version info of the sender (previous 2 Byte) and the info of the sender (later 2 bytes). If it is in compliance with this specification, 201(0x00C9) is entered in previous 2 bytes.
2 UInt16[2] Handles1 (Stage) It is the number of stages of each handle of Brake and Power.  The previous 2 bytes is Brake Notches, and the later 2 bytes is Power Notches.
3 UInt16[2] Handle2 (Stage) The previous 2 bytes is the minimum number of Notches required for ATS confirmation, and the 2 bytes later is the Brake Notches number that corresponds to the maximum service-brake.
4 UInt16[2] Others (car,stage) The previous 2 bytes is the number of cars, and the later 2 bytes is the number of allocated stages to a Self-Brake Notch.
5~ (var) CarInfo I will explain it on this page (under preparation).
(Last) byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}. It will enter the last 4 bytes of information.

The “sender information” in INum.1 is as follows. This number will be added at any time without relying on Version.

Num Info
0 不明
1 BIDS_Server.exe(connected with BIDSpp.dll)
2 BIDS_Server.exe(connected with OBIDSid.dll)
3 BIDS_Server.exe(Started on ClCp)
4 BIDS_toSkyWay.exe(to be released)

Group of Common Info

This group handles info that are commonly set for BVE5 and openBVE. Info that I would like to be treated in the future may also be listed.

INum Type Name Unit Info
0 byte[4] Header The contents are {0x54, 0x52, 0x62, 0x02}.
1 double MyLocation [m] It is the position of your own train.  It use 8 bytes.
3 single MySpeed [km/h] It is the speed of your own train.
4 single MyCurrent [A] It is the current of your own train.
5 single MyWireVolt [kV] It is the overhead wire voltage of your own train. (Not yet implemented as of Mar. 1st, 2019)
6 UInt NowTime [ms] It is time in game. It will be added even after 24 o’clock.
7 single MyBCPressure [kPa] It is the Brake Cylinder Pressure of your own train.
8 single MyMRPressure [kPa] It is the Main air Reservoir Pressure of your own train.
9 single MyERPressure [kPa] It is the Equalizing air Reservoir Pressure of your own train.
10 single MyBPPressure [kPa] It is the Brake Pipe Pressure of your own train.
11 single MySAPPressure [kPa] It is the Straight Air Pipe Pressure of your own train.
12 int MySignalNum Signal indication number
13 bit[8] MyDoor Door Condition
14 byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

For the door condition, please refer to the table below.
F : False, T : True

Num Info 0 1
0 Is Pilot Lamp on F T
1 Is left doors closed F T
2 Is right doors closed F T
3 Is left doors moving T F
4 Is right doors moving T F
5 Is Single-Door-Opening Mode enabled F T
6 Is semi-automatic mode enabled F T
7 Is Door Backup enabled F T

The IsClosed state will be changed after the operation is completely finished. Please note that some functions may not be implemented.

Group of Bvets5 original info

As of Mar. 1st, 2019, BVE5’s original info does not exist so it is treated as a reserved area.

INum Type Name Unit Info
0 byte[4] Header The contents are {0x54, 0x52, 0x62, 0x03}.
1 byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

Group of openBVE original info

Currently, I am checking the specification of openBVE API. Please wait for a while until the specification is determined.

INum Type Name Unit Info
0 byte[4] Header The contents are {0x54, 0x52, 0x62, 0x04}.
1 byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

Group of Handle Position

In this group, you can get the position of each handle.

INum Type Name Info
0 byte[4] Header The contents are {0x54, 0x52, 0x62, 0x05}.
1 Int32 Power A negative number means the speed reduction stage.
2 Int32 Brake Position of Brake handle (Only positive integer)
3 Int32 Reverser Position of Reverser (As for Steam Locomotive, it means “Reversing Gear” Position : -10000 ≦ x ≦ +10000)
4 Int32 SelfBrake Position of Self Brake (Only positive integer)
5 byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

Please note that some functions may not be implemented.

Group of Panels

You can get the Panel array of BVE with using this. In this info group, Panel array is divided every 128 pieces, and it is transmitted at rotation every 50 ms to 500 ms (Specified by Sv. Default is 200 ms).
However, if at least one value is updated within the delimited array, it will be sent immediately, apart from rotation. BIDS transmits 520 bytes per transmission including 4 bytes of header and 4 bytes of terminal symbol. However, in fact, in addition to this, various information is added automatically, so the amount of traffic will be larger than this.

The data structure is as follows. All variables except Header and Tail are Int32 type.

Num Name Info
0 Header The contents are {0x54, 0x52, 0x70, n}.
1 Panel[0 + 128 * n] Info on the (128*n)th Panel
(omitted)
128 Panel[127 + 128 * n] Info of the(127 + 128 * n)th Panel
129 Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

The group number from 0 to 255 is an integer in n. When BIDS is connected to BVE5, you can get only 128 * 2 = 256(2^8) elements, but when connected to openBVE, you can get up to 128 * 256 = 2 ^ 15 elements. Please note : “0” is included in the information of elements that do not exist.

Group of Sounds

As with the Group of Panels, 128 elements are grouped and send.
The data structure is as follows. All variables except Header and Tail are Int32 type.

Num Name Info
0 Header The contents are {0x54, 0x52, 0x73, n}.
1 Sound[0 + 128 * n] Info on the (128*n)th Sound
(omitted)
128 Sound[127 + 128 * n] Info on the (127 + 128 * n)th Sound
129 Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.

The group number from 0 to 255 is an integer in n. When BIDS is connected to BVE5, you can get only 128 * 2 = 256(2^8) elements, but when connected to openBVE, you can get up to 128 * 256 = 2 ^ 15 elements. Please note : “0” is included in the information of elements that do not exist.

Group of Security System Info

An information area is allocated for each function of the security device. For detailed allocation, please refer to the dedicated page (to be prepared at a later date).

INum Type Name Info
0 byte[4] Header The contents are {0x54, 0x52, 0x68, n}.  “n” represents the type of security device.
1~ Securities The contents here vary depending on the security device.  Please refer to the dedicated page.
m byte[4] Tail The contents are {0xFE, 0xFE, 0xFE, 0xFE}.  “m” varies depending on the security device.

OpeReq

BIDS has a function to send a BVE operation request from csdll to BVE of SvCp. This is OpeReq. You can use OpeReq for both Sv-Sv communication and Sv-csdll communication.
OpeReq consists of Shift-JIS encoded string. Command response is also done in string.

The command consists of three elements: prefix (+ identifier) ​​(Head) + instruction content (Order) + suffix (Tail).

The available functions are as follows.

Identifier

Char Target Action
R Reverser Request a operation
S Power & Brake Lever Request a operation
P Power Lever Request a operation
B Brake Lever Request a operation
K ATS Keys Request a operation
I BIDS Request the info sending
A BIDS Request the info automatic sending mode to be enabled
D BIDS Request the info automatic sending mode to be disabled
V BIDS Get the version of Sv connected
E BIDS Notify of occurrence of error (mainly sent from the connection destination)
H BIDS Get the security device status

R : Reverser Operation Request

This command requests to change the handle position of the Reverser to the specified position. You can execute three kinds of commands with one of two or three commands each.

There are seven commands below. If you need to operate SL’s Reversing Gear, please inquire to me.
The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRR F Forward Position
1
N Neutral Position
0
R Backward Position
B
-1

Even if you use any command with the same meaning, the result is the same. Please use the command you like.
When the operation is accepted, 0 is returned.

S : Master Controller (Single Lever) Operation Request

You can request changing the position of the Master Controller lever.
There is no restriction mechanism in this command itself. This request accepts more than the number of stages vehicle have, but please be aware that such operations are not necessarily reflected in BVE.

Commands are composed of numbers in arbitrary number of positions as follows.
The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRS -x Set the lever position to -x (x∈ℕ)
-1 Set the lever position to -1 (Set to B1 position)
0 Set the lever position to 0 (Set to N position)
1 Set the lever position to 1 (Set to P1 position)
x Set the lever position to x (x∈ℕ)

In addition, ℕ represents a set of natural numbers as a whole, but since the int type is used as a variable specifying the handle position, it is at most “2,147,483,647” (about 2 billion).  However, I don’t know if BVE supports that number.
When the operation is accepted, 0 is returned.

P : Request the Power Lever Operation Request

The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRP -x Set the lever position to -x (x∈ℕ)
-1 Set the lever position to -1 (Set to SpeedSuppressingPosition 1)
0 Set the lever position to 0 (Set to P0 position)
1 Set the lever position to 1 (Set to P1 position)
x Set the lever position to x (x∈ℕ)

In addition, ℕ represents a set of natural numbers as a whole, but since the int type is used as a variable specifying the handle position, it is at most “2,147,483,647” (about 2 billion).  However, I don’t know if BVE supports that number.
When the operation is accepted, 0 is returned.

B : Request the Brake Lever Operation Request

The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRB 0 Set the lever position to 0 (Set to B0 position)
1 Set the lever position to 1 (Set to B1 position)
x Set the lever position to x (x∈ℕ)

In addition, ℕ represents a set of natural numbers as a whole, but since the int type is used as a variable specifying the handle position, it is at most “2,147,483,647” (about 2 billion).  However, I don’t know if BVE supports that number.
When the operation is accepted, 0 is returned.

K : Request ATS_Key Operation

ATS_Key is a key used for button manipulation for BVE’s ATS plug-in.  It is a standard function of BVE.
In addition to this, BIDS implements a command to generate a key input event directly on the BVE window, but we do not recommend using it as it may cause unexpected troubles.

The command structure is as follows. The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRK Ux Request making “Up” event to button”x”
Dx Request making “Down” event to button”x”
Py Request making “Press” event to button”y”
Ry Request making “Release” event to button”y”

(0≦x≦19 y∈ℕ)
About the numbers for y, please refer to this page of Microsoft.
Please refer to the table below for numbers for x.

0 : Horn1 4 : ATS_S 8 : ATS_B2 12 : ATS_E 16 : ATS_I
1 : Horn2 5 : ATS_A1 9 : ATS_C1 13 : ATS_F 17 : ATS_J
2 : Music Horn 6 : ATS_A2 10 : ATS_C2 14 : ATS_G 18 : ATS_K
3 : Const. Speed 7 : ATS_B1 11 : ATS_D 15 : ATS_H 19 : ATS_L

For openBVE, the following numbers are also supported. Command conforms to “OpenBveApi.Interface.Translations.Command” (more than 20).
I will do “Meaning”  englishization little by little.

Num Command Meaning
22 DoorsLeft 左側ドアを開閉する
23 DoorsRight 右側ドアを開閉する
30 PlayMicSounds マイクからの音声入力を有効化する
31 CameraInterior カメラ位置を運転台にする
32 CameraInteriorNoPanel カメラ位置を運転台にし、運転台Panelを消す
33 CameraExterior カメラ位置を車両の外観を見れるような位置にする
34 CameraTrack カメラ位置を線路付近にする
57 TimetableToggle 時刻表の表示/非表示を切り替える
58 TimetableUp 時刻表を上にスクロールさせる
59 TimetableDown 時刻表を下にスクロールさせる
60 MiscClock 画面内の時計の表示/非表示を切り替える
61 MiscSpeed 画面内の現在速度の表示/非表示を切り替える
62 MiscGradient 画面内の勾配状態の表示/非表示を切り替える
63 MiscDistanceToNextStation 画面内の次駅までの距離の表示/非表示を切り替える
64 MiscFps 画面内のfpsの表示/非表示を切り替える
65 MiscAI AI運転(自動運転)の有効/無効を切り替える
66 MiscInterfaceMode Interfaceモードを切り替える
67 MiscBackfaceCulling Backface Cullingモードの有効/無効を切り替える
68 MiscCPUMode CPUモードの高低を切り替える
69 MiscTimeFactor 時の進みを加速させるか否かを切り替える
70 MiscPause 一時停止する。もしくは復帰する
71 MiscMute ミュートにする。もしくは復帰する
72 MiscFullscreen フルスクリーン表示の有効/無効を切り替える
73 MiscQuit openBVEを終了する
74 MenuActivate メニューを表示する
75 MenuUp メニューの選択項目を1つ上げる
76 MenuDown メニューの選択項目を1つ下げる
77 MenuEnter サブメニューに入る
78 MenuBack サブメニューから離脱する
79 DebugWireframe Wire Frame表示の有効/無効を切り替える
80 DebugNormals Normal Renderingモードに切り換える(?)
81 DebugBrakeSystems ブレーキのデバッグ用画面の表示/非表示を切り替える
82 DebugATS ATSのデバッグ用画面の表示/非表示を切り替える
83 ShowEvents Event表示画面の表示/非表示を切り替える
103 SecurityM ATS PI用 Mボタン(後方互換性確保用)
104 SecurityN ATS PI用 Nボタン(後方互換性確保用)
105 SecurityO ATS PI用 Oボタン(後方互換性確保用)
106 SecurityP ATS PI用 Pボタン(後方互換性確保用)
107 WiperSpeedUp ワイパーの往復速度を加速させる
108 WiperSpeedDown ワイパーの往復速度を減速させる
109 FillFuel 燃料を補給する(エンジン車用)
110 Headlights ヘッドライトの点灯/滅灯を切り替える
111 LiveSteamInjector Live Steam Injectorを操作する(?)(蒸気動車用)
112 ExhaustSteamInjector Exhaust Steam Injectorを操作する(?)(蒸気動車用)
113 IncreaseCutoff Cutoffを増やす(?)(蒸気動車用)
114 DecreaseCutoff Cutoffを減らす(?)(蒸気動車用)
115 Blowers ブロワーを起動/停止(?)する
116 EngineStart エンジンを起動する(エンジン車用)
117 EngineStop エンジンを停止する(エンジン車用)
118 GearUp ギアを上げる(エンジン車用)
119 GearDown ギアを下げる(エンジン車用)
120 RaisePantograph パンタグラフを上げる(電気車用)
121 LowerPantograph パンタグラフを下げる(電気車用)
122 MainBreaker 主シャ断器を入れる/落とす
123 RouteInformation 路線の情報の表示/非表示を切り替える

You can also enter numbers that are not listed, but normal operation can not be guaranteed at all.

I : Request Driving Data Sending

You can acquire various information.  As the specification is currently being developed, commands may be added in the future.
The command structure is as follows. The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Order Meaning
TRI C 0 Number of Brake Notches
1 Number of Power Notches
2 Minimum number of Notches required for ATS confirmation
3 Brake Notches number that corresponds to the maximum service-brake
4 Number of cars
5 Number of Self-Brake Notches
6~ Other vehicle information (To dedicated page) (Under preparation)
E 0 Position of your own train[m]
1 Speed of your own train[km/h]
2 Time in game[ms]
3  Brake Cylinder Pressure of your own train[kPa]
4 Main air Reservoir Pressure of your own train[kPa]
5 Equalizing air Reservoir Pressure of your own train[kPa]
6 Brake Pipe Pressure of your own train[kPa]
7 Straight Air Pipe Pressure of your own train[kPa]
8 Current of your own train[A]
9 (Not Enabled)Overhead wire voltage of your own train[V]
10 Time in Game (Hour)
11 Time in Game (Minute)
12 Time in Game (Second)
13 Time in Game (Millisecond)
H 0 Position of Brake Notches
1 Position of Power Notches
2 Positoin of Reverser Handle(In the case of SL, it is the Reversing Gear position, and it follows -10000 ≦ x ≦ +10000)
3 (Not Enabled)State of Constant Speed Mode
4 Position of Self-Brake Notches
P 0 Value of Panel[0]
n Value of Panel[n]
-1 The array length of the Panel array is returned. If it is a negative number, you can send anything.
S 0 Value of Sound[0]
n Value of Sound[n]
-1 The array length of the Sound array is returned. If it is a negative number, you can send anything.
D 0 Door Opening State(0:Closed, 1:Opened, 2:Left side opened, 3:Right side opened, 4:Both sides opened)
1 Unusual Door Srare(0:None, 1:Single Door Opening Mode, 2:Semi-Autonatic Operation)
2 Is Enabled Door Backup Mode

A : Request Starting Automatic Driving-Data Sending

It is a command to register so that it will be transmitted automatically when there is a change in specified driving information.

Multiple registration is not accepted.  Even if multiple registration is requested, the previous registration will be overwritten.

To register, just send “TRAxxx\n” command.  When it is successfully registered, “TRAxxxX0\n” will be replied.

The character string in xxx is the same as the character string used in the operation information transmission request with identifier “I”.

D : Request Stopping Automatic Driving-Data Sending

I prepare for just in case, but automatic sending registration is not carried over the next connection, and because it has an independent list for each connection, there is only a use when there is no need for information during the connection of the device is alive. If you are requested to stop automatic transmission of unregistered information as well, please be aware that the response will come as if registration was canceled normally.

To cancel registration, please send the command “TRDxxx\n”. If registration is successfully canceled, “TRDxxxX0\n” will be returned. The character string in xxx is the same as the character string used in the operation information transmission request with identifier “I”.

E : Error occurrence notification

Unlike other commands, this is normally not sent by the requestor. When an error occurs at the stage of processing other requests, the reply side uses this command to notify the occurrence of the error.

The command structure is as follows. The suffix “\n” is omitted in the table. Please be careful not to forget this during actual operation.

Head Num Meaning
TRE 0 Unknown Cause
1 Not connected with BIDSpp.dll (or OBIDS.dll)
2 Invalid numerical part of command (nonexistent number)
3 The symbol part of the command is invalid (nonexistent symbol)
4 Invalid command identifier (nonexistent identifier)
5 Numeric conversion overflowed
6 Numbers other than numbers are mixed in the numerical part of the request command
7 Command is incorrect (cause not specified)
8 BVE window handle acquisition failed

H : Security Device Info Send Request

Please wait for a while as the specification is being developed.

References

There are pages that can not provide the English version. So, please be careful.

Japanese Only

JIS E 4010:1985 Symbols for Railway Rolling Stock and Railway Rolling Stock Ports

Update Log

Feb. 28th, 2019 Almost completed the Englishization
Add “System Link Image”
Feb. 27th, 2019 Published & Start Englishization

Posted by Tetsu Otter