CanSetMonitorMode


Function

Set monitor mode.

Format

Ret = CanSetMonitorMode ( Id , ChannelNo , MonitorMode )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from CanInit.

ChannelNo [ VB.NET: UShort ] [ C, C++: unsigned short ] [ C#: ushort ] [ Python: ctypes.c_ushort ]
Specify the channel number.

MonitorMode [ VB.NET: UShort] [ C, C++: unsigned short ] [ C#: ushort ] [ Python: ctypes.c_ushort ]
Specify monitor mode.

Definition

Value
[Dec]

Description

CCAN_MONITOR_OFF

0

Monitor mode OFF

CCAN_MONITOR_ON

1

Monitor mode ON

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value
[Dec]

Description

CAN_ERR_SUCCESS

0

Normality completion

CAN_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute CanResetDevice function because the device has recovered from standby mode.

CAN_ERR_DLL_INVALID_ID

10001

Invalid ID specified.

CAN_ERR_DLL_CALL_DRIVER

10002

Driver can't be called (Failed in the device I/O control).

CAN_ERR_SYS_MONITOR_MODE

20100

Monitor mode is outside the settable range.

The others (See also: Details of Error Code)

Initial Value

MotionMode = CCAN_MONITOR_OFF: Monitor mode OFF

Remarks

Set the monitor mode for each channel.
When monitor mode is set to ON, ACK is not returned when data is received via CAN communication, and data is monitored without affecting the line.

You can call this function during disconnecting from the CAN bus.
And also, you can not transmit by CAN/CAN FD communication during Monitor mode is ON

Example

Set the monitor mode ON for ChannelNo = 1.

VB.NET

Dim Ret As Integer
Ret = CanSetMonitorMode ( Id , 1 , CCAN_MONITOR_ON )
 

C, C++

long Ret;
Ret = CanSetMonitorMode( Id , 1 , CCAN_MONITOR_ON );
 

C#

int Ret;
Ret = can.SetMonitorMode ( Id , 1 , CCAN_MONITOR_ON );
 

Python

Ret = ctypes.c_long()
Ret.value = ccan.CanSetMonitorMode ( Id , 1 , ccan.CCAN_MONITOR_ON )
 

See Also

None