Метод | Описание | |
---|---|---|
Dispose ( ) : void |
Destroy master instance
|
|
Master ( ) : System |
Create master instance without parameters.
|
|
Master ( string ip, ushort port ) : System |
Create master instance with parameters.
|
|
ReadCoils ( ushort id, ushort startAddress, ushort numInputs ) : void |
Read coils from slave asynchronous. The result is given in the response function.
|
|
ReadCoils ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void |
Read coils from slave synchronous.
|
|
ReadDiscreteInputs ( ushort id, ushort startAddress, ushort numInputs ) : void |
Read discrete inputs from slave asynchronous. The result is given in the response function.
|
|
ReadDiscreteInputs ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void |
Read discrete inputs from slave synchronous.
|
|
ReadHoldingRegister ( ushort id, ushort startAddress, ushort numInputs ) : void |
Read holding registers from slave asynchronous. The result is given in the response function.
|
|
ReadHoldingRegister ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void |
Read holding registers from slave synchronous.
|
|
ReadInputRegister ( ushort id, ushort startAddress, ushort numInputs ) : void |
Read input registers from slave asynchronous. The result is given in the response function.
|
|
ReadInputRegister ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void |
Read input registers from slave synchronous.
|
|
ReadWriteMultipleRegister ( ushort id, ushort startReadAddress, ushort numInputs, ushort startWriteAddress, byte values ) : void |
Read/Write multiple registers in slave asynchronous. The result is given in the response function.
|
|
ReadWriteMultipleRegister ( ushort id, ushort startReadAddress, ushort numInputs, ushort startWriteAddress, byte values, byte &result ) : void |
Read/Write multiple registers in slave synchronous. The result is given in the response function.
|
|
WriteMultipleCoils ( ushort id, ushort startAddress, ushort numBits, byte values ) : void |
Write multiple coils in slave asynchronous. The result is given in the response function.
|
|
WriteMultipleCoils ( ushort id, ushort startAddress, ushort numBits, byte values, byte &result ) : void |
Write multiple coils in slave synchronous.
|
|
WriteMultipleRegister ( ushort id, ushort startAddress, byte values ) : void |
Write multiple registers in slave asynchronous. The result is given in the response function.
|
|
WriteMultipleRegister ( ushort id, ushort startAddress, byte values, byte &result ) : void |
Write multiple registers in slave synchronous.
|
|
WriteSingleCoils ( ushort id, ushort startAddress, bool OnOff ) : void |
Write single coil in slave asynchronous. The result is given in the response function.
|
|
WriteSingleCoils ( ushort id, ushort startAddress, bool OnOff, byte &result ) : void |
Write single coil in slave synchronous.
|
|
WriteSingleRegister ( ushort id, ushort startAddress, byte values ) : void |
Write single register in slave asynchronous. The result is given in the response function.
|
|
WriteSingleRegister ( ushort id, ushort startAddress, byte values, byte &result ) : void |
Write single register in slave synchronous.
|
|
connect ( string ip, ushort port ) : void |
Start connection to slave.
|
|
disconnect ( ) : void |
Stop connection to slave.
|
Метод | Описание | |
---|---|---|
CallException ( ushort id, byte function, byte exception ) : void | ||
CreateReadHeader ( ushort id, ushort startAddress, ushort length, byte function ) : byte[] | ||
CreateReadWriteHeader ( ushort id, ushort startReadAddress, ushort numRead, ushort startWriteAddress, ushort numWrite ) : byte[] | ||
CreateWriteHeader ( ushort id, ushort startAddress, ushort numData, ushort numBytes, byte function ) : byte[] | ||
OnReceive ( System result ) : void | ||
OnSend ( System result ) : void | ||
WriteAsyncData ( byte write_data, ushort id ) : void | ||
WriteSyncData ( byte write_data, ushort id ) : byte[] |
public Master ( string ip, ushort port ) : System | ||
ip | string | IP adress of modbus slave. |
port | ushort | Port number of modbus slave. Usually port 502 is used. |
Результат | System |
public ReadCoils ( ushort id, ushort startAddress, ushort numInputs ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
Результат | void |
public ReadCoils ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
values | byte | Contains the result of function. |
Результат | void |
public ReadDiscreteInputs ( ushort id, ushort startAddress, ushort numInputs ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
Результат | void |
public ReadDiscreteInputs ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
values | byte | Contains the result of function. |
Результат | void |
public ReadHoldingRegister ( ushort id, ushort startAddress, ushort numInputs ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
Результат | void |
public ReadHoldingRegister ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
values | byte | Contains the result of function. |
Результат | void |
public ReadInputRegister ( ushort id, ushort startAddress, ushort numInputs ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
Результат | void |
public ReadInputRegister ( ushort id, ushort startAddress, ushort numInputs, byte &values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
values | byte | Contains the result of function. |
Результат | void |
public ReadWriteMultipleRegister ( ushort id, ushort startReadAddress, ushort numInputs, ushort startWriteAddress, byte values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startReadAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
startWriteAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
Результат | void |
public ReadWriteMultipleRegister ( ushort id, ushort startReadAddress, ushort numInputs, ushort startWriteAddress, byte values, byte &result ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startReadAddress | ushort | Address from where the data read begins. |
numInputs | ushort | Length of data. |
startWriteAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
result | byte | Contains the result of the synchronous command. |
Результат | void |
public WriteMultipleCoils ( ushort id, ushort startAddress, ushort numBits, byte values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numBits | ushort | Specifys number of bits. |
values | byte | Contains the bit information in byte format. |
Результат | void |
public WriteMultipleCoils ( ushort id, ushort startAddress, ushort numBits, byte values, byte &result ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
numBits | ushort | Specifys number of bits. |
values | byte | Contains the bit information in byte format. |
result | byte | Contains the result of the synchronous write. |
Результат | void |
public WriteMultipleRegister ( ushort id, ushort startAddress, byte values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
Результат | void |
public WriteMultipleRegister ( ushort id, ushort startAddress, byte values, byte &result ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
result | byte | Contains the result of the synchronous write. |
Результат | void |
public WriteSingleCoils ( ushort id, ushort startAddress, bool OnOff ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
OnOff | bool | Specifys if the coil should be switched on or off. |
Результат | void |
public WriteSingleCoils ( ushort id, ushort startAddress, bool OnOff, byte &result ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address from where the data read begins. |
OnOff | bool | Specifys if the coil should be switched on or off. |
result | byte | Contains the result of the synchronous write. |
Результат | void |
public WriteSingleRegister ( ushort id, ushort startAddress, byte values ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
Результат | void |
public WriteSingleRegister ( ushort id, ushort startAddress, byte values, byte &result ) : void | ||
id | ushort | Unique id that marks the transaction. In asynchonous mode this id is given to the callback function. |
startAddress | ushort | Address to where the data is written. |
values | byte | Contains the register information. |
result | byte | Contains the result of the synchronous write. |
Результат | void |
public connect ( string ip, ushort port ) : void | ||
ip | string | IP adress of modbus slave. |
port | ushort | Port number of modbus slave. Usually port 502 is used. |
Результат | void |