Set Can Cabs Mode
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
long setCanCabsMode(long ntype,long nchannel,long nmode,long nflags);
Function
Various CANcabs modes may be set. Replaces thesetPortBits functions.
Parameters
ntype
Unused, must be set to 0
nchannel
CAN channel
nmode
Is used for the control of the board lines via a bit pattern.
Mode, valid values:
0 | NORMAL |
1 | SLEEP |
2 | HIVOLTAGE |
3 | HISPEED |
4 | DUAL_WIRE |
5 | SINGLE_WIRE_LOW |
6 | SINGLE_WIRE_HIGH |
7 | is reserved |
For CANcab Eva two output lines can be set.
nMode | Line 2 | Line 1 |
|---|---|---|
8 | 0 | 0 |
9 | 0 | 1 |
10 | 1 | 0 |
11 | 1 | 1 |
Example Call the function with ntype = 0, nchannel = 1, nMode = 11, nflags = 0 setCanCabsMode(0,1,11,0); // sets both lines to 1 |
nflags
Is used for the control of the board lines via a bit pattern.
Flag, valid values:
0x0 | HIGHPRIO is disabled |
0x1 | HIGHPRIO is enabled (clear tx-buffers) |
0x4 | HIGPRIO is enabled for one message (clear tx-buffers) |
Note Not all mode and flag values are valid for all CANcabs! (see also the hardware description for CANcabs) |
Return Values
0: ok
!=0: Error
on key 'n'{long ntype, nmode, nchannel, nflags;ntype = 0;nmode = 0;nchannel = 1;nflags = 0;setCanCabsMode(ntype, nchannel, nmode, nflags);write("normal mode");}
Related APIs
setPortBits - Single Wire | setPortBits - low-speed
Source detail restored from the authorized CANoe 12 help. Hardware support and API availability must be checked against the installed product version.