Back to Aurora Vision Library website

You are here: Start » Function Reference » System » Modbus TCP » ModbusTCP_Connect

ModbusTCP_Connect


Header: STD.h
Namespace: avl
Module: FoundationLite

Connects as a client to a remote Modbus server socket.

Syntax

void avl::ModbusTCP_Connect
(
	TcpIpConnectState& ioState,
	const atl::String& inHost,
	int inPort,
	const atl::Optional<int>& inTimeout,
	const atl::Optional<int>& inKeepAliveTime,
	atl::Conditional<avl::SocketId>& outSocket
)

Parameters

Name Type Range Default Description
Input will be modified ioState TcpIpConnectState& Object used to maintain state of the function.
Input value inHost const String& \"localhost\" The hostname or IP address to connect to.
Input value inPort int 7 - 65535 502 Modbus port of host to connect to. 502 is the default one.
Input value inTimeout const Optional<int>& 500 - NIL Timeout in milliseconds, block if not specified.
Input value inKeepAliveTime const Optional<int>& 2000 - NIL When specified activates Tcp/Ip keep alive on new socket with given idle time.
Output value outSocket Conditional<SocketId>& Connected socket ID.

Description

For more details please check help of TcpIp_Connect filter. The filters works in the same way.

See Also