![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243078.webp)
63
Serial Communications
Section 4-1
Host Link Master Timeout
The timeout mechanism is implemented to avoid the BASIC task is paused for
a long time due to bad or no communication. The timeout time is specified by
the HLM_TIMEOUT parameter and is defined as the maximum amount of
time the program task will be paused to send the command and receive the
response.
In case the total timeout time has elapsed, the correct status will be defined
using HLM_STATUS and the BASIC task will continue. The HLM_TIMEOUT
parameter specifies the timeout time for all commands and for all ports.
Host Link Master Status
In the process of sending a Host Link command and receiving a response
several problems may occur:
1.
The Slave detects an error within the command and will send a corre-
sponding end code indication.
2.
The Slave cannot decode the command header code and sends a IC re-
sponse.
3.
The Master detects an error within the response. The corresponding end
code will be defined in the status.
4.
The timeout time has elapsed for the Master.
The HLM_STATUS BASIC parameter represents the Host Link Master status
on the specific port.
If no error did occur the HLM_STATUS will have value 0. In case of a non-
zero value, any appropriate action such as a re-try or emergency stop needs
to be programmed in the user BASIC program.
Programming
Precautions:
Consider the following precautions when programming the Host Link commu-
nications.
1.
The Host Link Master commands are required to be executed from one
program task only to avoid any multi-task timing problems.
2.
The Host Link Master commands provide the tools to exchange data with
the Host Link Slave. The user program should contain proper error han-
dling routines to deal with communication failure and perform retries if nec-
essary.
Command
Response
Characters
@
....
*
↵
@
....
*
↵
Timeout
HLM_STATUS status bits
9
8
7
0
End code (case 1 or case 3)
Timeout error (case 4)
Command not recognized (case 2)