This function closes the connection to the RTCU Communication Hub.
Please also see rchOpen.
The rchClose function is functionally identical to and interchangeable with the gwClose function.
Input:
None.
Returns: INT
1
|
- Success.
|
0
|
- Not available.
|
-1
|
- The RCH connection is not open.
|
Declaration:
FUNCTION rchClose : INT;
Example:
INCLUDE rtcu.inc
PROGRAM test;
VAR
timer : clockDayTimer;
rc : INT;
END_VAR;
timer(enable:=ON, start_hour:=12, start_minute:=0, stop_hour:=13, stop_minute:=30);
BEGIN
timer();
IF timer.q THEN
IF NOT rchIsOpen() THEN
DebugMsg(message := "Starting connection");
rc := rchOpen();
IF rc < 1 THEN
DebugFmt(message := " rchOpen=\1", v1 := rc);
END_IF;
END_IF;
ELSE
IF rchIsOpen() THEN
DebugMsg(message := "Stopping connection");
rc := rchClose();
IF rc < 1 THEN
DebugFmt(message := " rchClose=\1", v1 := rc);
END_IF;
END_IF;
END_IF;
IF rchConnected() THEN
END_IF;
END;
END_PROGRAM;
|