LINPUTB (Statement) [Version 1.5 or later]


Inputs more than one byte of data through an RS232C or Ethernet port.


linputb[#<portnumber>,]<arrayheadelement>,<inputbytes>[, WTIME=<timeout>[,RVAL=<restore variable>]]
<portnumber>
Input port number.
(1: controller's RS232C port, -1: µVision board's RS232C port, 4-7: Ethernet server ports, 8-15: Ethernet client ports)
Default: 1 (controller's RS232C port)
<arrayheadelement>
First element of the array into which the input data is to be stored.
<inputbytes>
Number of bytes in the input data
<timeout> Version 2.2 or later
If the actual input data for the variable is shorter than the specified number of bytes, the system will wait for the specified timeout period, and after that, it will terminate the processing of this linputb statement and will pass control to the next command. The timeout period should be specified in ms (milliseconds). In practice, however, the actual wait time is incremented every 1/60 of a second.
<restore variable> Version 2.2 or later
This parameter is used in conjunction with <timeout>. If the processing of a variable is normally completed by data received, then TRUE (1) will be stored into the specified restore variable; if it terminates as a result of a timeout, FALSE (0) will be stored.


This command inputs the specified number of bytes through the specified port into the destination array starting at the specified array element.
NOTE: If you have not specified a timeout length for this command, a shortage of data at the specified port (the actual data length is shorter than the specified number of input bytes) would result in an endless wait. To check whether data actually exists, issue a com_state command.


'!TITLE "<title>"
PROGRAM sample
defint 1i
·
·
·
LINPUTB #1,I64,30
'Input data into I64 to I93 from RS232C port.
linput #1, I64, 30,WTIME=100,RVAL=1i
'If the actual length of data is shorter than the
'specified number of input bytes, wait for 100 ms,
'after that, terminate processing of this LINPUTB
'and pass control to the next command. Store "0"
'into l1, indicating that the processing has
'terminated because of timeout.
·
·
·
END


Top