Author Topic: i-TRiLOGI Simulator V6.49 build 5, INCOMM  (Read 11500 times)

garysdickinson

  • Hero Member
  • Posts: 502
  • Old PLC Coder
    • View Profile
i-TRiLOGI Simulator V6.49 build 5, INCOMM
« 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






support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:i-TRiLOGI Simulator V6.49 build 5, INCOMM
« Reply #1 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).
Email: support@triplc.com
Tel: 1-877-TRI-PLCS