Create
Creates a new Master instance.
Create()
Arguments
No arguments.
Output
Creates a new Master object.
Modbus master/client interface.
from Xenonix.Comm.Modbus import Master
Filter methods, arguments, and configuration keys on this page.
Use Config(...) with these keys where the class exposes configuration.
This object does not expose a public Config table.
Creates a new Master instance.
Create()
No arguments.
Creates a new Master object.
Adds a new item to the object or UI.
Add(ID, IP, Port=502, Unit_ID=None, Protocol='TCP')
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
IP |
Required | Any valid value | IP value used by the operation. |
Port |
502 |
Any valid value | Port value used by the operation. |
Unit_ID |
None |
Any valid value | Unit ID value used by the operation. |
Protocol |
'TCP' |
Any valid value | Protocol value used by the operation. |
Runs the operation. Some methods update the object in place.
Stops the process or connection.
Stop()
No arguments.
Returns success/status or the operation result.
Reads data from a file path.
Read(ID, Type, Start, Size)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Type |
Required | Coil, Discrete_Input, Holding_Register, Input_Register |
Mode/value selector for type. |
Start |
Required | Any valid value | Start value used by the operation. |
Size |
Required | Any valid value | Size value used by the operation or widget. |
Returns success/status or the operation result.
Writes the current data to a file path.
Write(ID, Type, Start, Size, Value, Broadcast=False)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Type |
Required | Coil, Holding_Register |
Mode/value selector for type. |
Start |
Required | Any valid value | Start value used by the operation. |
Size |
Required | Any valid value | Size value used by the operation or widget. |
Value |
Required | Any valid value | Value to set or process. |
Broadcast |
False |
Any valid value | Turns broadcast on or off. |
Returns success/status or the operation result.
Runs the Read_Exception_Status operation for Master.
Read_Exception_Status(ID)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Returns the calculated result.
Runs the Read_Device_Identification operation for Master.
Read_Device_Identification(ID, Read_Device_Id_Code=1, Object_Id=0)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Read_Device_Id_Code |
1 |
Any valid value | Read Device Id Code value used by the operation. |
Object_Id |
0 |
Any valid value | Object Id value used by the operation. |
Returns structured data such as a list or dictionary.
Runs the Diagnostics operation for Master.
Diagnostics(ID, Sub_Function=0, Data=b'')
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Sub_Function |
0 |
Any valid value | Sub Function value used by the operation. |
Data |
b'' |
Any valid value | Dataset path or dataset definition. |
Returns the calculated result.
Runs the Read_Comm_Event_Counter operation for Master.
Read_Comm_Event_Counter(ID)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Returns structured data such as a list or dictionary.
Runs the Read_Comm_Event_Log operation for Master.
Read_Comm_Event_Log(ID)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Returns structured data such as a list or dictionary.
Runs the Report_Server_Id operation for Master.
Report_Server_Id(ID)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Returns structured data such as a list or dictionary.
Runs the Mask_Write_Register operation for Master.
Mask_Write_Register(ID, Address, And_Mask, Or_Mask)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Address |
Required | Any valid value | Address value used by the operation. |
And_Mask |
Required | Any valid value | And Mask value used by the operation. |
Or_Mask |
Required | Any valid value | Or Mask value used by the operation. |
Returns True/False to indicate success.
Runs the Read_Write_Registers operation for Master.
Read_Write_Registers(ID, Read_Start, Read_Size, Write_Start, Write_Values)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Read_Start |
Required | Any valid value | Read Start value used by the operation. |
Read_Size |
Required | Any valid value | Read Size value used by the operation. |
Write_Start |
Required | Any valid value | Write Start value used by the operation. |
Write_Values |
Required | Any valid value | Write Values value used by the operation. |
Returns the calculated result.
Runs the Read_File_Record operation for Master.
Read_File_Record(ID, File_Number, Record_Number, Record_Length)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
File_Number |
Required | Any valid value | File Number value used by the operation. |
Record_Number |
Required | Any valid value | Record Number value used by the operation. |
Record_Length |
Required | Any valid value | Record Length value used by the operation. |
Returns structured data such as a list or dictionary.
Runs the Write_File_Record operation for Master.
Write_File_Record(ID, File_Number, Record_Number, Value_List)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
File_Number |
Required | Any valid value | File Number value used by the operation. |
Record_Number |
Required | Any valid value | Record Number value used by the operation. |
Value_List |
Required | Any valid value | Value List value used by the operation. |
Returns True/False to indicate success.
Runs the Read_Fifo_Queue operation for Master.
Read_Fifo_Queue(ID, Fifo_Address)
| Argument | Default | Accepted values | What it does |
|---|---|---|---|
ID |
Required | Any valid value | ID value used by the operation. |
Fifo_Address |
Required | Any valid value | Fifo Address value used by the operation. |
Returns structured data such as a list or dictionary.