Serial comms delay
Posted: Thu Oct 29, 2020 7:12 pm
I need to use serial communication in my project. (Working on iMac). I have a usb serial adapter which I have got working - BUT - there is a consistent 250ms delay on receiving bytes. I am sending 3 bytes and receiving 2 or sending 3 and receiving 12, but the same delay is always there. This is when opening the port as a driver. When I open it as a file, it also works, now with a delay of only 16mS (same as a different non-LC project in Windows) -BUT- (there's always a but!) now if I simulate a communication break, the system crashes and I get the coloured wheel of death, so that's no good.
Yes I have tried the "to" setting in serialControlString, but that doesn't make a blind bit of difference 'on' or 'off' with the port opened as 'driver' or 'file'. If I set the timeout in the 'read driver' to less than 250mS the read just comes back in 0mS without waiting for a reply. If I set the timeout to 500mS I get the reply ok but with the 250mS delay, and if I break the communication it times out correctly at 500mS.
I realise this may be a Mac problem rather than LC, but has anyone had any experience of this?
Yes I have tried the "to" setting in serialControlString, but that doesn't make a blind bit of difference 'on' or 'off' with the port opened as 'driver' or 'file'. If I set the timeout in the 'read driver' to less than 250mS the read just comes back in 0mS without waiting for a reply. If I set the timeout to 500mS I get the reply ok but with the 250mS delay, and if I break the communication it times out correctly at 500mS.
I realise this may be a Mac problem rather than LC, but has anyone had any experience of this?