Skip to Main Content Skip to Search
Product Documentation

canChannel - Construct CAN channel connected to selected device

Syntax

canch = canChannel('vendor', 'device', devicechannelindex)
canch = canChannel('vendor', 'devicenumber')

Description

canch = canChannel('vendor', 'device', devicechannelindex) returns a CAN channel connected to a device from a specified vendor.

For Vector products, device is a combination of the device type and a device index, such as 'CANCaseXL 1'. For example, if there are two CANcardXL devices, device can be 'CANcardXL 1' or 'CANcardXL 2'.

For National Instruments CAN devices, use canch = canChannel('vendor', 'devicenumber'), where the vendor is the literal string 'NI', and the devicenumber is the interface number defined for the channel in NI Measurement & Automation Explorer.

Tips

Input Arguments

vendor

The name of the CAN device vendor. Specify the vendor name as a string.

device

The CAN interface that you want to connect to.

devicechannelindex

A numeric channel on the specified device.

canch

The CAN channel object the you create.

Properties

CAN Channel Properties

BusLoadDisplay load on CAN bus
DatabaseStore CAN database information
MessageReceivedFcnSpecify function to run
MessageReceivedFcnCountSpecify number of messages available before function is triggered
RunningDetermine status of CAN channel
SilentModeSpecify if channel is active or silent
TransceiverName Display name of CAN transceiver
TransceiverStateDisplay state or mode of CAN transceiver
UserDataEnter custom data

CAN Device Properties

DeviceDisplay CAN channel device type
Device(NI)Display NI CAN channel device type
DeviceChannelIndexDisplay CAN device channel index
DeviceSerialNumberDisplay CAN device serial number
DeviceVendorDisplay device vendor name
InitializationAccessDetermine control of device channel

Bit Timing Properties

BusSpeedDisplay speed of CAN bus
NumOfSamplesDisplay number of samples available to channel
SJWDisplay synchronization jump width (SJW) of bit time segment
TSEG1Display amount that channel can lengthen sample time
TSEG2Display amount that channel can shorten sample time

Examples

canch = canChannel('Vector','CANCaseXL 1',1)
canch = canChannel('Vector','Virtual 1',2)
canch = canChannel('NI', 'CAN1')

See Also

canHWInfo

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS