Internet PLC Forum

General => Technical support => Topic started by: garysdickinson on July 08, 2015, 11:43:14 AM

Title: i-TRiLOGI Simulator V6.49 build 5, INCOMM
Post by: garysdickinson on July 08, 2015, 11:43:14 AM
Simulator problem with INCOMM(2)

The handling of INCOMM() in the simulator is wrong.  INCOMM() is supposed to return a value of -1 if there are no characters in the receive buffer.  However when running the simulator INCOMM() returns a value of 0.

This behavior converts the following code to an endless loop rather than a flush of the receiver buffer:

while (INCOMM(2) <> -1)
    ' flush receive buffer for this serial port
endwhile
[/font][/color]
I supposed I could add a loop counter to break the loop after 256 iterations to work around the simulator...

Sorry,

Gary D





Title: Re:i-TRiLOGI Simulator V6.49 build 5, INCOMM
Post by: support on July 16, 2015, 07:17:48 PM
Thank you for the report. The communication part of i-TRiLOGI is not very well simulated on the simulator and it is probably better to just implement it on the actual hardware for testing.

If you want to simulate all the processing of incoming characters you can use a function to fill up the variables that you would have received from incomm or INPUT$ and then you can better simulate and test the processing (e.g. substring extraction and conversion to integers etc).