Professional Documents
Culture Documents
3
Go to mySchneider Translate to: Please select
Help
Knowledge base
Search
Schneider Electric Community Knowledge Center Building Automation Knowledge Base SSL and Modbus functions
0 Likes 2832
Trying to translate this page to your language?
Issue
Modbus device in hand does not have a pre-configured widget in the device list of Building Expert. A script is required to communicate
with the device
Product Line
EcoStruxure Building Expert
Environment
SmartStruxure Lite Multi-Purpose Manager
Any modbus device
Cause
Pre-configured widget not available in the device list of Building Expert
Resolution
The MPM can only be a Modbus Master; meaning it can request information from other slave modbus devices, or write to them. Feedback
Terminals A and B on the MPM correspond to modbus terminals (Serial +) and (Serial -) respectively.
When using a script to communicate with modbus devices, the "Enable" box in the ModBus configuration object (MOD1) must be disabled
to allow the MPM to communicate with the devices using a script.
https://community.se.com/t5/Building-Automation-Knowledge/SSL-and-Modbus-functions/ta-p/1228 1/5
30/3/24, 22:05 SSL and Modbus functions - Schneider Electric Community
The modbus port should then be closed (in case it was left open) and re-opened using the following functions
********************************************************
@@@ Lua.modbus.close (Description and example here)
********************************************************
@@@ Lua.modbus.open (Description and example here)
********************************************************
The following are the standard modbus functions and their corresponding Lua functions used in the MPM
Modbus
Lua Function in MPM
Function Code
Function Code
modbus.coil_read
01
Function Code
modbus.di_read
02
Function Code modbus.hr_read (16-
03 bit)
Function Code
modbus.in_read
04
Function Code
N/A
05
Function Code
modbus.coil_write
15
Function Code
modbus.hr_write
06
The following are the 8 different modbus functions that can be used to read/write to registers from/to modbus devices Feedback
********************************************************
@@@ Lua.modbus.coil_read (Description and example here)
This function is equivalent to : [Function Code 01 (01 HEX)]
********************************************************
@@@ Lua.modbus.coil_write (Description and example here)
This function is equivalent to : [Function Code 15 (0F HEX)]
********************************************************
@@@ Lua.modbus.di_read (Description and example here)
https://community.se.com/t5/Building-Automation-Knowledge/SSL-and-Modbus-functions/ta-p/1228 2/5
30/3/24, 22:05 SSL and Modbus functions - Schneider Electric Community
********************************************************
@@@ Lua.modbus.hr_read (Description and example here)
This function is equivalent to : [Function Code 03 (03 HEX)]
********************************************************
@@@ Lua.modbus.hr_write (Description and example here)
This function is equivalent to : [Function Code 06 (06 HEX)]
********************************************************
@@@ Lua.modbus.in_read (Description and example here)
This function is equivalent to : [Function Code 04 (04 HEX)]
********************************************************
@@@ Lua.modbus.fp_read (Description and example here)
********************************************************
@@@ Lua.modbus.fp_write (Description and example here)
********************************************************
To read a floating-point (32-bit) value, the fp_read() function can be used. (Download script)
To read an unsigned long (32-bit) value the hr_read() function can be used, however, some data manipulation is required (Download script)
To read a floating-point (64-bit) value, the hr_read() function can be used. (Download script)
Attachments
Modbus_HR_Write.txt
Tags
Add tags
Related Forums
Contributors
DavidFisher
https://community.se.com/t5/Building-Automation-Knowledge/SSL-and-Modbus-functions/ta-p/1228 3/5
30/3/24, 22:05 SSL and Modbus functions - Schneider Electric Community
CraigEl
SaidSawan
Product_Support
Recommended Posts
Modbus Simulator
Invite a Colleague
Found this content useful? Share it with a Colleague!
Invite a Colleague
Feedback
FORUMS
KNOWLEDGE CENTER
https://community.se.com/t5/Building-Automation-Knowledge/SSL-and-Modbus-functions/ta-p/1228 4/5
30/3/24, 22:05 SSL and Modbus functions - Schneider Electric Community
IDEAS
BLOGS
GET STARTED
Feedback
https://community.se.com/t5/Building-Automation-Knowledge/SSL-and-Modbus-functions/ta-p/1228 5/5