Comm.Modbus

Master

Modbus master/client interface.

16 public methods

Import

from Xenonix.Comm.Modbus import Master

Search this API

Filter methods, arguments, and configuration keys on this page.

Configuration

Use Config(...) with these keys where the class exposes configuration.

This object does not expose a public Config table.

Public methods

Create

Creates a new Master instance.

Create()

Arguments

No arguments.

Output

Creates a new Master object.

Add

Adds a new item to the object or UI.

Add(ID, IP, Port=502, Unit_ID=None, Protocol='TCP')

Arguments

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.

Output

Runs the operation. Some methods update the object in place.

Stop

Stops the process or connection.

Stop()

Arguments

No arguments.

Output

Returns success/status or the operation result.

Read

Reads data from a file path.

Read(ID, Type, Start, Size)

Arguments

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.

Output

Returns success/status or the operation result.

Write

Writes the current data to a file path.

Write(ID, Type, Start, Size, Value, Broadcast=False)

Arguments

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.

Output

Returns success/status or the operation result.

Read_Exception_Status

Runs the Read_Exception_Status operation for Master.

Read_Exception_Status(ID)

Arguments

Argument Default Accepted values What it does
ID Required Any valid value ID value used by the operation.

Output

Returns the calculated result.

Read_Device_Identification

Runs the Read_Device_Identification operation for Master.

Read_Device_Identification(ID, Read_Device_Id_Code=1, Object_Id=0)

Arguments

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.

Output

Returns structured data such as a list or dictionary.

Diagnostics

Runs the Diagnostics operation for Master.

Diagnostics(ID, Sub_Function=0, Data=b'')

Arguments

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.

Output

Returns the calculated result.

Read_Comm_Event_Counter

Runs the Read_Comm_Event_Counter operation for Master.

Read_Comm_Event_Counter(ID)

Arguments

Argument Default Accepted values What it does
ID Required Any valid value ID value used by the operation.

Output

Returns structured data such as a list or dictionary.

Read_Comm_Event_Log

Runs the Read_Comm_Event_Log operation for Master.

Read_Comm_Event_Log(ID)

Arguments

Argument Default Accepted values What it does
ID Required Any valid value ID value used by the operation.

Output

Returns structured data such as a list or dictionary.

Report_Server_Id

Runs the Report_Server_Id operation for Master.

Report_Server_Id(ID)

Arguments

Argument Default Accepted values What it does
ID Required Any valid value ID value used by the operation.

Output

Returns structured data such as a list or dictionary.

Mask_Write_Register

Runs the Mask_Write_Register operation for Master.

Mask_Write_Register(ID, Address, And_Mask, Or_Mask)

Arguments

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.

Output

Returns True/False to indicate success.

Read_Write_Registers

Runs the Read_Write_Registers operation for Master.

Read_Write_Registers(ID, Read_Start, Read_Size, Write_Start, Write_Values)

Arguments

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.

Output

Returns the calculated result.

Read_File_Record

Runs the Read_File_Record operation for Master.

Read_File_Record(ID, File_Number, Record_Number, Record_Length)

Arguments

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.

Output

Returns structured data such as a list or dictionary.

Write_File_Record

Runs the Write_File_Record operation for Master.

Write_File_Record(ID, File_Number, Record_Number, Value_List)

Arguments

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.

Output

Returns True/False to indicate success.

Read_Fifo_Queue

Runs the Read_Fifo_Queue operation for Master.

Read_Fifo_Queue(ID, Fifo_Address)

Arguments

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.

Output

Returns structured data such as a list or dictionary.