Per,
>I'm using driven comm. if I use Inputlen=1 and
>RThreshold=1
Ok, I'm assuming your code is located in the OnComm event? If not, then
what I'm going to say here probably won't work.
>enchr=' '
>IF This.CommEvent = 2
> enchr=This.Input
What this line is doing is taking ALL the data currently in the input
buffer and placing it int he enchr variable.
> ?enchr
Looks like you are printing the variable for debugging purposes?
> hentprog=hentprog+enchr
Adding what was just placed in the buffer to another variable.
>IF enchr=CHR(03) && end of telegram hit
Ok, this code probably won't work like you want it to.
1. enchr can be a STRING that is more than one character long.
2. You need to look at RIGHT(enchr) to see if that is CHR(03).
> run the program
> Is it possible for a new OnComm to trigger here if
> there is char in the inputbuffer??
>IOW when my code is running?
>ENDIF
>ENDIF
Also, do you have to acknowledge that you have received a telegram before
another one is sent? I have some code I've worked on that works this way.
1. Outside machine sends 'telegram'. Leads telegram with 'special' char.
2. Local machine reads all data from input buffer until:
a. It receives an
- OR -
b. It times out.
3. If Local machine gets 'telegram' ok, then it sends an back and processes the 'telegram', and waits for another 'telegram', otherwise, it sends a and waits for another 'telegram'.
Is this how your system needs to work?
Later,