.

Average: 0
Rating Count: 0

Development status: Released, Release: latest
Information status: Updated
Repository: http://svn.code.sf.net/p/tango-ds/code/DeviceClasses/Communication/Modbus
Contact:



Class Description


A Class to handle the modbus protocol over TCP/IP or Serial (RTU).

Families: Communication

Key words:

Platform: All Platforms

Language: Cpp

License: GPL

Contact:

Hardware


Manufacturer: none

Bus: Modbus

Class interface


Attributes:

Commands:

Name Description
StateInput: DevVoid
Output: State
Device state
This command gets the device state (stored in its device_state data member) and returns it to the caller.
StatusInput: DevVoid
Output: ConstDevString
Device status
This command gets the device status (stored in its device_status data member) and returns it to the caller.
ForceSingleCoilInput: DevVarShortArray
aring[0] = coil address argin[1] = coil value (0/1)
Output: DevVoid
Write single coil (digital I/O) state.
ReadCoilStatusInput: DevShort
Coil address
Output: DevShort
Coil status (0/1)
Read coil (digital I/O) status
ReadInputStatusInput: DevVarShortArray
argin[0] = Input address argin[1] = number of inputs
Output: DevVarCharArray
argout[0..n-1] = Input status (0/1)
Read discrete input status. Return one boolean per array element.
ReadHoldingRegistersInput: DevVarShortArray
aring[0] = Register start address argin[1] = Number of registers
Output: DevVarShortArray
argout[0..n-1] Holding 16bits registers.
Read multiple 16bits registers.
ReadInputRegistersInput: DevVarShortArray
argin[0] = Register start address argin[1] = Number of registers
Output: DevVarShortArray
argout[0..n-1] = Input 16bits registers
Read Multiple 16bits input registers.
PresetSingleRegisterInput: DevVarShortArray
argin[0] = Register address argin[1] = Register value
Output: DevVoid
Write single 16bits register.
FetchCommEventCtrInput: DevVoid
Output: DevVarShortArray
argout[0] = Status argout[1] = Event count
Fetch communications event counter.
ForceMultipleCoilsInput: DevVarShortArray
argin[0] = Coil start address argin[1] = Number of coil argin[2..n+1] = Coil values
Output: DevVoid
ReadMultipleCoilsStatusInput: DevVarShortArray
argin[0] = Coil start address argin[1] = Number of coils
Output: DevVarShortArray
argout[0..n-1] = Coil values
Read multiple coil (digital I/O) status.
PresetMultipleRegistersInput: DevVarShortArray
argin[0] = Register start address argin[1] = Number of register argin[2..n+1] = Register values
Output: DevVoid
Write multiple 16bits registers.
MaskWriteRegisterInput: DevVarShortArray
argin[0] = Register address argin[1] = AND mask argin[2] = OR mask
Output: DevVoid
Mask write a 16bits register.
ReadWriteRegisterInput: DevVarShortArray
argin[0] = Read start address argin[1] = Number of registers to read argin[2] = Write start address argin[3] = Number of registers to write argin[4..n+3] = Register values
Output: DevVarShortArray
argout[0..n-1] = Register values
Read and Write multiple 16bits registers.
PresetSingleRegisterBroadcastInput: DevVarShortArray
argin[0] = Register address argin[1] = Register value
Output: DevVoid
Write single 16bits register at node 0 (Node reserved for broadcast for RTU protocol on RS485 line) Does not wait for the equipment response.
ReadExceptionStatusInput: DevVoid
Output: DevShort
Exception status
Read exception status (usually a predefined range of 8 bits

Pipes:

Properties:

Name Description
ProtocolDevString RTU => Binary serial communication. TCP => Communication over ethernet.
IphostDevString The host IP address used with the TCP protocol
SeriallineDevString The name of the serial line device used with RTU protocol
AddressDevShort Node index used with the RTU or TCP protocol
CacheConfigArray of DevString Describe which data has to be cached. Each set of cached data is described by 3 parameters which are: 1 - Command to be used to read data (ReadHoldingRegisters, ReadInputStatus ReadInutRegisters or ReadMultipleCoilStatus) 2 - First address to be read 3 - Number of data to read
CacheSleepDevLong Cache update thread main loop sleeping time (in ms)CacheSleep
TCPConnectTimeoutDevDouble TCP connection timeout (in sec)
TCPTimeoutDevDouble Timeout used when the TCP protocol is used (in sec)
LogFileDevString Name of the file where are stored invalid frame
TCPNoDelayDevBoolean Disable or enable Nagle`s algorithm.
TCPQuickAckDevBoolean Set this property to true to enable TCP quick acknowledgements
NumberOfRetryDevShort Number Of Retry for all command in case failed.
SleepBetweenRetryDevShort Sleep Between Retry in Miliseconds
TCPKeepAliveDevBoolean Allow to enable/disable the TCP Keep Alive socket option. Defaults to False.
PortDevShort The port of the host modbus connection for the TCP protocol. Defaults to 502


Please log in to comment.

29 Jan 2022, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



29 May 2021, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



29 Jun 2019, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



23 Mar 2019, DS Admin
Updated:
The device class has been updated.
You can see previous version here .



23 Feb 2017, Piotr Goryl
Updated:
The device class has been updated.
You can see previous version here .



19 Jan 2017, Piotr Goryl
Updated:
The device server has been updated.
You can see previous version here .



3 Jan 2017, Piotr Goryl
Created:
The device server has been added to catalogue.
Added by:pgoryl2 on:3 Jan 2017, 1:49 p.m.