variable = GetStr(channel, byteLength, stopChar)
|variable||String Variable to store results|
|byteLength||Length of data to receive|
|stopChar||Stop character ASCII code|
Same as the GetStr command, except it will stop reading data when it encounters stopChar, even if the data received is less than byteLength. If stopChar is not found, then it will operate just like GetStr.
Const Device = CB280 Dim A As String * 10 OpenCom 1,115200,3,50,10 Set Until 1,8, 10 '10 is a required dummy value, it will be ignored On Recv1 GoSub GOTDATA Do Do While In(0) = 0 Loop ' Wait until press button (Connect P0) PutStr 1,"CUBLOC Controller",Cr Do While In(0) = 1 Loop Loop GOTDATA: A = GetStr2(1,8,0x30) ' Get 8 byte until 0x30 (space) Debug A Return