canitpClose (Function) |
Top Previous Next |
Close an ISO-TP connection previously opened by the canitpOpen function
Input: None.
Returns: INT
Declaration: FUNCTION canitpClose : INT;
Example: INCLUDE rtcu.inc
VAR buf : ARRAY [1..4096] OF SINT; END_VAR;
FUNCTION CALLBACK canitpRecv VAR_INPUT size : INT; END_VAR; DebugMsg(message := strFromMemory(src := ADDR(buf), len := size)); END_FUNCTION;
PROGRAM example; VAR rc : INT; END_VAR;
// Open can canOpen(baud := 250, monitor := FALSE);
// Open ISO-TP rc := canitpOpen(port := 1, src := 16#12345678, dst := 16#12345679, received := @canitpRecv, cb_data := ADDR(buf), cb_size := SIZEOF(buf)); IF rc < 1 THEN DebugFmt(message := "canitpOpen=\1", v1 := rc); RETURN; END_IF;
// ...
// Close ISO-TP rc := canitpClose(); IF rc < 1 THEN DebugFmt(message := "canitpClose=\1", v1 := rc); RETURN; END_IF;
BEGIN END; END_PROGRAM; |