Commands and functions
P.
240 of 349
Sendtcparray
Definition
●
Function
sendtcparray
(
port, ip, arg,Nr
)
Arguments
●
Argument
port
of data type u16
●
Argument
ip
of data type u32 (the receiver's address in the usual notation, e.g.
192.168.22.100)
●
arg
of data type c1400
●
Nr
of data type u16
Effect
●
Argument
port
is the destination port of the data sent by the Enertex
®
EibPC.
●
Received “user data” start with the 3rd argument. Their number and data type is arbitrary.
●
The IP address (variable
ip
) is defined in the usual notation (xxx.xxx.xxx.xxx with xxx:
number between 0 and 255).
●
If your LAN device can be addressed by a name and DNS, the function
resolve
can
replace an explicit IP address.
●
Sends
Nr
Bytes of
arg
via TCP/IP Protocol.
Data type result (Return)
●
none
Example: Send TCP telegrams
Every 2 minutes, a TCP telegram shall be sent by the Enertex
®
EibPC to the port 5555u16 of
the receiver www.enertex.de. The user data to be transmitted is the first 5 Bytes of the string
“I'm still alive”.
The socket is already open and ready to send (IP and port).
Implementation in the user program:
Count=0u32
if cycle(2,00) then sendtcparray(5555u16,resolve($www.enertex.de$),$I'm still alive$,5u16)
endif
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]