9 recvl% function – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 118

8Ć8
8.9
RECVL% Function
Format:
RECVL%( sn%, list! )
where:
sn%
is the number of the socket through which the
message is to be received. 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.
list!
is a single dimension double integer array whose
size is limited only by memory capacity. The values
in this array define where to put the data to
received. No subscript is given on this parameter.
Beginning at list!(0), the even elements of the array
contain pointers to where to put the data and odd
elements of the array contain the number of bytes
to accept. The number of bytes must be even. The
value for pointers is found with the VARPTR! or
FINDVAR! function. The list is terminated by a
pointer with a value of zero at the even boundary.
This function receives data from socket SN% into memory pointed
to by the list. All pointers must reference variables defined as I/O.
Pointers may not reference variables defined in the Common
Memory Module or AutoMax Processor.
If a TCP socket is specified, it must be connected first.
A socket can be selected as blocking or nonĆblocking. If the socket
is blocking and no data has come in, the task will be suspended
until data arrives. If the socket is nonĆblocking and no data has
come in, the RECVL% command will return with the error No
message waiting. The default mode is blocking.
Values Returned:
>0
Number of bytes transferred
-2
ENI not initialized
-9
No buffer space
-15 Bad socket number
-17 Message too long
-18 Zero length
-19 Illegal pointer
-25 Not a double integer array
-26 Not a single dimension array
-27 Bad array format
-30 Odd number of bytes in list parameter
-101 No message waiting
-102 Socket not connected
For example:
RECV_LEN% = RECVL%( SN%, NETWORK_LIST! )