Main Content

j1939.Channel Properties

Properties of the j1939.Channel object

Use the following properties to examine or configure J1939 channel settings. Use j1939Channel to create a channel.

Device Information

expand all

This property is read-only.

The DeviceVendor property indicates the name of the device vendor.

Values are automatically defined when you configure the channel with the canChannel or j1939Channel function.

Data Types: char

This property is read-only.

For National Instruments® devices, the Device property displays the device number on the hardware.

For all other vendors, the Device property displays information about the device type to which the CAN or J1939 channel is connected.

Values are automatically defined when you configure the channel with the canChannel or j1939Channel function.

Data Types: char

This property is read-only.

The DeviceChannelIndex property indicates the channel index on which the specified CAN or J1939 channel is configured.

Values are automatically defined when you configure the channel with the canChannel or j1939Channel function.

Data Types: double

This property is read-only.

The DeviceSerialNumber property displays the serial number of the device connected to the CAN or J1939 channel.

Values are automatically defined when you configure the channel with the canChannel or j1939Channel function.

Data Types: double | char

Data Details

expand all

This property is read-only.

The ParameterGroupsAvailable property displays the total number of parameter groups available to be received by the channel.

Data Types: double

This property is read-only.

The ParameterGroupsReceived property indicates the total number of parameter groups received since the channel was last started.

Data Types: double

This property is read-only.

The ParameterGroupsTransmitted property indicates the total number of parameter groups transmitted since the channel was last started.

Data Types: double

This property is read-only.

FilterPassList displays a list of parameter group names and numbers that the channel can pass to the network. The list displays parameter group names and numbers as character vectors or cell arrays of character vectors and numbers.

To change the values, use one of the filtering functions: filterAllowOnly, filterAllowAll, or filterBlockAll

Data Types: char | cell

This property is read-only.

FilterBlockList displays a list of parameter group names and numbers blocked by the channel. The list displays parameter group names and numbers as character vectors or cell arrays of character vectors and numbers. To change the values, use one of the filtering functions.

To change the values, use one of the filtering functions: filterAllowOnly, filterAllowAll, or filterBlockAll

Data Types: char | cell

Channel Information

expand all

This property is read-only.

The Running property indicates the state of the CAN or J1939 channel, according to the following values:

  • false (default) — The channel is offline.

  • true — The channel is online.

Use the start function to set your channel online.

Data Types: logical

This property is read-only.

The BusStatus property displays information about the state of the CAN bus or the J1939 bus.

  • 'N/A' — Property not supported by vendor.

  • 'ErrorActive' — Node transmits Active Error Flags when it detects errors. Note: This status does not necessarily indicate that an error actually exists, but indicates how an error is handled.

  • 'ErrorPassive' — Node transmits Passive Error Flags when it detects errors.

  • 'BusOff' — Node will not transmit anything on the bus.

Data Types: char

This property is read-only.

The InitializationAccess property indicates if the configured CAN or J1939 channel object has full control of the device channel, according to the following values:

  • true — Has full control of the hardware channel and can change the property values.

  • false — Does not have full control and cannot change property values.

You can change some property values of the hardware channel only if the object has full control over the hardware channel.

Note

Only the first channel created on a device is granted initialization access.

Data Types: logical

This property is read-only.

The InitialTimestamp property indicates when the channel was set online with the start function or when its start trigger was received. For National Instruments devices, the time is obtained from the device driver; for devices from other vendors the time is obtained from the operating system where MATLAB is running.

Data Types: datetime

Specify whether the channel operates silently, according to the following values:

  • false (default) — The channel is in normal or active mode. In this mode, the channel both transmits and receives messages normally and performs other tasks on the network such as acknowledging messages and creating error frames.

  • true — The channel is in silent mode. You can observe all message activity on the network and perform analysis without affecting the network state or behavior. In this mode, you can only receive messages and not transmit any.

Data Types: logical

This property is read-only.

TransceiverName indicates the name of the device transceiver. The device transceiver translates the digital bit stream going to and coming from the bus into the real electrical signals present on the bus.

Data Types: char

If your CAN or J1939 transceiver allows you to control its mode, you can use the TransceiverState property to set the mode.

The numeric property value for each mode is defined by the transceiver manufacturer. Refer to your CAN transceiver documentation for the appropriate transceiver modes. Possible modes representing the numeric value specified are:

  • high speed

  • high voltage

  • sleep

  • wake up

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

This property is read-only.

The BusSpeed property indicates the speed at which messages are transmitted in bits per second. The default value is assigned by the vendor driver.

You can set BusSpeed to a supported bit rate using the configBusSpeed function, specifying the channel name and the bit rate value as input parameters. For example, to change the bus speed of the CAN channel object canch to 250,000 bits per second, and view the result, type

configBusSpeed(canch,250000);
bs = canch.BusSpeed

Data Types: double

This property is read-only.

SJW displays the synchronization jump width of the bit time segment. To adjust the on-chip bus clock, the controller can shorten or prolong the length of a bit by an integral number of time segments. The maximum value of these bit time adjustments are termed the synchronization jump width or SJW.

Note

This property is not available for National Instruments CAN devices. The channel displays NaN for the value.

Data Types: double

This property is read-only.

The TSEG1 and TSEG2 properties indicate the amount in bit time segments that the channel can lengthen and shorten the sample time, respectively, to resynchronize or compensate for delay times in the network. The value is inherited when you configure the bus speed of your CAN channel.

Note

This property is not available for National Instruments CAN devices. The channel displays NaN for the value.

Data Types: double

This property is read-only.

The NumOfSamples property is a bit timing parameter that indicates the number of bit samples performed for a single bit read on the network. The value is a positive integer based on the driver settings for the channel.

Note

This property is not available for National Instruments CAN devices. The channel displays NaN for the value.

Data Types: double

Other Information

expand all

Enter custom data to be stored in your CAN message or a J1939 parameter group, channel, or database object using the UserData property. When you save an object with UserData specified, you automatically save the custom data. When you load an object with UserData specified, you automatically load the custom data.

Tip

To avoid unexpected results when you save and load an object with UserData, specify your custom data in simple data types and constructs.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | string | struct | table | cell | function_handle | categorical | datetime | duration | calendarDuration | fi
Complex Number Support: Yes

Introduced in R2015b