Modbus RTU MP3 player (sound module)

img 20210929 1109499

Product page: Modbus RTU MP3 player (sound module)

The main purpose of the module is providing sound effects in automation systems operated by PLC (programmable logic controllers) or PC software (for example in entertainment (sound effects in escape rooms, haunted houses) and sound notification systems).

The module can be operated with standard Modbus RTU commands set. Commands examples provided in this description can be realized with standard software supplied with the device, or with other software/PLC which supports Modbus RTU protocol.

  1. BAUD RATE AND MODBUS ADDRESS SETTINGS

Default Modbus address of each module is 0х01 (1) and the default baud rate is 9600. In order to change those setting the standard software can be used as well as you can form the setting parcel with other software using data below:

Baud rate setting byte:

0х00

2400

0х01

4800

0х02

9600

0х03

19200

0х04

28800

0х05

38400

0х06

56000

0х07

57600

0х08

115200

0х09

128000

0х0A

256000

 

Example 1.1: Baud rate changing

Module address

Modbus function

Register address

Module address

Needed port settings

MODBUS CRC-16

0x01

0x06

0x00

0x00

0x01

0x02

0x09

0x9B

               

Answer: Module address set as 0x01, baud rate 9600

Module address

Modbus function

Register address

Module address

New port settings

MODBUS CRC-16

0x01

0x06

0x00

0x00

0x01

0x02

0x09

0x9B

               

 

Example 1.2: Module address changing

Module address

Modbus function

Register address

Needed module address

Port settings

MODBUS CRC-16

0x01

0x06

0x00

0x00

0x0F

0x02

0x0D

0xFB

               

Answer: Module address set as 0x0F (15), baud rate 9600

Module address

Modbus function

Register address

New module address

Port settings

MODBUS CRC-16

0x01

0x06

0x00

0x00

0x0F

0x02

0x0D

0xFB

               

 

It’s important to note that after changing these setting the module will be available with new baud rate and address only, so make sure the new settings will be known to you afterwards.

After receiving the parcel the module counts MODBUS CRC-16 and on if it does not match, the module returns answer:

 

Example 1.3: Answer from module informing about an error (wrong CRC-16 or damaged message received)

E

r

r

o

r

!

MODBUS CRC-16

0x45

0x72

0x72

0x6F

0x72

0x21

0xF9

0x58

  1. PLAYEr control

The module plays files placed on micro SD card. For correct job the files are to be placed in folders named «01», «02» and so on till «99» and/or in the folder named «MP3» and files named «0001», «0002» and so on till «9999».

The playing functions can be called with standard software or with any Modbus RTU compatible PLC/software using the data and examples below:

Register address

Command

Data range

0x0005

Play once a file with a name “…” from a folder named “MP3”

File name «0001» … «9999»

0x0006

Play all the files from a folder named “” cyclically

Folder name «01» … «99»

0x0007

Play once a file with a name “…” from a folder named “…”

Folder name «01» … «15»

File name «0001» … «4095»

0x0008

Set volume level

0…31

0x0009

Change volume level by 1 step

0х01 reduce volume by 1 step 1, 0х02 – increase volume level by 1 step

0x000A

Pause/continue playing

0х00 – pause, 0х01 – continue

0x000B

Stop

0х00 – stop

0x000C

Equalizer

0x00-Normal, 0x01-Pop, 0x02-Rock, 0x03-Jazz, 0x04-Classic, 0x05-Bass

0x000D

Reset module

0x00 - Reset

Example 2.1: Play file «0001» in folder «MP3»

Modbus address

Modbus function

Register address

File name

MODBUS CRC-16

0x01

0x06

0x00

0x05

0x00

0x01

0x58

0x0B

               

Answer:

Modbus address

Modbus function

Register address

File name

MODBUS CRC-16

0x01

0x06

0x00

0x05

0x00

0x01

0x58

0x0B

               

Example 2.2: Play file «0383» in folder «MP3»

Modbus address

Modbus function

Register address

File name

MODBUS CRC-16

0x01

0x06

0x00

0x05

0x01

0x7F

0xD9

0xBB

               

Answer:

Modbus address

Modbus function

Register address

File name

MODBUS CRC-16

0x01

0x06

0x00

0x05

0x01

0x7F

0xD9

0xBB

               

Example 2.3: Play all the files from a folder named «48» cyclically

Modbus address

