6 send% function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 115

8Ć5
8.6
SEND% Function
Format:
SEND%( sn%, var, len% )
where:
sn%
is the number of the socket through which the
message is to be sent. This is the value that was
returned from the SOCKET% or ACCEPT%
function. This can be specified as a simple variable
or as an element of an array.
var
is the variable that has the data to send. It can be a
boolean, integer, double integer, real, string, or an
array of these types. It may be local or common. If
an array is specified, no subscript may be given. It
will always start with the zeroth element of the
array.
len%
is the number of bytes to send beginning at var.
This parameter can be a constant, an integer, or a
double integer.
If var is an array, and len% is zero, the length to
send is the size of the array. An error is generated if
len% is greater than the size of the array.
This function causes a message to be sent to the destination as
defined by the socket number.
If a TCP socket is specified, it must be connected. If the connection
was established with an ACCEPT%, the destination is the station
that established the connection.
Values Returned:
>0
Number of bytes transferred
-2
ENI not initialized
-9
No buffer space
-15 Bad socket number
-17 Message too long, UDP > 1472, ETH > 1500
-18 Zero length for nonĆarray
-26 Array is not single dimension
-32 Beyond end of array
-102 Socket not connected
For example:
XMIT_LEN% = SEND%( SN%, SET_POINTS%, MSG_LEN% )
where SET_POINTS% is the name of an array.