点击或拖拽改变大小

ModbusTcpServer 属性

ModbusTcpServer 类型公开以下成员。

属性
  名称说明
公共属性ActiveTimeSpan
获取或设置两次数据交互时的最小时间间隔,默认为24小时。如果超过该设定的时间不进行数据交互,服务器就会强制断开当前的连接操作。
Get or set the minimum time interval between two data interactions, the default is 24 hours. If the data exchange is not performed for more than the set time, the server will forcibly disconnect the current connection operation.
(继承自 DeviceServer。)
公共属性代码示例ByteTransform
当前的数据变换机制,当你需要从字节数据转换类型数据的时候需要。
The current data transformation mechanism is required when you need to convert type data from byte data.
(继承自 DeviceCommunication。)
公共属性CommunicationPipe
获取或设置当前的管道信息,管道类型为CommunicationPipe的继承类,内置了PipeTcpNet管道,PipeUdpNet管道,PipeSerialPort管道等
(继承自 BinaryCommunication。)
公共属性ConnectionId
当前连接的唯一ID号,默认为长度20的guid码加随机数组成,方便列表管理,也可以自己指定
The unique ID number of the current connection. The default is a 20-digit guid code plus a random number.
(继承自 BinaryCommunication。)
公共属性DataFormat
获取或设置数据解析的格式,可选ABCD, BADC,CDAB,DCBA格式,对int,uint,float,double,long,ulong类型有作用
Get or set the format of the data analysis, optional ABCD, BADC, CDAB, DCBA format, effective for int, uint, float, double, long, ulong type
公共属性EnableIPv6
获取或设置服务器是否支持IPv6的地址协议信息
Get or set whether the server supports IPv6 address protocol information
(继承自 DeviceServer。)
公共属性EnableWrite
获取或设置当前的服务器是否允许远程客户端进行写入数据操作,默认为True
Gets or sets whether the current server allows remote clients to write data, the default is True
(继承自 DeviceServer。)
公共属性EnableWriteMaskCode
获取或设置当前掩码写入的功能码是否激活状态,设置为 false 时,再执行写入位时,会通过读字,修改位,写字的方式来间接实现。
When the function code is set to false, and then the write bit is executed, it will be indirectly implemented by reading, modifying the bit, and writing the word.
公共属性ForceSerialReceiveOnce
获取或设置当前的服务器接收串口数据时候,是否强制只接收一次数据,默认为false,适合点对点通信,如果你总线形式的连接,则需要设置 True
Get or set whether to force the data to be received only once when the current server receives serial port data. The default value is false, which is suitable for point-to-point communication. If you have a bus connection, you need to set True
(继承自 DeviceServer。)
公共属性IsStarted
服务器引擎是否启动
Whether the server engine is started
(继承自 DeviceServer。)
公共属性IsStringReverse
字符串数据是否按照字来反转,默认为False
Whether the string data is reversed according to words. The default is False.
公共属性IsTcpMode
获取当前的服务器是TCP的服务器还是UDP的服务器
Gets whether the current server is a TCP server or a UDP server
(继承自 DeviceServer。)
公共属性代码示例LogNet
组件的日志工具,支持日志记录,只要实例化后,当前网络的基本信息,就以DEBUG等级进行输出
The component's logging tool supports logging. As long as the instantiation of the basic network information, the output will be output at DEBUG
(继承自 BinaryCommunication。)
公共属性OnlineCount
获取在线的客户端的数量
Get the number of clients online
(继承自 DeviceServer。)
公共属性Port
获取或设置服务器的端口号,如果是设置,需要在服务器启动前设置完成,才能生效。
Gets or sets the port number of the server. If it is set, it needs to be set before the server starts to take effect.
(继承自 DeviceServer。)
公共属性代码示例ReceiveTimeOut
获取或设置接收服务器反馈的时间,如果为负数,则不接收反馈
Gets or sets the time to receive server feedback, and if it is a negative number, does not receive feedback
(继承自 BinaryCommunication。)
公共属性RequestDelayTime
获取或设置两次请求直接的延时时间,单位毫秒,默认是0,不发生延时,设置为20的话,可以有效防止有客户端疯狂进行请求而导致服务器的CPU占用率上升。
Get or set the direct delay time of two requests, in milliseconds, the default is 0, no delay occurs, if it is set to 20, it can effectively prevent the client from making crazy requests and causing the server's CPU usage to increase.
公共属性SendBeforeHex
获取或设置在发送通信报文前追加发送的字节信息,HEX格式,通常用于lora组网时,需要携带 00 00 00 02 四个字节的站地址功能。
Obtain or set the byte information sent before sending communication packets, HEX format, usually used for LORA networking, you need to carry 00 00 00 02 four-byte station address function.
(继承自 BinaryCommunication。)
公共属性SerialReceiveAtleastTime
获取或设置串口模式下,接收一条数据最短的时间要求,当设备发送的数据非常慢的时候,或是分割发送数据的时候,就需要将本值设置的大一点,默认为20ms
Get or set the shortest time required to receive a piece of data in serial port mode. When the data sent by the device is very slow, or when the data is divided and sent, you need to set this value to a larger value, the default is 20ms
(继承自 DeviceServer。)
公共属性SleepTime
获取或设置在正式接收对方返回数据前的时候,需要休息的时间,当设置为0的时候,不需要休息。
Get or set the time required to rest before officially receiving the data from the other party. When it is set to 0, no rest is required.
(继承自 BinaryCommunication。)
公共属性SocketKeepAliveTime
获取或设置客户端的Socket的心跳时间信息,这个是Socket底层自动实现的心跳包,不基于协议层实现。默认小于0,不开启心跳检测,如果需要开启,设置 60_000 比较合适,单位毫秒
Get or set the heartbeat time information of the Socket of the client. This is the heartbeat packet automatically implemented by the bottom layer of the Socket, not based on the protocol layer. The default value is less than 0, and heartbeat detection is not enabled. If you need to enable it, it is more appropriate to set 60_000, in milliseconds.
(继承自 DeviceServer。)
公共属性Station
获取或者重新修改服务器的默认站号信息,当然,你可以再读写的时候动态指定,例如地址 "s=2;100", 更详细的例子可以参考DEMO界面上的地址示例。
Get or re-modify the server's default station number information, of course, you can dynamically specify when reading and writing, such as the address "s=2; 100", a more detailed example can refer to the DEMO interface address example.
公共属性StationCheck
获取或设置是否对站号进行检测,当服务器只有一个站号的时候,设置为True表示客户端请求站号和服务器不一致的时候,拒绝返回数据给客户端,反之,始终会返回数据给客户端。
When the server has only one station number, setting True means that when the client requests that the station number is inconsistent with the server, it refuses to return data to the client, and vice versa, it will always return data to the client.
公共属性StationDataIsolation
获取或设置是否启动站点数据隔离功能,默认为 False,也即虚拟服务器模拟一个站点服务器,客户端使用正确的站号才能通信。 当设置为 True 时,虚拟服务器模式256个站点,无论客户端使用的什么站点,都能读取或是写入对应站点里去。服务器同时也可以访问任意站点自身的数据。
Get or set whether to enable the site data isolation function, the default is False, that is, the virtual server simulates a site server, and the client can communicate with the correct site number. When set to True, 256 sites in virtual server mode, no matter what site the client uses, can read or write to the corresponding site.The server can also access any site's own data.
公共属性UseModbusRtuOverTcp
获取或设置当前的TCP服务器是否使用modbus-rtu报文进行通信,如果设置为 True,那么客户端需要使用 ModbusRtuOverTcp
Get or set whether the current TCP server uses modbus-rtu messages for communication. If it is set to True, then the client needs to use ModbusRtuOverTcp
受保护的属性WordLength
一个字单位的数据表示的地址长度,西门子为2,三菱,欧姆龙,modbusTcp就为1,AB PLC无效
The address length represented by one word of data, Siemens is 2, Mitsubishi, Omron, modbusTcp is 1, AB PLC is invalid
(继承自 DeviceCommunication。)
Top
参见