适用型号
LBE-LEI-M-00、LBE-LES-M-00、LBE-LES-M-01、LBE-LEC-M-00、LBE-LEE-M-00
LBE-KEI-M-00、LBE-KES-M-00、LBE-KES-M-01、LBE-KEC-M-00、LBE-KEE-M-00
| Date | Version | Description |
|---|---|---|
| 2024/10/28 | 0.1 | 协议重新整理 |
| 2025/03/12 | 0.2 | 增加イーサネット(イーサネット)协议 |
| 2025/03/20 | 0.4 | 修复ドキュメント説明エラー |
| 2025/06/27 | 0.5 | 修复部分ドキュメント説明エラー |
系统介绍
系统定义
停止播放
播放 0 号文件夹,即可停止当前播放。
文件夹数量
系统最多サポート 256 个文件夹 [0,255]。
文件夹定义
- 0 号文件夹为系统保留文件夹,是静音文件夹;当用户需要静音或中断当前播放时,直接切换到 0 号文件夹即可。
- 0 号文件夹デフォルト非表示,不可編集。
- 1~255 号文件夹为用户文件夹,可自由导入音频文件。
- 单个文件夹导入的歌曲数量在容量允许的情况下ない数量限制。
- 播放系统只能指定文件夹,不能指定播放哪个文件;如需指定文件,该文件夹仅放一个音频文件即可。
- 当播放系统指定播放某个文件夹时,系统会根据“播放モード”和“選択モード”决定播放策略:循环或单次,顺序或随机,详见下一小节“モード定义”。
サポート文件格式
音频文件格式サポート .mp3 和 .wav。
サポート接口
目前播放器サポート 4 种控制接口:
| Interface | 備考 |
|---|---|
| serial port | RS232 / RS485 |
| CAN | CAN2.0B |
| Input | 12 V~36 V NPN 或 PNP |
| Ethernet | Ethernet |
モード定义
音量モード
| モード | 取值範囲 | Description |
|---|---|---|
| 100 等分 | [0,100] | 此モード下音量被分成 100 等份,当音量为 100 时音量最大。 |
| 28 等分 | [0,28] | 此モード下音量被分成 28 等份,当音量为 28 时音量最大。 |
播放ステータス PlaybackState
| status | Value | Description |
|---|---|---|
| Stop | 0x01 | 播放器在停止ステータス |
| 播放中 | 0x02 | 播放器在播放ステータス |
语音播放モード PlaybackMode
| モード | Value | Description |
|---|---|---|
| 循环モード | 0x00 | 文件夹内文件依次播放,一直循环。 |
| 单次モード | 0x01 | 文件夹内文件依次播放,播放完最后一个文件后播放器停止。 |
選択モード SelectMode
| モード | Value | Description |
|---|---|---|
| 顺序モード | 0x00 | 按照文件夹内文件名排序,从小到大依次選択文件。 |
| 随机モード | 0x01 | 随机選択指定文件夹内的文件;当处于随机モード时,文件将一直随机循环播放。 |
允许忽略播放指令 IgnorePlayCmd
| 是否开启 | Value | Description |
|---|---|---|
| Close | 0x00 (false) | 系统将无条件实时レスポンス播放指令;若再次收到相同文件夹播放指令,会停止当前播放并再スタート。。 |
| Open | 0x01 (true) | 若当前正在播放某文件夹,再次收到相同文件夹播放指令时将忽略,维持原播放。 |
Ethernet
Protocol:LD-NET2
合意書の概要
- 基于 TCP/IP;TCP 断开与连接请至少保持 50 ms 間隔:TCP 断开 → 延时 50 ms → TCP connect。
- 协议由 7 バイト単位。组成: head function param1 param2 param3 xor tail 头码 function code parameter1 parameter2 parameter3 xorcheck 尾码
- 头码:0x01
- 尾码:0x02
- xor Verification:由前 5 バイト単位。异或得到:
xor = header ^ function ^ param1 ^ param2 ^ param3 - 指令間隔:每条命令を送る。間隔请保持 200 ms 以上。
协议指令的构成与解析请参照“LD-SP2”章节。
Protocol:Modbus-TCP
合意書の概要
- サポート指令:
- read holding registers(0x03)
- 単一保持レジスタの書き込み(0x06)
- 複数書き込みレジスタを保持する。(0x10)
- 指令間隔:200 ms 以上。
相关レジスタ
| register address | 功能説明 | 取值範囲 | 読み取り専用 |
|---|---|---|---|
| 0x03 | 播放レジスタ | [0,255] | 否 |
| 0x04 | 音量レジスタ | [0,100] 或 [0,28] | 否 |
| 0x05 | 播放モードレジスタ | [0,1] | 否 |
| 0x06 | 選択モードレジスタ | [0,1] | 否 |
| 0x07 | 忽略播放指令レジスタ | [0,1] | 否 |
| 0x08 | 播放ステータスレジスタ | [1,2] | 是 |
协议指令
単一レジスタの書き込み指令
送信格式:
| トランザクション処理标识 | Protocol Identifier | Length | Unit identifier | function code | register address | register value |
|---|---|---|---|---|---|---|
| 2 Byte | 2 Byte | 2 Byte | 1 Byte | 1 Byte | 2 Byte | 2 Byte |
- Transaction identifier:报文编号,一般自增。
- Protocol Identifier:デフォルト 0x0000。
- Length:后续バイト長さ,単一レジスタの書き込み固定 0x06。
- Unit identifier:デフォルト 0x01。
- function code:0x06。
回复格式:与送信一致。
example 1:播放 1 号文件夹(写 0x03 为 1)
Controller→播放器(HEX):00 01 00 00 00 06 01 06 00 03 00 01
播放器→Controller(HEX):00 01 00 00 00 06 01 06 00 03 00 01
example 2:停止播放(写 0x03 为 0)
Controller→播放器(HEX):00 02 00 00 00 06 01 06 00 03 00 00
播放器→Controller(HEX):00 02 00 00 00 06 01 06 00 03 00 00
example 3:音量设为 100%(写 0x04 为 100=0x64)
Controller→播放器(HEX):00 03 00 00 00 06 01 06 00 04 00 64
播放器→Controller(HEX):00 03 00 00 00 06 01 06 00 04 00 64
读レジスタ指令
送信格式:
| トランザクション処理标识 | Protocol Identifier | Length | Unit identifier | function code | Starting register address | number of registers |
|---|---|---|---|---|---|---|
| 2 Byte | 2 Byte | 2 Byte | 1 Byte | 1 Byte | 2 Byte | 2 Byte |
回复格式:
| トランザクション処理标识 | Protocol Identifier | Length | Unit identifier | function code | byte count | register value |
|---|---|---|---|---|---|---|
| 2 Byte | 2 Byte | 2 Byte | 1 Byte | 1 Byte | 1 Byte | 2 Byte |
example:読み取り播放ステータス(读 0x08)
Controller→播放器(HEX):00 04 00 00 00 06 01 03 00 08 00 01
播放器→Controller(HEX):00 04 00 00 00 05 01 03 02 00 02
→ 当前播放ステータス为 2(播放中)。
Protocol:HTTP-GET
合意書の概要
- 基于 HTTP,播放器内置 HTTP 服务。
- 指令間隔:500 ms 以上。
协议指令
播放指令
URL:http://{IP}:{port}/control/play?id={dir}http://{IP}:{port}/control/play?id={dir}&volume={vol}
parameter:
| parameter | 説明 | 是否必须 |
|---|---|---|
| IP | HTTP Server IP address | 必须 |
| port | HTTP サーバー側。口 | 必须 |
| dir | 需要播放的文件夹编号 | 必须 |
| vol | 音量(0-100 或 0-28) | 可选 |
Reply:{"Code":0,"Msg":"ok"}
example 1:以 100% 音量播放 1 号文件夹(デフォルト IP/ポート)
Controller→播放器:http://192.168.168.254:7890/control/play?id=1&volume=100
播放器→Controller:{"Code":0,"Msg":"ok"}
example 2:停止播放(id=0)http://192.168.168.254:7890/control/play?id=0&volume=100
回复同上。
example 3:播放 2 号文件夹(不带音量)http://192.168.168.254:7890/control/play?id=2
回复同上。
設定音量
URL:http://{IP}:{port}/control/set?volume={value}
example:设为 90%http://192.168.168.254:7890/control/set?volume=90
Reply:{"Code":0,"Msg":"ok"}
設定播放モード
URL:http://{IP}:{port}/control/set?loopmode={value}
value:0=循环,1=单次
example:设为循环http://192.168.168.254:7890/control/set?loopmode=0
設定选中モード
URL:http://{IP}:{port}/control/set?selectmode={value}
value:0=顺序,1=随机
example:设为顺序http://192.168.168.254:7890/control/set?selectmode=0
設定是否允许忽略播放指令
URL:http://{IP}:{port}/control/set?ignorecmd={value}
value:0=不允许,1=允许
example:允许忽略http://192.168.168.254:7890/control/set?ignorecmd=1
查询播放器ステータス
URL:http://{IP}:{port}/control/get
回复サンプル:{"Volume":100,"SelectMode":0,"LoopMode":0,"IsIgnorePlayCmd":1,"State":2,"GroupId":2,"FileIndex":0,"Code":0}
Field Description:
| 字段名 | 説明 |
|---|---|
| Volume | 当前音量 |
| SelectMode | 当前选中モード(0顺序 1随机) |
| LoopMode | 当前播放モード(0循环 1单次) |
| IsIgnorePlayCmd | 是否允许忽略相同播放指令(0否 1是) |
| State | 当前播放ステータス(1停止 2播放中) |
| GroupId | 当前播放文件夹 |
| FileIndex | 当前文件索引(保留) |
| Code | Exception Code,デフォルト 0 |
serial port
Protocol:LD-SP2
合意書の概要
- フレーム形式:7 Byte head function param1 param2 param3 xor tail 头码 function code parameter1 parameter2 parameter3 xorcheck 尾码
- 头码:0x01
- 尾码:0x02
- xor Verification:前 5 Byte XOR
- 指令間隔:200 ms 以上。
协议指令
播放指令
Request:01 51 dir 00 volume xor 02
Reply:01 52 dir 00 volume xor 02
example:以 96% 音量播放 2 号文件夹
Controller→播放器(HEX):01 51 02 00 60 32 02
播放器→Controller(HEX):01 52 02 00 60 31 02
設定音量指令
Request:01 41 00 00 volume xor 02
Reply:01 42 00 00 volume xor 02
example 1:设为 10001 41 00 00 64 24 02
Reply:01 42 00 00 64 27 02
example 2:设为 2801 41 00 00 1C 5C 02
Reply:01 42 00 00 1C 5F 02
設定播放モード指令
Request:01 43 00 00 playback_mode xor 02
Reply:01 44 00 00 playback_mode xor 02
example:设为循环01 43 00 00 00 42 02
Reply:01 44 00 00 00 45 02
設定选中モード指令
Request:01 45 00 00 select_mode xor 02
Reply:01 46 00 00 select_mode xor 02
example:设为随机01 45 00 00 01 45 02
Reply:01 46 00 00 01 46 02
設定忽略播放指令
Request:01 47 00 00 ignore_play_cmd xor 02
Reply:01 48 00 00 ignore_play_cmd xor 02
example:有効忽略01 47 00 00 01 47 02
Reply:01 48 00 00 01 48 02
查询ステータス指令 1
Request:01 53 00 00 00 52 02
Reply:01 54 00 playback_state volume xor 02
example:
Controller→播放器:01 53 00 00 00 52 02
播放器→Controller:01 54 00 02 5A 37 02
→ status:播放中;音量:90
查询ステータス指令 2
Request:01 55 00 00 00 54 02
Reply:01 56 playback_mode select_mode ignore_play_cmd xor 02
example:
Controller→播放器:01 55 00 00 00 54 02
播放器→Controller:01 56 00 01 01 57 02
→ 播放モード:循环;选中モード:随机;忽略相同指令:是
查询ステータス指令 3
Request:01 57 00 00 00 56 02
Reply:01 58 dir 00 00 xor 02
example:
Controller→播放器:01 57 00 00 00 56 02
播放器→Controller:01 58 02 00 00 5B 02
→ 当前播放文件夹:2
Protocol:Modbus-RTU
(略,与 Modbus-TCP レジスタ定义完全一致,仅链路层改为 RTU,サンプル见原文)
CAN
Protocol:LD-CAN1
- フレーム形式:8 Byte header function param1 param2 param3 param4 xor tail 头码 function code parameter1 parameter2 parameter3 parameter4 xor 尾码
- 头码:0x01;尾码:0x02;xor:前 6 Byte XOR。
- フレーム ID 可トップマシン修改,出厂デフォルトリクエスト 0x200,Reply 0x201。
- 指令間隔:100 ms 以上。
(各指令フレーム形式与 LD-SP2 对应命令パラメータ完全一致,仅增加 param4 占位,详见原文サンプル)
Protocol:LD-CAN2
- フレーム形式:8 Byte,无尾码、无 xor,头码 0x01,其余保留 0x00。
- フレーム ID デフォルト:Request 0x200,Reply 0x201。
- 指令間隔:100 ms 以上。
(各指令与 LD-CAN1 相同,仅去掉 xor 与尾码,详见原文サンプル)
IO 入力
LD-INPUT1
- 触发条件:保持对应入力口触发ステータス。
- 入力タイプ:NPN/PNP 可配線選択。
- 8 位入力口ステータス决定文件夹编号(二进制加权,サポート 0~255,0 为停止)。
- サンプル表格及計算过程见原文。
LD-INPUT4
- 触发条件:至少 100 ms 脉冲信号。
- 其余ルール与 LD-INPUT1 相同,仅触发方式改为脉冲。
- サンプル表格及計算过程见原文。
Leave a Reply