Modbus function

Register address

Folder name

MODBUS CRC-16

0x01

0x06

0x00

0x06

0x00

0x30

0x69

0xDF

               

Answer:

Modbus address

Modbus function

Register address

Folder name

MODBUS CRC-16

0x01

0x06

0x00

0x06

0x00

0x30

0x69

0xDF

               

Example 2.4: Play file «3000» in folder «05»

Modbus address

Modbus function

Register address

Folder and file names

MODBUS CRC-16

0x01

0x06

0x00

0x07

0x5B

0xB8

0x03

0x49

               

Answer:

Modbus address

Modbus function

Register address

Folder and file names

MODBUS CRC-16

0x01

0x06

0x00

0x07

0x5B

0xB8

0x03

0x49

               

Example 2.5: Play file  «0002» in folder «15»

Modbus address

Modbus function

Register address

Folder and file names

MODBUS CRC-16

0x01

0x06

0x00

0x07

0xF0

0x02

0xFD

0xCA

               

Answer:

Modbus address

Modbus function

Register address

Folder and file names

MODBUS CRC-16

0x01

0x06

0x00

0x07

0xF0

0x02

0xFD

0xCA

               

Example 2.6: Set volume level equal 30

Modbus address

Modbus function

Register address

Volume level

MODBUS CRC-16

0x01

0x06

0x00

0x08

0x00

0x1E

0x88

0x00

               

Answer:

Modbus address

Modbus function

Register address

Volume level

MODBUS CRC-16

0x01

0x06

0x00

0x08

0x00

0x1E

0x88

0x00

               

Example 2.7: Increase volume level by 1 step

Modbus address

Modbus function

Register address

Increase/reduce volume

MODBUS CRC-16

0x01

0x06

0x00

0x09

0x00

0x02

0xD8

0x09

               

Answer:

Modbus address

Modbus function

Register address

Increase/reduce volume

MODBUS CRC-16

0x01

0x06

0x00

0x09

0x00

0x02

0xD8

0x09

               

Example 2.8: Decrease volume level by 1 step

Modbus address

Modbus function

Register address

Increase/reduce volume

MODBUS CRC-16

0x01

0x06

0x00

0x09

0x00

0x01

0x98

0x08

               

Answer:

Modbus address

Modbus function

Register address

Increase/reduce volume

MODBUS CRC-16

0x01

0x06

0x00

0x09

0x00

0x01

0x98

0x08

               

Example 2.9: Pause playing

Modbus address

Modbus function

Register address

Pause

MODBUS CRC-16

0x01

0x06

0x00

0x0A

0x00

0x00

0xA9

0xC8

               

Answer:

Modbus address

Modbus function

Register address

Pause

MODBUS CRC-16

0x01

0x06

0x00

0x0A

0x00

0x00

0xA9

0xC8

               

Example 2.10: Continue playing (use after pause)

Modbus address

Modbus function

Register address

Cancel pause

MODBUS CRC-16

0x01

0x06

0x00

0x0A

0x00

0x01

0x68

0x08

               

Answer:

Modbus address

Modbus function

Register address

Cancel pause

MODBUS CRC-16

0x01

0x06

0x00

0x0A

0x00

0x01

0x68

0x08

               

Example 2.11: Stop playing

Modbus address

Modbus function

Register address

Stop

MODBUS CRC-16

0x01

0x06

0x00

0x0B

0x00

0x00

0xF8

0x08

               

Answer:

Modbus address

Modbus function

Register address

Stop

MODBUS CRC-16

0x01

0x06

0x00

0x0B

0x00

0x00

0xF8

0x08

               

Example 2.12: Set equalizer to «Rock» mode

Modbus address

Modbus function

Register address

Style

MODBUS CRC-16

0x01

0x06

0x00

0x0C

0x00

0x02

0xC8

0x08

               

Answer:

Modbus address

Modbus function

Register address

Style

MODBUS CRC-16

0x01

0x06

0x00

0x0C

0x00

0x02

0xC8

0x08

               

Example 2.13: Reset player

Modbus address

Modbus function

Register address

Reset

MODBUS CRC-16

0x01

0x06

0x00

0x0D

0x00

0x00

0x18

0x09

               

Answer:

Modbus address

Modbus function

Register address

Reset

MODBUS CRC-16

0x01

0x06

0x00

0x0D

0x00

0x00

0x18

0x09