DocumentationHelp Center
Create J1939 parameter group
pg = j1939ParameterGroup(database,name)
example
pg = j1939ParameterGroup(database,name) creates a parameter group using the name defined in the specified database.
pg
database
name
collapse all
This example shows how to attach a database to a parameter group name and view the signal information in the group.
Create a database handle.
db = canDatabase('C:\j1939Demo.dbc');
Create a parameter group.
pg = j1939ParameterGroup(db,'PackedData')
pg = ParameterGroup with properties: Protocol Data Unit Details: --------------------------- Name: 'PackedData' PGN: 57344 Priority: 6 PDUFormatType: 'Peer-to-Peer (Type 1)' SourceAddress: 50 DestinationAddress: 255 Data Details: ------------- Timestamp: 0 Data: [255 255 255 255 255 255 255 255] Signals: [1x1 struct] Other Information: ------------------ UserData: []
Examine the signals in the parameter group.
pg.Signals
ans = ToggleSwitch: -1 SliderSwitch: -1 RockerSwitch: -1 RepeatingStairs: 255 PushButton: 1
Handle to CAN database, specified as a CAN database object. The specified database contains J1939 parameter group definitions.
Example: db = canDatabase('C:\database.dbc')
db = canDatabase('C:\database.dbc')
Parameter group name, specified as a character vector or string. The name must match the name specified in the attached CAN database.
Example: 'pgName'
'pgName'
Data Types: char | string
char
string
J1939 parameter group, returned as a parameter group object, with j1939.ParameterGroup Properties.
canDatabase
j1939Channel
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office
Get trial now