GetA2 channel, arrayName, byteLength, stopChar
|channel||RS-232 Channel (1 to 3)|
|arrayName||Array to store received data (Byte type only)|
|byteLength||Number of bytes to store (1 to 65535)|
|stopChar||Stop character ASCII code|
GetA2 is the same as GetA except it will stop reading data at the when it encounters stopChar, even if the data received is less than byteLength. If stopChar is not found, then it will operate just like GetA.
stopChar is included in the received data.
You can use the Sys(1) command to check the number of bytes read:
Dim A(10) As Byte OpenCom 1,19200,0,50,10 GetA2 1,A,20,10 ' Read until stop character ASCII code 10 is found or 20 bytes have been read