PCAN-Explorer 6 Documentation

Product Overview

Contains introductory topics. Explains PCAN System basics, and how to set up and manage the PCAN system.

Getting Started

Contains topics on how to get started with PCAN-Explorer.

User Interface Basics

Contains topics about the basic use of the user interface with the help of Menus, Toolbars, Windows, Shortcut Key combinations and other elements.

Working with Projects

Contains topics on how to work with projects.

Working with Symbols

Contains topics about using Symbols, which can be used to display message objects on the CAN bus in symbolic form. Symbols can translate CAN messages into a human-readable form.

The Integrated Text Editor

Describes the use of the internal text editor.

Customizing PCAN-Explorer

Contains information about the available possibilities of customizing PCAN-Explorer according to own needs in order to make the operation as comfortable as possible.

Automating Tasks in PCAN-Explorer

Contains topics about the possibilities for the automation of different tasks in the PCAN-Explorer user interface.

Reference

Contains reference topics for dialog boxes, windows, shortcut Key combinations, commands, and error messages of PCAN-Explorer.

PCAN Tools

PCAN Nets Configuration

Setup and management of PCAN nets for connecting programs to PCAN hardware.

PCAN Status Display

Status display for the supervision of PCAN applications, PCAN nets and bus statistics.

Last update: 2022-04-21

Send Feedback | Copyright © 2022 PEAK-System Technik GmbH. All rights reserved.


Product Overview

Product Overview

PCAN-Explorer 6 is a universal tool in a CAN (Controller Area Network) to monitor and visualize the CAN or SAE J1939 data traffic. It is based on the PCAN system of the company PEAK-System Technik GmbH, whose core is a set of Windows Kernel-Mode drivers. The drivers provide the real-time connection of Windows applications to all CAN busses that are connected to the PC via PCAN hardware interfaces.

In This Section

PCAN System Basics

Introduction to the PCAN system, on which all PCAN applications are based.

Configuration of PCAN Nets

Describes the procedure for creating and configuring PCAN nets, which serve for the connection of PCAN programs to CAN hardware interfaces.

Contact Information

Contains information about the manufacturer of this software.

License Regulations

Contains the license regulations regarding this software and its documentation.

Basic steps for using PCAN-Explorer

Creating a new project

Opening an existing Project

Connecting to a CAN bus

Receiving CAN messages

Transmitting a new CAN message

Related Sections

The PCAN-Explorer User Interface

Contains topics about using the PCAN-Explorer user interface.

PCAN Nets Configuration

Setup and management of PCAN nets for connecting programs to PCAN hardware.

PCAN Status Display

Status display for the supervision of PCAN applications, PCAN nets and bus statistics.


PCAN System Basics

PCAN is a synonym for PEAK CAN APPLICATIONS and is a flexible system for planning, developing, and using a CAN Bus System. Developers as well as end users are getting a helpful and powerful product.

Basis for the communication between PCs and external hardware via CAN is a series of Windows Kernel Mode Drivers (Virtual Device Drivers) e.g. PCAN_USB.SYS, PCAN_PCI.SYS, PCAN_xxx.SYS. These drivers are the core of a complete CAN environment on a PC running Windows and work as interfaces between CAN software and PC-based CAN hardware. The drivers manage the entire data flow of every CAN device connected to the PC.

A user or administrator of a CAN installation gets access via the PCAN-Clients (short: Clients). Several parameters of processes can be visualized and changed with their help. The drivers allow the connection of several Clients at the same time.

Furthermore, several hardware components based on the SJA1000 CAN controller are supported by a PCAN driver. So-called Nets provide the logical structure for CAN busses, which are virtually extended into the PC. On the hardware side, several Clients can be connected, too. The following figures demonstrate different possibilities of Net configurations (also realizable at the same time):

PCAN-System Features

  • One Client can be connected to several Nets

  • One Net provides several Clients

  • One piece of hardware belongs to one Net

  • One Net can include none or one piece of hardware

  • A message from a transmitting Client is carried on to every other connected Client, and to the external bus via the connected CAN hardware

  • A message received by the CAN hardware is received by every connected Client. However, Clients react only on those messages that pass their acceptance filter.

See also

Configuring PCAN Nets


Contact Information

This software is a product of:

PEAK-System Technik GmbH

Otto-Roehm-Strasse 69

64293 Darmstadt

Germany

E-mail: | info@peak-system.com
Web: | www.peak-system.com

Technical Support

Our technical support team is available under the following E-mail address from Monday to Friday 8.30 a.m. and 4.30 p.m. CET.

E-mail: support@peak-system.com

Request for quotes / Orders

Request for quotes and price information you can contact our sales team from Monday to Friday 8.00 a.m. to 4.00 p.m. CET.

E-mail: order@peak-system.com


License Regulations

Names of products in this manual that are registered trademarks, are not separately marked. Therefore the missing of the ® sign does not implicate that the name is a free trade name. Furthermore, the used names do not indicate patent rights or anything similar. PEAK-System Technik GmbH makes no representation or warranties with respect to the contents or use of this manual, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, PEAK-System Technik GmbH reserves the right to revise this publication and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes.

Copyright © 2000-2022 PEAK-System Technik GmbH

All rights reserved. No part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of PEAK-System Technik GmbH.

See also

Contact Information


Getting Started with PCAN-Explorer

Basic steps for using PCAN-Explorer

Creating a new project

Opening an existing Project

Connecting to a CAN bus

Receiving CAN messages

Transmitting a new CAN message


Creating a new Project

Before you can receive or transmit CAN messages with PCAN-Explorer, a project must be open.

To create a new project:

  • If the Start Page is open, click on Empty Project under the Create New Project headline.

- or -

  • In the File menu, select New Project from the New submenu.

- or -

  • Press the [image] button on the toolbar.

Note

After creating a new project, the Project Manager shows an empty Project titled "New Project".

The Project Manager is located at the right edge of the environment by default. It is a useful tool that provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them.

See also

Connecting to a CAN bus

Getting started


Opening an existing Project

There are several ways to open a PCAN-Explorer project file (.peproj file).

To open a project after starting the program:

  • On the File menu, select Open Project.

- or -

  • If the Start Page is open, select one of the Projects from the Open Recent Projects list, or click on [image] Open Project.

- or -

  • Press the button [image] on the toolbar and select a project file.

Note

Use the Project Manager to inspect the contents of the loaded project. The Project Manager is a useful tool that provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them.

PCAN-Explorer can also be configured so that it loads the last loaded project automatically when starting the program.

To load a project automatically when starting the program:

  1. On the Tools menu, select Options.

  2. Select the Environment page from the page list on the left.

  3. In the At startup drop-down list, select Load last loaded project.

If a project was open at the time the program is closed, then the next time you start PCAN-Explorer this project is loaded automatically.

See also

Connecting to a CAN bus

Getting started


Connecting to a CAN bus

Before you can receive or transmit CAN messages with PCAN-Explorer, a project must be open and you must have at least one active Connection in your project.

To establish a connection with a CAN bus:

  1. On the Connections menu, select the Add Connection command, or press the button [image] on the toolbar. The Add Connection dialog box is displayed.

  2. Select one of the Device tabs.

  3. Select a PCAN net in the Available Nets list, with which PCAN-Explorer shall be connected.

Tip

If no PCAN nets are displayed in the Available Nets list, click on the Edit Nets button to start the Nets Configuration tool. Follow these steps to create a new PCAN net. Then, click on the button [image] to refresh the list of available nets and to make newly created nets visible.

  4. Enter a name for your new Connection in the Name field.

Note

A project cannot contain two connections with the same name. If the name you enter in the Name field is already occupied, a number is appended to the name to create a unique connection name.

  5. Select the protocol from the Protocol drop-down list that the new Connection shall use.

Note

If the J1939 Add-in is not loaded, the Protocol drop-down list only offers the CAN protocol.

  6. Select the Enable Connection option.

  7. Press OK. The connection is now added to the project.

Note

The added connection is shown in Connections Window and in the Project Manager on the Project Items tab, under the Connections node. The icon in front of the connection name indicates the connection state:

the connection is active.

the connection has a problem, see the Output Window for an error message.

the connection is disabled.

the connection is active and has an enabled message filter.

Now you can receive or transmit CAN messages on the connected CAN bus. If the Receive/Transmit Window is not open yet, select Receive/Transmit from the View menu, or simply press [Ctrl+R] on the keyboard.

See also

Transmitting a new CAN message

Getting started


Receiving CAN messages

Before you can receive CAN messages with PCAN-Explorer, a project must be open and you must have at least one active Connection in your project.

To receive CAN messages:

  1. Follow the steps to either create a new project or to open an existing project.

  2. Follow the steps to connect to a CAN bus.

Note

All connections in the project are shown in the Connections Window and in the Project Manager on the Project Items tab, under the Connections node. The icon in front of each connection name indicates the connection state:

the connection is active.

the connection has a problem, check the Output Window for an error message.

the connection is disabled.

the connection is active and has an enabled message filter.

  3. If a CAN connection is established, the Connections Window and the Project Manager show that the connection is active.

  4. Open the Receive/Transmit window: Either select Receive/Transmit from the View menu, double-click on a connection in the Project Manager, or press [Ctrl+R].

All received CAN messages are shown in the Receive list, which is the upper list in the Receive/Transmit window. For an explanation of the columns in the list, please refer to the Receive List reference topic.

See also

Transmitting a new CAN message

Getting started


Transmitting a new CAN message

You can transmit a CAN message by creating a new entry in a Transmit list. Either use the Transmit List of the Receive/Transmit window, or create a new Transmit List using the File | New | New File menu command.

To transmit a new CAN message:

  1. Follow the steps to either create a new project or to open an existing project.

  2. Follow the steps to connect to a CAN bus.

  3. Open the Receive/Transmit window: Either select Receive/Transmit from the View menu, double-click on a connection in the Project Manager, or press [Ctrl+R].

  4. On the Transmit menu, select the New Message command, or press the [Ins] key while the Receive/Transmit window is active.

  5. Select the Bus/Connection you want to use in the Bus drop-down list.

  6. Enter the CAN ID of the new message in the ID field.

    Note

    If you enter more than 3 characters, the message is treated as a 29-bit extended message, and the Extended Frame option is activated automatically. The valid range for standard 11-bit CAN-IDs is 0 to 7FFh.

  7. Select the Data Length Code of the message in the Length field. This sets the number of data bytes the new message will have. CAN messages can have a data length of 0 to 8 bytes, CAN FD messages can have a maximum of 64 data bytes.

  8. In the Data fields, enter the message's data bytes in hexadecimal notation.

  9. Press OK. The new CAN message is added to the Transmit List in the Receive/Transmit window, and is highlighted automatically.

  10. Finally, to send the message, either select the Send command from the Transmit menu, or press the [Space] key.

See also

Getting started


Home Page: PCAN-Explorer Environment

This section contains information about the PCAN-Explorer environment.

In This Section

User Interface Basics

Describes basic elements of the PCAN-Explorer user interface, such as Windows, Toolbars, and Shortcut Key combinations.

Working with Projects

Contains topics on how to work with projects.

Receiving and Transmitting CAN Messages

Describes the basic receive mode and explains the necessary steps for transmitting CAN messages.

Working with the Text Editor

Describes the use of the text editor, e.g. for editing Symbol Files or VBS Macros.

Working with Symbols

Contains topics about the use of Symbols with whose help message objects of a CAN bus can be displayed in Symbolic form. This takes the messages to a more easily understandable form.

Recording CAN Messages

Contains topics about the use of the Tracer.

Customizing PCAN-Explorer

Contains information about the available possibilities of customizing PCAN-Explorer according to own needs in order to make the operation as comfortable as possible.

Related Sections

User Interface Reference

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


User Interface Basics

User Interface Basics

Home Page (Environment)

The PCAN-Explorer user interface consists of a number of integrated windows, tools, menus, toolbars, lists, and other elements.

The user interface uses the default Windows interface functionality together with a couple of additional distinctive features to make the operation easier.

The user interface is a part of the PCAN-Explorer environment in which one can view information and arrange actions. These topics describe the basic operation of the user interface of PCAN-Explorer.

In This Section

Window Management

Description of the different types of windows and procedures about customizing the layout of windows.

Toolbars and Menu Bar

Information about the work with toolbars and the menu bar.

Library

Describes the PCAN-Explorer Library and how to set up the Library directories.

Using Shortcut Keys

Information about the use and customization of Shortcut Key Combinations to make the work with the user interface easier.

Related Sections

Customizing PCAN-Explorer

Description of the possibilities and procedures to customize the user interface according to own needs.


Window Management

The PCAN-Explorer user interface contains two basic window types: tool windows and document windows. These two window types behave in different ways.

Tool Windows

Tool windows are listed on the View menu.

The windows are not restricted to the workspace of the application and can be put floatingly on the whole desktop. Furthermore, they can be docked to the edges of the main window.

Tool windows are recognizable at the small title bar.

Document Windows

Document windows are dynamically created when you open or create files or other items. The list of the open document windows appears in the Window menu in the current z-order, with the top-most window listed first.

Document windows can be positioned within the MDI workspace (MDI = Multiple Document Interface). Some commands are available in the Window menu to arrange the windows in the workspace automatically.

Note

The Receive/Transmit window and the Start Page are exceptions. The are treated like document windows but are not based on a file to be opened.

Arranging Windows

Depending on the arrangement of the different windows in the user interface, you can increase the available space for important windows in several ways:

  • Dock tool windows to an edge of the main window.

  • Put tool windows on different monitors.

  • Tile document windows.

  • Minimize document windows.

Docking Tool Windows

Floating tool windows can be docked to the edges of the main window. To do this, drag the windows with the mouse at their title bar over the user interface until the dragged semi-transparent frame changes its shape and indicates a possible docking position. If the mouse button then is released, the tool window takes the space outlined before. Depending on the docking position of the tool window, a handle bar is shown on the left or upper border as well as a small button for closing the window.

To cancel a tool window's docked state again, the handle bar of the docked window must be dragged with the mouse. A drag frame appears, which moves along with the mouse pointer. When the mouse button is then released again, the tool window turns to a floating window again.

The tool windows' positions are stored in the layout file (*.dsk) of the currently open project. When the project is loaded the next time, all window positions are restored.


Toolbars

Toolbars offer a possibility to have fast access to the most important commands by using the mouse.

The available toolbars can be made visible or hidden and their position can be changed.

The menu bar is as a special toolbar at the upper window border, containing menu entries such as File, Edit or View. Unlike a normal toolbar the menu bar always extends to the right border of the application window and can't be removed.

Showing or hiding a toolbar:

  1. In the View menu, under Toolbars, select the toolbar to be shown or hidden. A check mark before the respective command indicates whether the corresponding toolbar is shown.

See also

Toolbars, Customize dialog


Library

When working with PCAN-Explorer, one comes upon many different file types, for example Symbol Files, Transmit lists, and Macro files. The PCAN-Explorer Library allows quick access to frequently used files. Files stored in the Library can be shared among various projects, without the need to copy them to the Project directory, and then have multiple copies of the same file.

To define a Library directory for a file type:

  1. On the Tools menu, select the Options command and then select Library page.

  2. In the Library Directories list, click into the Path column of the file type, for which you want to select a directory.

  3. Enter the path or click on the button [image] to select a directory.

  4. Press OK to close the dialog box.

See also

Library, Options Dialog Box


Using Shortcut Keys

Shortcut Keys offer an alternative method for executing commands for users, who prefer the use of the keyboard to the mouse. Some Shortcut Keys in PCAN-Explorer are assigned by default. Other commands don't have any standard Shortcut Keys.

Shortcut Keys assigned by default can be changed or they can be created for commands which have none by default.

Drawing Up a List of current Shortcut Keys

Shortcut Keys currently assigned (including the additionally defined ones) can be exported into a list.

To display a list of Shortcut Keys:

  1. In the Help menu, select the Keyboard Map command and carry out one or several of the following actions:

  • Choose an entry from the drop-down list to filter the list of the key combinations (all commands, bound commands, commands of a category).

  • In the title bar of the list select Command, Alias, Key, or Description to sort the list of the key combinations alphabetically after the corresponding criterion.

  • Press the [image] button to copy the entries of the list into the clipboard of Windows (further processing e.g. in a word processor or a text editor).

See also

Customizing Shortcut Keys


Working with Projects

Home Page (Environment)

PCAN-Explorer Projects are containers to help you efficiently manage the items that are required to monitor and visualize a CAN or SAE J1939 network, such as bus connections, files and folders, and filters. Project Manager, an interface for viewing and managing the projects and their associated items, is part of the PCAN-Explorer environment.

In This Section

Creating a Project

Describes the procedure for creating a new project.

Opening an existing Project

Describes the procedure for opening an existing project, and how projects can be loaded automatically when PCAN-Explorer is started.

Adding a File to a Project

Describes the procedure for adding existing or new files to the project.

Renaming a Project

Describes the possibilities how a project can be renamed.


Creating a Project

Before you can receive or transmit CAN messages with PCAN-Explorer, a project must be open.

To create a new project:

  • If the Start Page is open, click on Empty Project under the Create New Project headline.

- or -

  • In the File menu, select New Project from the File submenu.

- or -

  • Press the [image] button on the toolbar.

Note

After creating a new project, the Project Manager shows an empty Project titled "New Project". The Project Manager is located at the right edge of the environment by default. It is a useful tool that provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them.

See also

Adding a File to a Project

Working with Projects


Opening an existing Project

There are several ways to open a PCAN-Explorer project file (.peproj file).

To open a project after starting the program:

  • On the File menu, select Open Project.

- or -

  • If the Start Page is open, select one of the Projects from the Open Recent Projects list, or click on [image] Open Project.

- or -

  • Press the button [image] on the toolbar and select a project file.

Note

Use the Project Manager to inspect the contents of the loaded project. The Project Manager is a useful tool that provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them.

PCAN-Explorer can also be configured so that it loads the last loaded project automatically when starting the program.

To load a project automatically when starting the program:

  1. On the Tools menu, select Options.

  2. Select the Environment page from the page list on the left.

  3. In the At startup drop-down list, select Load last loaded project.

If a project was open at the time the program is closed, then the next time you start PCAN-Explorer this project is loaded automatically.

See also

Working with Projects


Adding a File to a Project

You can either add existing files to a project, or create and add a new file in one step.

To add a new file to a project:

  1. In the Project Manager toolbar, click the New button

- or -

On the Project menu, select Add New Item.

  2. In the Add New Item dialog box, select the type of the file you want to create in the Templates list.

  3. Enter a name for the new file in the Name field.

  4. Enter a location for the file in the Location field, or use the Browse button.

  5. Press OK.

The new file is now opened and appears in the Project Manager on the Project Files tab.

To add an existing file to a project:

  1. In the Project Manager toolbar, click the Add button

- or -

On the Project menu, select Add Existing Item.

  2. In the File Open dialog box, select the file you would like to add to the project.

  3. Press Open.

The file now appears in the Project Manager on the Project Files tab.

To add an existing file from the Library to a project:

  1. Open the Library by selecting the Library command on the View menu.

  2. Select the file you would like to add to the project.

  3. Open the context menu for the file, and either select the Add to Project or the Copy and Add to Project command.

See also

Working with Projects


Renaming a Project

There are various ways how a project can be renamed.

To rename a new project:

  1. In the Project Manager, open the context menu on the Project root node.

  2. Select the Rename command.

  3. Enter the new Project name and press [Return].

- or -

  1. In the Project Manager, select the Project root node.

  2. Click again with the mouse into the label of the node (no double-click).

  3. Enter the new Project name and press [Return].

- or -

  1. On the File menu, select the Save Project As command.

  2. In the Save As dialog box, enter a new name for the project.

  3. Click Save.

See also

Working with Projects


Receiving and Transmitting CAN messages

Receiving and transmitting CAN messages

Home Page (Environment)

Before you can receive or transmit CAN messages with PCAN-Explorer, establish a connection with a CAN bus.

As soon as there is at least one active connection, all CAN messages on the connected bus are displayed in the Receive List. The displayed messages can originate from CAN nodes on a connected external physical CAN bus, or from other PCAN client applications connected to the same PCAN net.

If a message filter is applied to the Receive List, you should configure the filter so that the messages can pass through the filter. Otherwise, nothing is shown in the Receive List.

In This Section

Establishing a connection to a CAN bus

Describes the procedure for adding a connection to a project to connect to a CAN bus.

Transmitting CAN messages

Describes the procedure for transmitting a new CAN message.

Working with Transmit Lists

Describes the application of transmit lists for the use of own CAN messages in later sessions.

Remote Transmission Request

Explains the operation of Remote Transmission Requests and their use in PCAN-Explorer.

Filtering Messages

Describes the options that control the filtering of CAN messages.

Displaying Error Frames

Explains the operation and the display of Error Frames in PCAN-Explorer.

Exporting Messages

Describes the procedure for exporting message lists to text or CSV files.


Establishing a Connection with a CAN bus

Before you can receive or transmit CAN messages with PCAN-Explorer, a project must be open and you must have at least one active Connection in your project.

To create a new project:

  • In the File menu, select New Project from the File submenu.

- or -

  • If the Start Page is open, click on Empty Project under the Create New Project headline.

- or -

  • Press the button [image] on the toolbar.

Note

After creating a new project, the Project Manager shows an empty Project titled "New Project".

The Project Manager is located at the right edge of the environment by default. It is a useful tool that provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them.

To establish a connection with a CAN bus:

  1. On the Connections menu, select the Add Connection command, or press the button [image] on the toolbar. The Add Connection dialog box is displayed.

  2. Select one of the Device tabs.

  3. Select a PCAN net in the Available Nets list, with which PCAN-Explorer shall be connected.

  4. Enter a name for your new Connection in the Name field.

Note

A project cannot contain two connections with the same name. If the name you enter in the Name field is already occupied, a number is appended to the name to create a unique connection name.

  5. Select the protocol from the Protocol drop-down list that the new Connection shall use.

Note

If the J1939 Add-in is not loaded, only the CAN protocol is available in the Protocol drop-down list.

  6. Select the Enable Connection option.

  7. Push OK. The connection is added and appears in the Connections Window and in the Project Manager on the Project Items tab, under the Connections node.

Now you can receive or transmit CAN messages on the connected CAN bus. If the Receive/Transmit Window is not open yet, select Receive/Transmit from the View menu, or simply press [CTRL+R] on the keyboard.

See also

Add Connection Dialog Box

Receive/Transmit Window

Project Manager


Transmitting CAN Messages

You can transmit a CAN message by creating a new entry in a Transmit list. Either use the Transmit List of the Receive/Transmit window, or create a new Transmit List using the File | New | New File menu command.

To transmit a new CAN message:

  1. On the Transmit menu, select the New Message command, or press the [Ins] key while the Receive/Transmit window or the new Transmit List is active.

  2. Select the Bus/Connection in the Bus drop-down list.

  3. In the Symbols list, select the <Custom message> entry.

  4. Enter the CAN ID of the new message in the ID field in hexadecimal notation.

  5. Select the Data Length Code of the message in the DLC field. This sets the number of data bytes (0-8) the new message will have.

  6. In the Data fields, enter the message's data bytes in hexadecimal notation.

  7. Press OK. The new CAN message is added to your selected Transmit List, and is automatically selected.

  8. Finally, to send the message, either select the Send command from the Transmit menu, or press the SPACE key.

Transmit messages that you add to the Transmit List of the Receive/Transmit window are saved in the project file when you save the project. When loading the project later, all previously configured Transmit messages are restored automatically.

If you intend to reuse Transmit messages in other projects, you can also create a separate Transmit list file.

To create CAN message in a new Transmit List:

  1. In the File menu, select the New File command from the New sub-menu menu.

  2. In the Templates list, select the Transmit List file type, and press OK.

  3. Create the CAN message as described above.

See also

Working with Transmit Lists


Working with Transmit Lists

Transmit Lists can group a set of CAN messages, e.g. to share them among various projects. A project can contain several transmit lists, the number of concurrently opened transmit lists is not limited. Messages can also be inserted via the clipboard, or by using Drag-and-Drop from other Windows.

Information about Symbols is not stored in Transmit Lists. When a Transmit List is opened, PCAN-Explorer checks which Symbols match to the messages in the file.

To create a new Transmit List:

  1. On the File menu, select New File from the New sub-menu.

  2. In the Templates list, select the Transmit List file type and press OK.

  3. Add messages to the Transmit List as desired by selecting the New Message command on the Transmit menu.

To save messages in the Transmit List of the Receive/Transmit window as a Transmit List file:

  1. If the Receive/Transmit window is not visible, select Receive/Transmit from the View menu.

  2. Activate the Receive/Transmit window and set the focus to the Transmit list.

  3. On the File menu, select Save.

  4. Select the path and the file name for the new Transmit List.

  5. Press Save.

To load a saved Transmit List:

  1. On the File menu, select Open.

  2. Select a Transmit List file and the press Open.

See also

Sending CAN messages

Default Transmit List


Remote Transmission Request

A Remote Transmission Request (RTR) is sent by a CAN node in form of a Remote Request Frame for requesting particular data. Another CAN node that is responsible for the provision of the corresponding data sends a data frame with the same CAN ID as an answer after that.

PCAN-Explorer can automatically send replies to received Remote Request Frames.

To activate the processing of Remote Transmission Requests:

  1. On the Project menu, select Settings.

  2. In the shown dialog box, select the CAN page.

  3. In the Remote Transmission Requests, section activate the Process Remote Request Frames option.

  4. Press OK.

Replying to Remote Transmission Requests

When a Remote Request Frame is received, PCAN-Explorer checks whether the Transmit List in the Receive/Transmit window or any other open Transmit List contains a matching message that can be used to reply to the request. If this is the case, the corresponding message is sent and the message is marked with the sending reason (trigger) RTR.

This setting affects all CAN connections in the project.

Note

RTR messages from the Transmit List are never sent in response to received Remote Request frames.
Taking the Data Length Code into account

If the Data Length Code of a received Remote Request Frame shall be taken into account, deactivate the Ignore Data Length Code option in the Project Settings dialog box, on the CAN page. When a Remote Request Frame is then received, PCAN-Explorer checks whether the Transmit List contains messages with matching CAN ID and with the requested number of data bytes. If these conditions are met, the corresponding message is sent.

The Ignore Data Length Code option affects all CAN connections in the project.

See also

CAN, Project Settings Dialog Box


Filtering Messages

Filtering messages can be useful when recording messages using a Tracer, or to customize the display of the Receive List. Messages can be filtered by adding a Message Filter to the project and selecting one in the toolbar of the Tracer or Receive/Transmit window, in the Filter drop-down list. A Message Filter can consist of one or several filter items, each of which can operate in different modes. So it is possible to configure a Message Filter to fulfill specific filtering requirements.

To add a Message Filter to the current Project:

  1. On the Connections menu, select the Add Message Filter command, or press the [image] button on the toolbar of a Tracer window or the Receive/Transmit window. The Edit Filter dialog box is displayed.

  2. Add a Filter Item to the filter by pressing the Add Item button.

  3. To configure the Filter Item, select the Bus of which the item shall filter messages, select the Filter Item Type, and enter optional parameters into the fields in the Details group box.

Note

When a filter checks whether a message can pass through, the filter processes the filter items from the top of the list to the end. If a filter item matches and the condition is true, processing of further filter items will be aborted. Therefore, the position of a filter item in the list affects the filtering result.
Note

If a filter contains only filter items that have the Exclude option enabled, all other messages that are not excluded by these filter items will be able to pass through the filter. This represents a changed behavior compared to earlier versions of PCAN-Explorer. Up to PCAN-Explorer 5.3.1, at least one including filter item had to be defined in addition to the excluding filter items, so that a message could ever pass through the filter.

Filter Item Types

The individual items of a Message Filter can have one of the following types.

CAN-ID Range

In this mode, the filter item adds a continuous range of specified CAN-IDs that shall pass through the filter. If a single CAN-ID shall pass through the filter, the same CAN-ID must be entered in the Open Filter From and To fields.

If Mode is set to Standard, the filter item processes only 11-bit messages. If Mode is set to Extended, the filter item processes only 29-bit messages.

If the RTR option is selected, the filter item processes only Remote Transmission Requests.

If the Exclude option is selected, the filter item excludes specific messages from passing through the filter.

SJA1000 Code/Mask

This mode emulates the low-level filter mechanism of the SJA1000 CAN controller. For a description of the operating principle and the meaning of the Code and Mask values, see NXP (formerly Philips) Application Note AN97076, "SJA1000 Stand-alone CAN controller", section 4.1.2.

Adjust to Symbols

In this mode, only those messages will pass through the filter that have a corresponding Symbol definition in the Symbols file that is assigned to a connection.

Adjust to marked Symbols

In this mode, only those messages can pass through the filter that have a corresponding Symbol entry in a Symbols file, and that are explicitly marked to be traced using the Trace switch (-t in a Symbols file).

Example:

Symbols File (FormatVersion 5.0)

[Demo]
ID=123h

DLC=3

Var=Test unsigned 0,8 -t

If a Multiplexer has been defined for a message, the Multiplexer itself can also be marked:

Symbols File (FormatVersion 5.0)

[Demo]
ID=123h

DLC=3

Mux=Mux1 0,8 1 -t

Var=Test unsigned 8,8

As soon as a Variable or Multiplexer is marked this way, the associated CAN message can pass through a message filter.

Options

Allows additional types of messages to pass through the filter.

Note that Error Warnings are never shown in the Receive/Transmit window, even if the filter item has this option activated and the filter containing the item is assigned to the Receive/Transmit window.

J1939

This mode is only available if the J1939 Add-in is loaded.

In this mode, messages can be filtered by PGN, Priority, Source, Destination, and any combination of these values.

If the Exclude option is selected, the filter item excludes specific messages from passing through the filter.

See also

Symbols Files

Signals

Variables

Optional Switches for Signal and Variable Definitions


Displaying Error Frames

If an error occurs during data frame or Remote Request frame transmission, any bus participant, sender or receiver, can signal an error. The CAN node that signals the error destroys the message by sending an Error Frame, which causes the transmitter to re-send the message. If the bus error is not resolved, the continuous retransmission of the message can contribute significantly to the bus load.

Therefore, monitoring Error Frames in PCAN-Explorer is very useful to evaluate the actual "health" of the network.

To configure a connection to display Error Frames:

  1. Select the connection in the Connections window or the Project Manager, on the Project Items tab.

  2. In the Properties window, navigate to the Error Frames property.

  3. Set the value of the Error Frames property to Yes.

In the Connections window, the EF option is now indicated for the connection in the Options column, and the Receive list now shows all Error Frames that occur on this connection.

See also

Error frames in the Receive List


Exporting Messages

The CAN messages in the Receive and Transmit lists can be exported to text files or CSV files to import these in Microsoft Excel, for example. The export filter can be configured flexibly to export only the data that is important for the user.

To export CAN messages:

  1. Bring the Receive/Transmit window into the foreground and select the list that you would like to export.

- or -

Open a Transmit List file or bring a Transmit List window into the foreground whose data you would like to export.

  2. On the File menu, select the Export command. The command is only available if the selected message list is not empty. The Export Data dialog box is displayed.

  3. In the Path field, enter the path and the name of the file to which the data shall be saved.

  4. Choose whether you would like to export the data to a text file or a CSV file by selecting the appropriate tab.

  5. Choose between the options to adjust the file output to your requirements.

  6. Press OK.

See also

Export Data Dialog Box


Working with Symbols

Working with Symbols

Home Page (Environment)

An efficient feature of PCAN-Explorer is the possibility of displaying message objects from a CAN bus in symbolic form, and allowing a symbolic input of data, to bring the messages into an easily understandable form.

The values of different application variables (e.g. temperature, relay positions etc.) are normally transmitted in a certain format. Every value covers a bit group of its own in the data bytes of the message. The value of a variable can be read directly from the hexadecimal representation of a CAN message only in rare cases. PCAN-Explorer can extract the transferred values out of the data bytes and shows the variables with their identifier and their contained values in an easily understandable form for the user.

PCAN-Explorer takes the definitions for the Symbolic interpretation of the CAN messages from text files, so-called "Symbols Files". These files can be created and processed with an integrated text editor, and with the standalone PCAN Symbol Editor. A Symbol name can be assigned to every CAN message in the tested network. Furthermore, the different bit groups in a message's data bytes can be assigned to names and data formats. The information with which the Symbols file is created normally already arises during the planning of a CAN.

Symbols files that are frequently used, or which are shared among different projects, can be stored in the PCAN-Explorer Library. The directory structure of the PCAN-Explorer Library can be configured in the Options dialog box on the Library page. When PCAN-Explorer is started for the first time, a Library directory for Symbols files is created in the Documents directory of the current user, and the path to this directory is stored as the Library directory. Also, a sample Symbols file is copied into the directory.

In This Section

Creating and Activating Symbols Files

Describes the procedure for creating a new Symbols file.

Assigning a Symbols File to a Connection

Describes the procedure for assigning a Symbols file to a connection, so that the messages from the connection can be shown in symbolic form.

Opening a Symbols File from the Library

Describes the procedure for opening an existing Symbols file from the PCAN-Explorer Library.

Signals

Describe the operation of signals and its use in PCAN-Explorer.

Watching Signals

Describes the procedure for watching the values of selected signals.

Related Sections

Symbols Files

Contains the reference to Symbols files.

Error Messages of Symbols Files

Contains all error messages which can occur in dealing with Symbols files.


Creating and Activating Symbols Files

PCAN-Explorer gathers the definitions for the symbolic interpretation of the CAN messages from the Symbols files. These can be created and edited with the integrated text editor, or with the standalone PCAN Symbol Editor. The following procedures describe how to create, edit, and apply Symbols files with the integrated text editor.

To create and activate a new Symbols file:

  1. Make sure you have a project open, and your project contains at least one connection.

  2. In the File menu, select the New File command from the New submenu.

  3. In the Templates list, select the Symbols file type.

  4. A new Symbol File is shown, already containing a basic framework with different sections SEND, RECEIVE, etc. Carry out the definitions for the new Symbols.

  5. From the File menu, choose the Apply command. The Apply command is also available in the Text editors context menu.
    If the definitions of the Symbols contain errors, these are shown in the Output window and in the text editor. The position of the error is selected, or the cursor is placed at the appropriate position.

  6. If the Symbols file has no errors, a dialog box is shown that prompts for a saving location for the file. Select the path and enter the file name, and press OK.

  7. Before PCAN-Explorer can activate the Symbols file, it must be part of your project. If you've chosen a location for the file that is not in your project directory, a dialog box is shown, where you can select how to proceed. Choose, whether you want to copy the file into your project directory before adding it to your project, or just add it from the current location.

  8. If your project contains only one connection, the Symbols file is assigned automatically to this connection. If your project contains multiple connections, a dialog box is shown where you can select one or more connections, to which you would like to assign the file.

To modify and activate an existing Symbols file:

  1. Open the Symbol file.

  2. Edit the file.

  3. From the File menu, choose the Apply command. The Apply command is also available in the Text editors context menu.
    If the definitions of the Symbols contain errors, these are shown in the Output window and in the text editor. The position of the error is selected, or the cursor is placed at the appropriate position.

  4. If the Symbol File has no errors, a dialog box is shown that prompts for a saving location for the file. Select the path, and press OK.

  5. Before PCAN-Explorer can activate the Symbols file, it must be part of your project. If you've chosen a location for the file that is not in your project directory, a dialog box is shown, where you can select how to proceed. Choose, whether you want to copy the file into your project directory before adding it to your project, or just add it from the current location.

  6. If the Symbols file is not assigned to any connection yet:

  • If your project contains only one connection, the Symbols file is assigned automatically to this connection.

  • If your project contains multiple connections, a dialog box is shown where you can select one or more connections, to which you would like to assign the file.

See also

Opening a Symbols file from the Library

Output Window

Error Messages of Symbols Files


Assigning a Symbols File to a Connection

Before PCAN-Explorer can show the symbolic representation for the CAN messages on a connection, a Symbols file must be assigned to a connection.

To assign a Symbols file to a connection:

  1. Make sure that the Symbols file that you would like to assign to a connection is already added to the project. If this is not the case, perform these steps to add the Symbols file to the project.

  2. Select the connection, to which you would like to assign a Symbol File, either in the Project Manager or in the Connections Window.

  3. In the Properties Window, find the Symbols File property of the connection and click in the value column in this row.

  4. Open the drop-down list of the value cell and select the Symbols file you would like to assign to the connection.

Notes

The drop-down list for the Symbols File property in the Property Window shows all Symbols files that the current project contains.

If the connection uses the J1939 protocol, the default J1939 Symbols file J1939Default.sym is also listed, regardless if it is contained in your project or not.

If the CANdb Add-in is loaded and the project also contains CANdb Network files, these files are also available for selection in the drop-down list.

See also

Working with Symbols


Opening a Symbols File from the Library

Symbols files that are frequently used can be stored in the Library directory for Symbols files. The Library Browser allows a quick access of these files.

To path to the Symbols files directory of the Library can be configured in the Options dialog on the Library page.

To open a Symbols file from the Library:

  1. On the View menu, select the Library command.

  2. In the Library Browser, navigate to the Symbols Files node.

  3. Expand the Symbols Files node and select the Symbols file you would like to open.

  4. Open the context menu for the file (accessible via right mouse button) and select the Edit command.

See also

Library Browser

Library, Options Dialog Box


Signals

Signals represent a uniform interface for all modules in PCAN-Explorer to exchange values under each other. Signals can be physical sizes, which were received over a CAN bus, however, they can be also virtual values without any reference to the outside world.

There has not to be any difference for a user of a signal, on which physical medium in reality the signal is transported. A signal could be made available by an Add-in, which obtains or distributes its values of a serial interface of the PC, for example.

The available signals can be displayed in the Project Manager on the Project Items tab. The Watch window can be used to monitor the values of some selected signals.

Variables as Signals

Variables that are defined in Symbol Files become automatically available as signals in the PCAN-Explorer environment at the activation of the Symbols file. The names of the signals are a combination of the names of the respective Symbol, Multiplexer, and Variable (each separated by a period). Example:

SymbolsFile.RcvSymbol.Mux1.Speed

This so called fully qualified name is necessary since the names of variables are not unique. Several variables of different Symbols can use the same name.

The display of the signals can be, however, carried out either in the fully qualified form or in the shortened form in which in the above example only the name Speed is displayed. How the signal names shall be displayed, can be set in the Options dialog box on the General page.

See also

Project Manager

Watching Signals

General, Options Dialog Box


Watching Signals

To monitor the values of selected signals, you can add the signals to the Watch window.

The Watch window permanently displays the current values of the selected signals.

To watch a signal:

  1. Open the Watch window by selecting the Watch command from the View menu.

  2. In the Watch window, select one of the Watch tabs where you would like to add the signal.

  3. Open the Project Manager by selecting the Project Manager command from the View menu.

  4. In the Project Manager, select the Project Items tab.

  5. Open the Signal node and then select the signal you would like to watch.

  6. Open the context menu (right mouse button) for the signal and select the Add To Watch Window command, or, using the mouse, drag the signal into the Watch window.

- or -

  1. Open the Watch window by selecting the Watch command from the View menu.

  2. In the Watch window, select one of the Watch tabs where you would like to add the signal.

  3. Open the context menu in the Watch window (right mouse button) and select the Add Signal command.

  4. Select the signal you would like to watch.

  5. Press OK.

- or -

  1. In the Receive list or Transmit list, place the mouse cursor on a Variable name in the data column.

  2. Click the right mouse button and choose the command Add VariableName to Watch Window.

- or -

  1. Open the Edit Variables Dialog Box or the Inspect Variables Dialog Box.

  2. In the list of Variables, select the one you want to add to the Watch Window.

  3. Press the right mouse button and choose the Add to Watch Window command.

To remove signals from the Watch Window:

  1. In the Watch window, select the lines containing the signals you would like to remove.

  2. Either press the [Del] key on the keyboard, or select the Delete command from the context menu.

To change the order of signals in the Watch Window:

  1. In the Watch window, select the lines containing the signals you would like to move to a different position.

  2. Either press [Ctrl+Arrow-up] or [Ctrl+Arrow-down] on the keyboard, or open the context menu for the Watch Window and choose one of the commands Move Up or Move Down.

See also

Watch window


Working with the Text Editor

Working with the Text Editor

Home Page (Environment)

When working with PCAN-Explorer, one meets different kinds of text files that can be managed, edited, and printed with the help of the integrated text editor.

Depending on which kind of text or which programming language is processed, the editor supports the user by highlighting known keywords and other syntactic elements with different colors.

There are several possibilities of showing the text editor:

  • In the Project Manager by selecting a file on the Project Files tab, and then selecting the Open command from the file's context menu.

  • In the Library Browser, e.g. by selecting a Symbols File and using the Edit command from the context menu.

  • In the File menu, by selecting one of the commands New | New File or Open.

In This Section

Features of the Text Editor

Describes the features and abilities of the text editor.

Editing and Selecting Text

Describes basic editing of text.

Doing Drag-and-Drop on text

Describes moving and copying of text by means of drag-and-drop.

Searching Text

Explains the use of the Find dialog box for searching text in text editor windows.

Customizing the Text Editor and its Options

Describe the different possibilities of customizing the display of text and the behavior of the text editor.

Customizing the Syntax Highlighting

Describes the operation and customization of syntax highlighting in text editor windows.

Bookmarks

Explains the use of bookmarks.


Features of the Text Editor

The text editor has the following features and abilities:

  • Customizable syntax highlighting: Keywords and other syntactic elements of the text are highlighted in dependence of the programming language. The used colors can be changed for every element as desired. See Customizing the Syntax Highlighting for further information.

  • Drag-and-drop on text: Marked passages simply can be moved by using drag-and-drop within the editor. See also Doing Drag-and-Drop on Text.

  • Multiple undo and restoring of inputs: Up to 256 inputs can be undone and restored in the text editor.

  • Line numbering: For each of the supported programming languages line numbers can be shown independently of each other. See also Text Editor, Options Dialog Box.

  • Bookmarks: Up to 10 bookmarks can be defined in a text window to simplify the navigation of inside longer text. See also Bookmarks.

  • Customizable font types and sizes: The font that is used in the editor can be changed just like the size. See also Fonts and Colors, Options Dialog Box.

  • Automation of the editor by means of VBS Macros: With the help of VBS Macros the functionality of the text editor can be extended arbitrarily. By assigning key combinations the own functions then can be accessed directly. For further information, see VBScript Macros.


Editing and Selecting Text

Editing text works in the same way as in other text editors or word processing programs in Microsoft Windows.

To append or insert text:

  1. Either click on the desired position in the document with the mouse or move the cursor with the keyboard to that position.

  2. Enter the text.

If the cursor position is between existing characters, the text is inserted between those.

To overwrite characters in a line, the key [Ins] must be pressed to set the editor to overwrite mode. The overwrite mode is active, when the cursor is a blinking block and the status line of the text window shows the Overwrite indicator. Pressing the key [Ins] once more changes back to insert mode.

To delete characters in a line:

  1. Place the cursor in front of the character that you want to deleted.

  2. Press the [Del] key repeatedly till all characters are deleted.

- or -

Place the text cursor behind the characters to be deleted and press the backspace key.

Note

To delete a whole word, first select it with a double-click with the mouse on that word. Then press either the [Del] key or the backspace key.

- or -

Place the cursor behind the word you want to delete, then press and hold the [Ctrl] key and press the backspace key.

To delete lines or paragraphs:

  1. Select the text to be deleted by either holding the left mouse button and moving over the text with the mouse or by pressing the shift key together with one of the arrow keys or the keys [Home], [End], [PgUp], or [PgDn].

  2. Press the [Del] key or the backspace key.

You can also cut out and copy text, or move it in the document by using drag-and-drop. See Doing Drag-and-Drop on Text for further information.

Selecting Text

The text editor has two selection modes:

  • Normal mode: The selection works like in the editor of Windows. The selection is a continual character string. Whole lines are selected if you move to the next or the previous line.

  • Block mode: Rectangular areas of text can be selected. This happens if you hold down the [Alt] key on the keyboard in addition to the left mouse button while you move the mouse pointer over an area.

To select text in the normal mode:

  • Click into the text with the left mouse button, hold it pushed down and move the mouse over the text.

- or-

  • Use the shift key in combination with the arrow keys.

To select text in the block mode:

  • Hold down the [Alt] key while you click with the left mouse button into the text, and hold down the mouse button while you move the mouse over the text.

- or-

  • Use the [Shift] key and the [Alt] key in combination with the arrow keys.

See also

Working with the text editor

Doing Drag-and-Drop on Text


Doing Drag-and-Drop on Text

You can select text to move or copy it by means of drag-and-drop to another place.

To move text with drag-and-drop:

  1. Select the text to be moved, optional with the mouse or the keyboard.

  2. Press and keep pressed the left mouse button on the selected text.

  3. Move the mouse to the place where the text shall be inserted.

  4. Release the mouse button.

If a selected text block is dragged, it is moved, i.e. it is erased in the old place and inserted in the new position. If the [Ctrl] key is pressed and held down before releasing the left mouse button, a copy of the selected text is inserted in the desired position.

See also

Working with the Text Editor

Changing and Selecting Text


Searching Text

The Find dialog box can be used to search text within a text editor window.

To search for text:

  1. In the Edit menu, select the Find command.

  2. In the Text to find field, enter the appropriate text.

  3. Activate the Match case option, if the case of letters shall be taken into account when searching.

  4. Activate the Match whole word only option, if only for whole words and not for word parts shall be searched.

  5. In the Direction field, choose the search direction.

  6. Press OK.

The first found passage is marked in the text editor. If you want to continue the search from this position, choose the Find Next command in the Edit menu, or press [F3]. You can continue the search until either the end or the beginning of the file is reached. If the search cannot be continued, a message is displayed in the status bar. Pressing [Shift+F3] also continues the search, but always towards the beginning of the text.

See also

Find Dialog Box

Working with the Text Editor


Customizing the Text Editor and its Options

To customize the appearance and behavior of the text editor, choose the Options command from the Tools menu. All options of the text editor can be configured on the Text Editor page.

For | See
Customizing the font style, size, or colors | Fonts and Colors, Options Dialog Box
Customizing the syntax highlighting | Customizing the Syntax Highlighting
Creating keyboard shortcuts for the text editor | Keyboard, Options Dialog Box
Customizing other text editor options | Text Editor, Options Dialog Box

See also

Working with the Text Editor


Customizing the Syntax Highlighting

The syntax highlighting of the text editor uses different colors for different elements of the source text, such as keywords and comments. This highlighting makes the visual overview of the structure and the status of the source text easier.

The syntax highlighting is based on the respective (programming) language of the source text. The text editor supports the syntax of the following languages:

  • Symbols Files

  • Standard Macros

  • VBS Macros

The text editor recognizes the language of the source text by the file name extension.

To customize the syntax highlighting:

  1. From the Tools menu, choose Options.

  2. Select the Fonts and Colors page.

  3. In the Show settings for drop-down list, select the Text Editor element.

  4. In the Display items list, select the item that you would like to change.

  5. In the Item foreground and Item background fields, select the colors for the item.

  6. Push OK.

Note

The behavior of the Automatic setting depends on the element selected. For colors that map to standard system elements (such as foreground color, background color, or text selection color), the Automatic setting sets the element to the appropriate system color. For syntax coloring elements and other non-system defined colors, the Automatic setting indicates that the foreground color or background color is determined by the element Text.

See also

Fonts and Colors, Options Dialog Box


Bookmarks

You can put bookmarks in the text editor to mark places you use regularly in the source text. If a bookmark is set, menu or keyboard commands can be used to jump to this bookmark. If a bookmark is not needed any longer, it can be removed again.

To set a bookmark:

  1. Place the cursor in the line, which shall be provided with a bookmark.

  2. On the context menu under Toggle Bookmarks, select one of the commands Bookmark 0 to Bookmark 9.

- or -

Press one of the key combinations [Shift+Ctrl+0] .. [Shift+Ctrl+9].

The bookmark is set in the selected line and is displayed on the left edge of the text window.

To jump to a bookmark:

  • On the context menu under Goto Bookmarks, select one of the commands Bookmark 0 to Bookmark 9. Only those bookmarks that were set before have an effect. This is indicated with a check mark in front of the respective bookmark.

- or -

Press one of the key combinations [Ctrl+0] .. [Ctrl+9].

The cursor position is then placed in the line with the bookmark. If necessary, the visible part of the source code is moved to make the bookmark visible.

To erase a bookmark:

  1. On the context menu under Goto Bookmarks, select one of the commands Bookmark 0 to Bookmark 9, which shall be erased

  2. On the context menu under Toggle Bookmarks, select the corresponding command Bookmark, which shall be erased.


Recording CAN Messages

Recording CAN Messages

Home Page (Environment)

To be able to record the activities on a CAN bus, a versatile Tracer (data logger) is integrated in PCAN-Explorer. The Tracer records CAN messages, Remote Transmission Requests, bus status changes, Error Frames, and changes of error counters of connected CAN controllers. A message filter can be assigned to a Tracer, to control which elements are recorded.

The data buffer of a tracer can operate in different modes. The available buffer types are shown in the following table.

Buffer Type | Description
Linear | The buffer has a fixed size (adjustable in number of entries). When the buffer is full, the recording is stopped. The recorded data is stored in the PC's working memory.
Ring | The buffer has a fixed size (adjustable in number of entries). When the buffer is full, the oldest entries are overwritten. The recorded data is stored in the PC's working memory.
Dynamic | The size of the buffer is increased with the number of recorded entries. The recorded data is stored in the PC's working memory.
File | The recorded data is directly written to a file, the size of which is increasing with the number of the recorded entries.

When using one of the buffer types Linear, Ring, or Dynamic, the recorded CAN data is stored in the working memory of the PC, which can then be saved in a file. To examine the recorded data later, the saved Trace files can be loaded again. Furthermore, the data can be exported into text files or CSV files.

In This Section

Starting a Recording

Describes the procedure for starting a new recording.

Pausing or Stopping a Recording

Describes the different methods to interrupt a recording.

Displaying Variables in the Trace Window

Describes the procedure to display the data of recorded CAN messages symbolically.

Exporting Recorded Data

Describes the procedure for exporting recorded data into text files or CSV files.

Related Sections

Tracer Elements

Contains the reference to elements of the user interface regarding the Tracer.


Starting a Recording

Since there is the possibility of opening several Trace windows in the user interface at the same time, there are different options to start a recording.

To start a recording if no Trace window is open yet:

  1. On the Trace menu, select the command Start New Tracer, or press the button [image] button on the toolbar of the main PCAN-Explorer window.

- or-

  1. On the File menu, select the New File command from the New sub-menu.

  2. In the New File dialog box, select the Trace File element and push OK.

  3. In the new Trace window's toolbar, press the [image] button.

To start a recording in an already open Trace window:

  • Press the [image] button on the Trace window's toolbar.

Also, you can start all open tracers at the same time by selecting the Start All Tracers command from the Trace menu, or press the keyboard shortcut [Shift+F9].

If the recording is started for a Tracer that already contains recorded data in its buffer, and the Tracer is in Stopped state, depending on the Tracer's buffer type one of the following actions is performed:

  • Buffer Type Dynamic, Linear, or Ring: The old buffer contents are erased.

  • Buffer Type File: The existing trace file is copied to the subdirectory '_backups', which is created if it does not exist at the trace file's current location. Then the original trace file is overwritten.

See also

Pausing or Stopping a Recording

Trace Window

Tracer, Options Dialog Box


Pausing or Stopping a Recording

A recording can be either interrupted temporarily (paused) or stopped completely. An paused recording can be continued later where the previous buffer contents remains unchanged.

To pause a recording:

  • Press the button [image] button on the Trace window's toolbar.

Also, you can pause all running tracers at the same time by selecting the Pause All Tracers command from the Trace menu.

To stop a recording:

  • Press the button [image] on Trace window's toolbar.

Also, you can stop all running tracers at the same time by selecting the Stop All Tracers command from the Trace menu, or press the keyboard shortcut [Shift+F6].

See also

Starting a Recording


Displaying Variables in the Trace Window

Only the data bytes of the CAN messages are displayed in the Trace window during a recording, even if a Symbol definition is available for a message in an active Symbols File. Since you can define many variables for a Symbol, a symbolic representation is almost impossible within the Trace window for space reasons.

If a matching Symbol is recognized for a CAN message, the name of the Symbol is shown in the ID column. In this case, variables are also available. The values of the variables can be displayed when the recording is interrupted temporarily or stopped completely.

To show the values of variables of a symbolic CAN message:

  1. Select the Trace window, in which you would like to inspect variables.

  2. Pause or stop the recording of the selected tracer.

  3. Make the message visible that you would like to inspect by using the scroll bar of the Trace window.

  4. Using the mouse, point at the data bytes in the Data column that you would like to inspect.

  5. A hint window is displayed that shows all variables and their values.

If you would like to inspect message data without interrupting a recording, use either the Watch window or the Receive List.

See also

Trace Window, Options Dialog Box

Watching Signals

Watch Window


Exporting Recorded Data

The data recorded by the Tracer can be exported to text files or CSV files to import these in Microsoft Excel, for example. The export filter can be configured flexibly to export only the data that is important for the user.

To export recorded data:

  1. Open a trace file or bring an already open Trace window into the foreground whose data you would like to export.

  2. On the File menu, select the Export command. The command is only available if the selected Trace window contains data. The Export Data dialog box is displayed.

  3. In the Path field in the Export Trace Data dialog box, enter the path and the name of the file to which the data shall be saved.

  4. Choose whether you would like to export the data to a text file or a CSV file by selecting the appropriate tab.

  5. Choose between the options to adjust the file output to your requirements.

  6. Press OK.

See also

Export Data Dialog Box

Recording CAN Messages


Customizing PCAN-Explorer

Customizing PCAN-Explorer

Home Page (Environment)

You can customize various aspects of the layout and operation of PCAN-Explorer.

In This Section

Customizing Font Style, Size, and Colors

Instructions to change the fonts and colors that are used in the various PCAN-Explorer windows.

Customizing the Text Editor and its Options

Possibilities of changing the appearance of the text editor and the text displayed by it.

Customizing Shortcut Keys

Instructions for creating own Shortcut Key combinations for commands frequently used.

Customizing the Tools Menu

Details on adding, changing and deleting tools in the corresponding menu.

Customizing with Other Options

Further ways to customize the environment, e.g. with Add-ins or Macros.

Related Sections

Window Management

Description of the different window types and the procedure for customizing the layout of the windows.


Customizing Font Style, Size, and Colors

You can change the font style, size, and color settings for any PCAN-Explorer window.

To change a font style, size, or color:

  1. From the Tools menu, choose Options.

  2. Select the Fonts and Colors page.

  3. In the Show settings for drop-down list, select the Text Editor element.

  4. In the Display items list, select the item that you would like to change.

  5. In the Font drop-down list, select a font.

  6. In the Size box, select a font size.

  7. In the Item foreground and Item background fields, select the colors for the item.

  8. Click OK.

Note

The behavior of the Automatic setting depends on the element selected. For colors that map to standard system elements (such as foreground color, background color, or text selection color), the Automatic setting sets the element to the appropriate system color. For syntax coloring elements and other non-system defined colors, the Automatic setting indicates that the foreground color or background color is determined by the element Text.

The settings for fonts and colors affect all windows that are opened in the PCAN-Explorer user interface. For some windows, e.g. the Trace window, only fonts with a fixed character width are available in the font selection field.

See also

Customizing PCAN-Explorer

Fonts and Colors, Options Dialog Box


Customizing Shortcut Keys

Shortcut Key combinations offer users, who prefer the use of the keyboard instead of the mouse, an alternative method to execute commands. In PCAN-Explorer you can:

  • Display a list of all current Shortcut Keys

  • Delete assigned Shortcut Keys

  • Change Shortcut Keys assigned by default

  • Assign Shortcut Keys to commands, which don't have any by default.

By new assignments every user can create his or her own set of Shortcut Keys, which correspond to his normal method of working or which can be remembered more easily.

What would you like to do?

  • Assign a Shortcut Key

  • Delete a Shortcut Key

  • Reset all Shortcut Keys to their default values

  • Display a list of current Shortcut Keys

To assign a Shortcut Key:

  1. On the Tools menu, click Options and select the Keyboard page.

  2. In the Category drop-down list, select the category that contains the command to which you want to assign the Shortcut Key.

  3. In the Commands lists, select the command to which you want to assign the Shortcut Key.

  4. Click into the field Press new shortcut key(s).

  5. Press the shortcut key or key combination, that you want.

  6. Click Assign.

If an invalid key combination is pressed, no key is displayed. You cannot assign key combinations with [F1], or combinations such as [Ctrl+Alt+Del] that are already being used by the operating system.

If you press a key or key combination that is currently assigned to another command, that command appears under Currently assigned to.

To delete a Shortcut Key:

  1. On the Tools menu, click Options and select the Keyboard page.

  2. On the Category and Commands lists, select the location for the Shortcut Key you want to delete.

  3. Click Remove.

To reset all Shortcut Keys to their default values:

  1. On the Tools menu, click Options and select the Keyboard page.

  2. Click Reset All.


Customizing the Tools Menu

You can add items to the Tools menu that allow you to launch external tools from within PCAN-Explorer. For example, you can add an item to the Tools menu to launch utilities such as PCAN Status Display or PCAN Nets Configuration.

You can add up to 16 commands to the Tools menu. You can also specify arguments for any command that you add to the Tools menu.

What would you like to do?

  • Add a command to the Tools menu

  • Edit a command on the Tools menu

  • Remove a command from the Tools menu

  • Pass variables to a command or tool

To add a command to the Tools menu:

As an example, the following procedure demonstrates how to add the Windows Notepad accessory to the Tools menu.

  1. On the Tools menu, select the External Tools command.

  2. Press the Add button. A new entry appears in the Menu Contents list.

  3. In the Title field, type the name of the tool as you want it to appear on the Tools menu.

For example, if you want to add a command for the Windows Notepad accessory, you might type Notepad. The remaining steps specify what action will occur when the new Notepad command is selected.

Tip

Type an ampersand (&) before one of the letters in the tool name to create an accelerator key for the command when it appears on the Tools menu. For example, if you use 'My &External Tool', the letter 'E' will be the accelerator key.

  4. In the Command box, browse or type the path and name of the program, for example, C:\Windows\Notepad.exe.

  5. In Arguments text box, browse or type any arguments to be passed to the program.

You can use the drop-down arrow next to the Arguments text box to display a menu of arguments. Select an argument from the list to insert argument syntax into the Argument text box. PCAN-Explorer provides the argument macros shown in the Argument Macros table.

  6. In the Initial directory box, enter the directory that will serve the program as the working directory.

You can use the drop-down arrow next to the Initial directory text box to display a menu of directories. Select a directory from the list to insert directory syntax into the Initial directory text box.

  7. Optionally, activate the Prompt for arguments option if you would like the option of editing arguments at the time the command is launched.

  8. Press OK.

To edit a command on the Tools menu:

  1. On the Tools menu, click External Tools.

  2. In the Menu contents list, select the command that you want to edit.

  3. Perform one or more of the following actions:

  • To move the command one position up, press the Move Up button.

  • To move the command one position down, press the Move Down button.

  • To change the menu text, command line (path and file name), command line arguments, or the initial directory, type the new information in the appropriate text box.

  • To specify a letter in the menu title as a hot-key, precede that letter in Title field with an ampersand (&).

To remove a command from the Tools menu:

  1. On the Tools menu, click External Tools.

  2. In the Menu contents list, select the command you want to delete and the press the Delete button.

See also

External Tools Dialog Box


Passing Variables to External Tools

You can specify that certain information be passed to a command when it is launched, such as command line switches for console applications. You can also pass arguments to external tools. Arguments are variables that PCAN-Explorer supplies values for when an external tool is launched from the Tools menu.

To pass variables to a tool:

  1. On the Tools menu, click External Tools.

  2. In the Menu contents list, select the command you wish to pass a variable to.

  3. In the Arguments box, enter the arguments you wish to pass to the tool, or choose the arrow button to select a predefined argument.

Note

For more information about argument syntax, see Arguments for External Tools.

  4. Select Prompt for arguments if you would like the option of editing the arguments at the time the command is launched.

When you start the external tool from the Tools menu, the arguments you selected will be automatically passed to the tool. If you selected Prompt for arguments, the Arguments dialog box will appear.

You can also specify the working directory for the tool or command.

To specify a working directory for the tool:

  • In the Initial directory box, enter the working directory for the tool, or choose the arrow button to select a predefined directory location.

See also

Customizing the Tools Menu

External Tools Dialog Box

Arguments for External Tools

Argument Macros


Other Options for Customization

In addition to customize toolbars, tools, and shortcut keys, you can also use macros, Add-ins, and Callback Libraries to automate tasks.

What would you like to know more about?

  • Customizing the windows' layout

  • Using Add-ins

  • Using VBScript Macros

  • Using Callback Libraries

What would you like to do?

  • Assign Shortcut Keys to specific VBScript Macros

  • Customize the Text Editor

  • Customize the Syntax Highlighting in Text Editor windows


Overview: Automation

In the PCAN-Explorer environment, you perform many tasks manually. With Automation, you perform tasks programmatically by writing VBScript Macros, PCAN-Explorer Add-ins, or Callback Libraries. VBScript Macros are procedures you write in the VBScript language, and Add-ins are in-process COM components (DLLs) you can create with arbitrary development tools. Callback Libraries are DLLs that you include in PCAN-Explorer projects and which can be called when CAN messages are received and transmitted to inspect or modify CAN data, or perform other message-related tasks.

In Macros or Add-ins, you perform tasks by manipulating the PCAN-Explorer environment and its components as objects. For example, you open, edit and close a document by manipulating as an object. Similarly, you activate or size a window by manipulating it as an object.

An object represents one component of PCAN-Explorer, or it represents a collection of related components. For example, a Document object represents one open document, whereas the Documents object describes a collection of all open documents. Similarly, a Window object represents one open window, whereas the Windows object represents all open windows. The Documents and Windows objects are called collection objects because they include objects of related objects.

You manipulate objects by using methods, properties, and events associated with the objects. Methods represent actions you take against the objects. Properties are the characteristics of the objects, such as their type or size. And, events represent conditions under which actions are taken against the objects.

Suppose you want to create a Symbols file quickly - by simply pressing a button. Start by writing a VBScript Macro that will create the file. The Macro looks like this:

VBS Macro

Sub CreateSymbolsFile

Set SymFile = Documents.Add(peDocumentKindText)

SymFile.Language = peSymbols

End Sub

This Macro does the following:

  • The Sub statement begins the Macro, which has the name CreateSymbolsFile. The name is arbitrary; you can use whatever name you choose.

  • The first line of the Macro creates the file by adding a Document object to the collection of Document objects, using the Add method of the Documents collection.

  • The second line of the Macro specifies the file type (Symbols) by setting the Language property of the Document object equal to the constant peSymbols. This constant represents Symbol Files.

  • The End Sub statement ends the Macro.

After writing the Macro, assign it to a Shortcut Key. You then simply press this Shortcut Key to run the Macro.

For more information about writing VBScript Macros, see Overview: VBScript Macros. For details about objects you can use to perform tasks in PCAN-Explorer, see Reference: PCAN-Explorer Objects. And, for details about creating Add-ins, see Overview: PCAN-Explorer Add-ins.

In This Section

PCAN-Explorer Objects

Contains an overview and reference topics about the PCAN-Explorer Object Model.

VBScript Macros

Contains topics about how to create and use VBScript Macros.

Add-ins

Contains topics about how to create, install, and use Add-ins.

Callback Libraries

Contains topics about how to create and use Callback Libraries in projects.

Related Sections

Standard Macros

Standard Macros allow a controlled transmit and receive operation. PCAN-Explorer provides a simple instruction set with the most frequently required functionality. This section contains the reference to Standard Macros.


Home Page: PCAN-Explorer Objects

You can automate tasks from within the PCAN-Explorer environment by creating VBScript Macros and PCAN-Explorer Add-ins.

You automate tasks by manipulating the environment (PCAN-Explorer) and its components as objects. For example, you open, edit, and close a document by manipulating it as an object. Similarly, you activate or size a window by manipulating it as an object.

You manipulate objects by using methods, properties and events associated with the objects. Methods represent actions you take against the objects. Properties represent characteristics of the objects, such as their type or size. And, events represents conditions under which actions are taken against the objects.

What do you want to know more about?

  • The benefits of Automation

  • Automation from other applications

  • Objects

  • Collections

  • Methods

  • Properties

  • Events

  • Differences between VBScript Macros and PCAN-Explorer Add-ins

  • Reference

Related Sections

  • VBScript Macros

  • Add-ins for PCAN-Explorer

  • Callback Libraries

  • Customizing PCAN-Explorer


Automating Tasks from other Applications

Home Page (Objects) | Reference

With Automation, you can control the PCAN-Explorer environment from other applications such as Word, Excel or Visual Basic. You can start PCAN-Explorer, automate tasks and then stop PCAN-Explorer when the tasks are finished.

Starting PCAN-Explorer

To start PCAN-Explorer from another application, create an instance of the PCAN-Explorer Application object. For example, to start PCAN-Explorer from Visual Basic or Visual Basic for Applications, use the following code:

Visual Basic

Dim app As PCANExplorer6.Application

Set app = CreateObject("PCANExplorer6.Application")

You must add a reference to the COM component "PCAN-Explorer 6 Shared Objects" to the Visual Basic project, so that Visual Basic is able to resolve the PCAN-Explorer data types used.

When PCAN-Explorer starts, it will be invisible, unless you make it visible by using the IsVisible property of the corresponding Window object:

Visual Basic

Dim app As PCANExplorer6.Application

Set app = CreateObject("PCANExplorer6.Application")

app.MainWindow.IsVisible = True

If PCAN-Explorer is already running, you can use that instance of it instead of creating another one. For example, to use the current instance of PCAN-Explorer from Visual Basic or Visual Basic for Applications, you can use the following code:

Visual Basic

Dim app As PCANExplorer6.Application

Set app = GetObject(, "PCANExplorer6.Application")

Automating Tasks in PCAN-Explorer

After starting PCAN-Explorer, you can automate tasks in it by using the appropriate code. For example, in the following code, the comment indicates where to insert code for automating tasks:

Visual Basic

Dim app As PCANExplorer6.Application

Set app = CreateObject("PCANExplorer6.Application")

app.MainWindow.IsVisible = True

' Insert code for automating tasks here

Stopping PCAN-Explorer

After completing your PCAN-Explorer tasks, you can stop PCAN-Explorer by quitting the application and releasing all references to the Application object.

Note: If you use C#, Visual Basic, or Delphi to automate PCAN-Explorer, all references to the Application object are released automatically.

To quit PCAN-Explorer, use the Exit command on the File menu or the Quit method of the Application object. If you use the Quit method, however, you must use it before you release its reference to the Application object.

For example, the following code shows how to use the Quit method:

Visual Basic

Dim app As PCANExplorer6.Application

Set app = CreateObject("PCANExplorer6.Application")

app.MainWindow.IsVisible = True

' Insert code for automating tasks here

app.Quit
Note

If the user tries to stop PCAN-Explorer while your program is controlling it, PCAN-Explorer will remain in memory but the user interface will become invisible. Subsequently, if you try to access PCAN-Explorer objects, PCAN-Explorer will return errors. If this happens, release all references to the Application object so that PCAN-Explorer can quit.


Getting or Setting Properties of PCAN-Explorer Objects

PCAN-Explorer objects have a variety of properties. For example, a TextWindow or a Window object have a Caption property that indicates the caption of a window. Additionally, a TextWindow, or a Window object has a Height property that indicates the height of a window.

Some properties are read-only, whereas others are read/write. This means you can only get the values of some properties, whereas you can get or set the values of others.

For example, you can only get the value of the Caption property, as shown in the following example:

VBS Macro

Dim x

x = ActiveWindow.Caption

Alternatively, you can get or set the value for the Height property. For example, you can set the value for the Height property, as shown in the following example:

VBS Macro

ActiveWindow.Height = 100

For more information about properties, see property descriptions.


Applying Methods to PCAN-Explorer Objects

Most PCAN-Explorer objects have methods. These represent actions you can take against the objects.

for example, the Open method of the Documents object allows you to open a document. Suppose you create a new Symbols file and save it as MyFile.sym in your local Symbols directory. To open this file, you can use the following code:

VBS Macro

Documents.Open("C:\Users\<UserName>\Documents\PCAN-Explorer 6\Symbols\MyFile.sym")

Similarly, to close this file you can use the Close method of the TextDocument object:

VBS Macro

ActiveDocument.Close

For more information about methods, see the method descriptions.


Using Events with PCAN-Explorer Objects

An event is an action or an occurrence, often generated by the user, to which a VBScript event handler, PCAN-Explorer Add-in, or another Automation Controller can respond. For example, if a user clicks on a window, PCAN-Explorer fires the OnWindowActivate event of the Application object.

In a VBScript event handler, you can respond to an event by taking some action. For instance, you could change the size of a window by setting the Height and Width properties of the Window object.

To respond to an event, add the appropriate event handler to any loaded VBScript Macro file. You can add this event handler to multiple VBScript Macro files. For example, if you add an event handler for the OnWindowActivate event to two loaded VBScript Macro files, when the user activates a window, both of these event handlers will be called, one at a time.

For example, you could take some action just before PCAN-Explorer quits by using the OnApplicationShutDown event. To use this event, go to the description of the event and copy the sample event handler:

VBS Macro

Sub Application_OnApplicationShutDown()

' Insert code to handle the event here

End Sub

Then, paste this code into your Macro file, insert the code for handling the event, and then reload the Macro file.

Tip

To reload the Macro file, open the file in the text editor, click the right mouse button to open the context menu, and then click Reload Macro File.


Reference: PCAN-Explorer Objects

Home Page (Objects)

The PCAN-Explorer object model enables you to automate tasks in the PCAN-Explorer environment. This object model consists of the hierarchy of PCAN-Explorer objects, and their associated properties, methods, and events.

This section describes each object and collection, along with its properties, methods, and events.

In This Section

Diagram of the Object Model

A graphical guide to all components of the PCAN-Explorer object model.

Objects

Contains all objects in the PCAN-Explorer object model.

Collections

Contains all collections in the PCAN-Explorer object model.

Properties

Contains all properties of the objects and collections in the PCAN-Explorer object model.

Methods

Contains all methods of the objects and collections in the PCAN-Explorer object model.

Events

Contains all events of the objects in the PCAN-Explorer object model.


Diagram of the Object Model

PCAN-Explorer: Automation

Objects

PCAN-Explorer Object Model

See also

Reference: PCAN-Explorer Objects


Objects

Objects

You can control the PCAN-Explorer environment programmatically by manipulating it through Automation (former OLE Automation). For example, in a VBScript Macro, you can control an open document by manipulating its corresponding Document object.

Each PCAN-Explorer object implements a dual interface through which you can manipulate the object. Each object implements an IDispatch interface for Automation and a Component Object Model (COM) interface for direct access to object members (properties, methods, events).

Add-ins working with early binding can use the COM interface. Early binding makes all calls into interface members faster at runtime.

Overview of PCAN-Explorer Objects

Each PCAN-Explorer object is described below:

Object | Represents
AddIn | An Add-in listed in the Add-In Manager dialog box.
Application | The PCAN-Explorer application.
CallbackLibraryEvent | Encapsulates a Callback Library that is passed to callback functions that handle library-related events.
Connection | A connection between PCAN-Explorer and a CAN bus.
Document | An open document.
Enum | An enum that defines text representations for ordinal values.
J1939Filter | Used to filter the messages that are received by its parent J1939Node object.
J1939Msg | A J1939 message that can be sent by a J1939Node object.
J1939Node | A connection to a CAN bus using the J1939 protocol.
J1939RcvMsg | A J1939 message that was received by a J1939Node object.
MessageFilter | A message filter in the current project.
MessageFilterItem | A set of message filter settings.
Multiplexer | A multiplexer for a CAN symbol.
OutputWindow | The PCAN-Explorer Output window.
OutputWindowPane | Represents a tab in the Output window.
PCANBitrate | Represents a CAN or CAN FD bit rate.
PCANClient | The client object of the PCAN system. An object that is able to connect to one or more buses using the raw CAN protocol.
PCANClientConnection | A single connection of a PCANClient object to a CAN bus.
PCANMessage | A CAN message.
Project | A loaded PCAN-Explorer project.
ReceiveEvent | Encapsulates a received message that is passed to callback functions that handle receive-related events.
ReceiveMessage | A received CAN message.
ReceiveTransmitWindow | The central Receive/Transmit window.
Signal | A signal.
Symbol | A CAN symbol.
TextDocument | An open text file.
TextEditor | The text editor of PCAN-Explorer.
TextSelection | Selected text in an open text file.
TextWindow | A view of an open text document.
TraceMessage | A recorded CAN message.
Tracer | A tracer for recording CAN messages.
TraceWindow | A view of a tracer object.
TransmitEvent | Encapsulates a transmit message that is passed to callback functions that handle transmit-related events.
TransmitMessage | A CAN message to be sent.
TransmitWindow | A view of a Transmit List.
Variable | A CAN variable.
VBSMacroFile | A loaded VBS Macro file.
Window | A window of the PCAN-Explorer user interface.

See also

Collection Property | Parent Property


AddIn Object

The AddIn object represents an Add-in listed in the Add-In Manager dialog box and provides information about an Add-in to other Add-in objects.

Application

AddIns

AddIn

The AddIn object has the following properties:

Properties
Application | Guid
Collection | IsConnected
Description | Name
ExtensibilityObject | ProgID
FullName | Version
Remarks

The AddIn objects can be accessed by using the AddIns property of the Application object. This object has members (properties) that you can use to manipulate the Add-in.

An AddIn object provides information about an Add-in to other Add-ins. Only registered Add-ins are represented by an AddIn object.

Add-ins and other clients that can use early binding can access the members of the AddIn object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The AddIn object implements the Dual Interface IPEAddIn (IID: C12B9635-194E-4617-B3F4-B5AED5C842C9).

See also

AddIns Collection


Application Object

The Application object represents PCAN-Explorer and is the top object in the PCAN-Explorer object model. From the Application object you can directly access other PCAN-Explorer objects, by using its properties and methods. On the other hand you can indirectly access other objects with the help of objects, which you get due to these properties and methods.

The Application object has the following properties, methods, and events:

Properties
ActiveDocument | MessageFilters
ActiveProject | Name
ActiveWindow | Path
AddIns | ReceiveMessages
Application | RegistryRoot
ApplicationDataDirectory | Signals
Connections | SymbolsManager
CurrentDirectory | TextEditor
CurrentTime | TimeFormat
Documents | TransmitMessages
FullName | VBSMacroFiles
Handle | Version
IsActive | Windows
MainWindow |
Methods
AddCommand | PrintToOutputWindow
AddCommandBarButton | Quit
AddKeybinding | SetAddInInfo
ExecuteCommand | TimeToString
NewProject | Wait
Events
OnApplicationShutDown | OnProjectClose
OnConnectionAdd | OnProjectOpen
OnConnectionConnect | OnSymbolsActivate
OnConnectionChanged | OnSymbolsDeactivate
OnConnectionDisconnect | OnSymbolsDeactivated
OnConnectionRemove | OnTracerActivate
OnDocumentClose | OnTracerDeactivate
OnDocumentOpen | OnTracerFull
OnDocumentSave | OnTracerPause
OnMessageFilterAdd | OnTracerStart
OnMessageFilterChanged | OnTracerStop
OnMessageFilterRemove | OnWindowActivate
OnNewDocument | OnWindowDeactivate
OnOptionsChanged |
Remarks

Since Application is the top object, its name is automatically included, when its properties or methods are accessed in a VBS Macro. Therefore you only need to indicate property's or method's name. If e.g. you want to access the Quit method, you only need to write Quit and not Application.Quit.

Add-ins and other clients that can use early binding can access the members of the Application object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Application object implements the Dual Interface IPEApplication (IID: A2388B6D-6AF5-419C-93A2-8EE2A8AF1C1A).


CallbackLibraryEvent Object

The CallbackLibraryEvent object encapsulates a Callback Library that is passed to callback functions that handle library-related events.

Application

CallbackLibraries (not accessible via Automation)

CallbackLibrary (not accessible via Automation)

CallbackLibraryEvent

The CallbackLibraryEvent object has the following properties:

Properties
Application | IsEnabled
FullName | Name
Remarks

Callback Libraries can access the CallbackLibraryEvent object in callback handler functions. It is provided as a function parameter for the events OnEnable and OnDisable.

Callback Libraries that can use early binding can access the members of the CallbackLibraryEvent object by referencing the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder. The CallbackLibraryEvent object implements the interface IPECallbackLibraryEvent (IID: 2F9B6A72-2A97-4EC1-A884-590A21A35D12).


Connection Object

The Connection object represents a connection between PCAN-Explorer and a CAN bus.

Application

Connections

Connection

The Connection object has the following properties and methods:

Properties
Application | Filter
BitRate | IsEnabled
Bus | IsValid
CalculateBusLoad | Name
Collection | Protocol
CommunicationObject | Symbols
Connection | SymbolsFileName
Device |
Methods

BeginUpdate

EndUpdate
Remarks

The Connection object can be accessed by using the Connections property of the Application object. This object has members (properties and methods), that you can use to manipulate the connection.

Add-ins and other clients that can use early binding can access the members of the Connection object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Connection object implements the Dual Interface IPEConnection (IID: EE41C91A-25F7-4A55-9956-99D07CDAF7FD).


Document Object

The Document object represents an opened document.

Application

Documents

Document

The Document object has the following properties and methods:

Properties
ActiveWindow | IsSaved
Application | Kind
Collection | Name
FullName | Object
IsActive | Path
IsReadOnly | Type
Methods
Close | Save
PrintOut |
Remarks

The Document object can be accessed by using the Documents property of the Application object. This object has members (properties, methods, and events), that you can use to manipulate the document.

If the document is a text file, it also has a TextDocument object. This object has all the members of a Document object and also has members, that allow you to access text-specific attributes of the document.

Use a document's Type property to determine, which members you can access. If the type is "Generic", the document is not a text document and you can access only Document members. If the type is "Text", the document is a text document and you can access TextDocument members as well as Document members.

In VBScript Macros you can access TextDocument members by automatically using late binding. In Add-ins however you can also access these members by using early binding. Early binding offers better performance than late binding by making calls into the interface faster at run time.

The current document can be accessed by using the ActiveDocument property of the Application object.

All open documents belong to the Documents collection, which is represented by the Documents collection. A specific document can be found by iterating through this collection.

Add-ins and other clients that can use early binding can access the members of the Document object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Document object implements the Dual Interface IPEDocument (IID: C786025E-6A99-4F20-8282-46EE67607696).


Enum Object

The Enum object defines text representations for a set of ordinal values. Enums are used by Variables or Signals to provide more easily understandable values to the user, if the Signal's or Variable's value is equal to one of the values defined in an Enum.

Application

SymbolsManager

Symbols

Enums

Enum

The Enum object has the following properties and methods:

Properties
Application | Description
Collection | Name
Count |
Methods
Add | GetOrdinal
FindOrdinal | GetString
FindString |
Remarks

The Enum objects can be accessed by using the Enums property of a Symbols collection. This object has members (properties and methods) that you can use to manipulate the Enum.

Add-ins and other clients that can use early binding can access the members of the Enum object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Enum object implements the Dual Interface IPEEnum (IID: 3E0FE2F9-9B7F-410D-A093-11018A22E351).


J1939AddrName Object

Encapsulates the NAME value which uniquely identifies the primary function of an ECU and its instance on the network.

Application

Connections

Connection

J1939Node

J1939AddrName

The J1939AddrName object has the following properties:

Property | Description
ArbitraryAddressCapable | A Boolean value that specifies, whether the Controller Application is self-configurable and can use an arbitrary source address to resolve an address claim conflict. Note: The J1939 Add-in does not support self-configuration.
AsArray | A SafeArray that sets and returns the contents of the 64-bit NAME field.
AsNumber | An UInt64 value that sets and returns the contents of the 64-bit NAME field.
ECUInstance | Indicates, which one of a group of electronic control modules associated with a given function is being referenced.
Function | A capability of a vehicle system having one or more ECUs that are connected to a J1939 bus segment of a Vehicle System.
FunctionInstance | Identifies a particular occurrence of a function on the same Vehicle System on the network.
IdentityNumber | A unique value that is necessary to resolve any address contention. The manufacturer of an ECU must provide this uniqueness among products.
IndustryGroup | Identifies NAMEs associated with a particular industry that uses J1939. For example, on-highway or agricultural equipment.
ManufacturerCode | Indicates, which company was responsible for the production of the ECU for which this NAME is being referenced.
VehicleSystemInstance | Identifies a particular occurrence of a particular Vehicle System within a connected network.
VehicleSystem | A subcomponent of a vehicle that includes one or more J1939 segments.

For more information about the meaning of the NAME fields, see document SAE J1939-81, chapter 4.1.

Remarks

The J1939AddrName object can be accessed by using the AddressName property of the J1939Node object. This object has members (properties) that you can use to manipulate the J1939 NAME field.

Add-ins and other clients that can use early binding can access the members of the J1939AddrName object by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939AddrName object implements the Dual Interface IPCANJ1939AddrName (IID: 62985A49-78FE-48F7-8FBD-99887E2B1E4C).


J1939Filter Object

The J1939Filter object can be used to filter the messages that are received by its parent J1939Node object.

Application

Connections

Connection

J1939Node

J1939Filters

J1939Filter

The J1939Filter object has the following properties:

Properties
Collection | PGN
DestinationAddress | Priority
Flags | SourceAddress
Remarks

The J1939Filter object can be accessed by using the Filters property of the J1939Node object.

Add-ins and other clients that can use early binding can access the members of the J1939Filter object by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939Filter object implements the Dual Interface IPCANJ1939Filter (IID: 6A582964-B6AD-4F46-8350-B3DAFCA45CBF).


J1939Msg Object

The J1939Msg object represents a J1939 message that can be sent by a J1939Node object.

The J1939Msg object has the following properties:

Properties
ID | PacksCount
Data | PGN
DataArray | Priority
Length | Responder
Originator |
Remarks

Add-ins and other clients that can use early binding can access the members of the J1939Msg object by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939Msg object implements the Dual Interface IPCANJ1939Msg (IID: 2C6B24F6-CDF8-4A22-B456-236B56FD70E6).

Example

VBScript Macros can create the J1939Msg object by specifying its type name PCANJ1939Msg in the CreateObject function:

VBS Macro

Sub CreateJ1939MsgExample()

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939Msg")

' Access the message object here

...

End Sub


J1939Node Object

The J1939Node object represents a virtual J1939 node, which is the interface between PCAN-Explorer and a CAN bus using the J1939 protocol. In J1939 terminology, a J1939 node object represents a single J1939 Controller Application (CA).

Application

Connections

Connection

J1939Node

The J1939Node object has the following properties and methods:

Properties
AddressClaimStatus | NotificationOnAddressLost
AddressName | NotificationOnMessageReceived
ClaimedAddress | NotificationOnPropertyChange
ClientName | PacksCountOnReadSessions
Connected | PacksCountOnWriteSessions
Device | PGNsToRejectOnRTS
Filters | PreferredAddress
HardwareHandle | RcvEventHandle
HardwareStatus | ReassembleIncomingPackets
HardwareType | Receiving
IncludeEchoes | ReCTSsCountOnReadSessions
IncludeTPMessages | ResetOnBusOff
LastCANError | RetriesCountOnWriteSessions
LastError | UseAddressingProtocol
Monitoring | WindowHandle
NetName | XmtQueueEmpty
NotificationOnAddressClaiming |
Methods
Connect | Read
ClaimAddress | ReleaseAddress
Disconnect | Reset
GetSystemTime | Write
Events
OnAddressClaiming | OnPropertyValueChanged
OnAddressLost |
Remarks

The J1939Node object can be accessed by using the CommunicationObject property of the Connection object. This object has members (properties, methods, and events), that you can use to manipulate the virtual J1939 node.

Add-ins and other clients that can use early binding can access the members of the J1939Node object by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939Node object implements the Dual Interface IPCANJ1939Node (IID: A8E0A47B-D339-4C4D-BC02-71D899C1E4A4).

Example

VBScript Macros can create the J1939Node object by specifying its type name PCANJ1939Node in the CreateObject function:

VBS Macro

Sub CreateJ1939NodeExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

' Access the node object here

...

End Sub


J1939RcvMsg Object

The J1939RcvMsg object represents a J1939 message that was received by a J1939Node object.

The J1939RcvMsg object has the following properties:

Properties
ID | Originator
Data | PacksCount
DataArray | PGN
IsEcho | Priority
Length | Responder
Timestamp |
Remarks

Add-ins and other clients that can use early binding can access the members of the J1939RcvMsg object by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939RcvMsg object implements the Dual Interface IPCANJ1939RcvMsg (IID: 471A7EAD-C9D8-4856-BB85-B1DFC2D02BAC).

Example

VBScript Macros can create the J1939RcvMsg object by specifying its type name PCANJ1939RcvMsg in the CreateObject function:

VBS Macro

Sub CreateJ1939RcvMsgExample()

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939RcvMsg")

' Access the message object here

...

End Sub


MessageFilter Object

The MessageFilter object represents a message filter in a PCAN-Explorer project.

Application

MessageFilters

MessageFilter

The MessageFilter object has the following properties and methods:

Properties
Application | ItemCount
Collection | IsEnabled
Description | Name
Methods
AddItem | Item
BeginUpdate | RemoveItem
ClearItems | ShowFilterDialog
EndUpdate |
Remarks

The MessageFilter object can be accessed by using the MessageFilters property of the Application object. This object has members (properties and methods) that you can use to manipulate the filter.

Add-ins and other clients that can use early binding can access the members of the MessageFilter object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The MessageFilter object implements the Dual Interface IPEMessageFilter (IID: 30037876-4BE6-4798-B989-A1FAEE3991BA).


MessageFilterItem Object

The MessageFilterItem object represents a single filter item of a message filter, which is a set of filter settings.

Application

MessageFilters

MessageFilter

MessageFilterItem

The MessageFilterItem object has the following properties and methods:

Properties
AccCode | IDto
AccMask | IsEnabled
Application | IsExtended
Bus | J1939FilterFlags
Collection | PGN
DestinationAddress | Priority
ErrorFramesEnabled | RTREnabled
ErrorWarningsEnabled | SourceAddress
ExcludeMode | Type
IDfrom |
Remarks

The MessageFilterItem object can be accessed by using the Item method of the MessageFilter object. This object has members (properties) that you can use to manipulate the filter item.

Add-ins and other clients that can use early binding can access the members of the MessageFilterItem object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The MessageFilterItem object implements the Dual Interface IPEMessageFilterItem (IID: 42C1B6DE-FBC1-4864-BB32-B35A7316EDBD).


Multiplexer Object

The Multiplexer object is part of a Multiplexers collection.

Application

SymbolsManager

Symbols

Symbol

Multiplexers

Multiplexer

Multiplexers are an extension of a Symbol's CAN-ID and allow a different interpretation of a CAN message's data bytes depending on their contents.

The Multiplexer object has the following properties and methods:

Properties
Application | IsTraced
Collection | MuxData
Color | MuxLength
Comment | MuxStart
CycleTime | MuxValue
DataLength | Name
DefaultData | Parent
DisplayMode | Timeout
IsMotorola | Variables
IsPaused | VisibleVariablesCount
IsRTR |
Methods

Send

Remarks

The Multiplexer objects can be accessed by using the Multiplexers property of the Symbol object.

Add-ins and other clients that can use early binding can access the members of the Multiplexer object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Multiplexer object implements the Dual Interface IPEMultiplexer (IID: 14838ECF-EC72-427A-8D29-6ECC846A22CA).

See also

Symbol Object

Variable Object


OutputWindow Object

The OutputWindow object represents the Output window of the PCAN-Explorer user interface.

Application

Windows

Window

OutputWindow

The OutputWindow object has the following properties:

Properties
ActivePane | OutputWindowPanes
Application | Parent
Remarks

The OutputWindow object can be accessed by using the Windows property of the Application object.

Add-ins and other clients that can use early binding can access the members of the OutputWindow object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The OutputWindow object implements the Dual Interface IPEOutputWindow (IID: 76E27435-3DCA-4AF8-AD80-932600F1AEC0).


OutputWindowPane Object

The OutputWindowPane object represents a tab in the Output window.

Application

Windows

Window

OutputWindow

OutputWindowPanes

OutputWindowPane

The OutputWindowPane object has the following properties and methods:

Properties
Application | Name
Collection |
Methods
Activate | OutputString
Clear |
Remarks

All tabs in the Output window are each represented by a OutputWindowPane object. This object has members (properties and methods) that you can use to manipulate the tab.

You can access the current (active) tab of the Output window by using the ActivePane property of the OutputWindow object.

Add-ins and other clients that can use early binding can access the members of the OutputWindowPane object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The OutputWindowPane object implements the Dual Interface IPEOutputWindowPane (IID: 8FAB1FD1-F85A-4F15-8DB6-F2BC77C972EF).


PCANBitrate Object

The PCANBitrate object represents a CAN or CAN FD bit rate.

Application

Connections

Connection

PCANClientConnection

PCANBitrate

The PCANBitrate object has the following properties:

Properties
AsString | NominalBitrate
BTR0BTR1 | NominalPrescaler
Clock | NominalSampling
DataBitrate | NominalSyncJumpWidth
DataPrescaler | NominalTSeg1
DataSyncJumpWidth | NominalTSeg2
DataTSeg1 | ParameterString
DataTSeg2 | Parent
Remarks

The PCANBitrate object can be accessed by using the NetBitRate property or the HardwareBitRate property of the PCANClientConnection object.

Add-ins and other clients that can use early binding can access the members of the PCANBitrate object by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANBitrate object implements the Dual Interface IPCANBitrate (IID: D42F37C2-5095-4570-B10D-5F3164F0FA0F).


PCANClient Object

The PCANClient object represents the interface between PCAN-Explorer and the CAN bus. As a client it sets down on the PCAN system lying below.

Application

Connections

Connection

PCANClient

The PCANClient object has the following properties, methods and events:

Properties
AutoConnect | Language
AutoRegister | LastError
Connections | LastErrorText
Device | Messages
DriverVersion | Name
ErrorFrames | RcvEventHandle
FilterCode | SelfReceive
FilterMask | Version
Handle | WindowHandle
IsConnected | XmtQueueEmpty
IsRegistered |
Methods
GetDriverParam | Remove
GetErrorText | Reset
GetHardwareParam | ResetFilters
GetLongErrorText | SetDriverParam
GetNetParam | SetHardwareParam
GetParam | SetNetParam
GetSystemTime | SetParam
Register |
Events
OnClientConnect | OnClientRemove
OnClientDisconnect | OnFilterChanged
OnClientRegister | OnHardwareReset
Remarks

The PCANClient object can be accessed by using the CommunicationObject property of the Connection object. This object has members (properties, methods, and events) that you can use to manipulate the PCAN client.

Add-ins and other clients that can use early binding can access the members of the PCANClient object by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANClient object implements the Dual Interface IPCANClient (IID: 134E5DE2-BB99-4664-A4FE-DBBC31D94DF1).

VBScript Macros can create the PCANClient object by specifying its type name in the CreateObject function:

VBS Macro

Sub CreatePCANClientExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

' Access the PCANClient object here

' ...

End Sub


PCANClientConnection Object

The PCANClientConnection object represents a connection between a PCANClient object and a CAN bus.

Application

Connections

Connection

PCANClient

PCANClientConnections

PCANClientConnection

The PCANClientConnection object has the following properties and methods:

Properties
Collection | IsConnected
HardwareBaudRate | ListenOnly
HardwareBitRate | NetBaudRate
HardwareBitRateText | NetBitRate
HardwareHandle | NetBitRateText
HardwareInterrupt | NetHandle
HardwareName | NetName
HardwarePort | Parent
HardwareStatus | XmtQueueEmpty
Methods
ConnectDialog | ResetHardware
RegisterMsg | SetFilter
Remarks

The PCANClientConnection objects can be accessed by using the Connections property of the PCANClient object. This object has members (properties and methods) that you can use to manipulate the connection.

Add-ins and other clients that can use early binding can access the members of the PCANClientConnection object by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANClientConnection object implements the Dual Interface IPCANClientConnection (IID: 8926700A-4E0F-4C13-B3C3-0D5650A17BA2).


PCANMessage Object

The PCANMessage object represents a CAN message.

Application

Connections

Connection

PCANClient

PCANMessages

PCANMessage

The PCANMessage object has the following properties and methods:

Properties
Collection | LastErrorText
Data | MsgType
DLC | Parent
ID | RcvNet
LastError | Timestamp
Methods

Read

Write
Remarks

The PCANMessage object can be accessed by using the Messages property of the PCANClient object.

Add-ins and other clients that can use early binding can access the members of the PCANMessage object by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANMessage object implements the Dual Interface IPCANMessage (IID: 4DA0F2CF-3594-4FE1-AFB6-2B56FAF28649).


Project Object

The Project object represents a PCAN-Explorer Project.

Application

Project

The Project object has the following properties:

Properties
Application | Parent
Connections (see Remarks) | Path
Description | PostLoadCommand
FullName | ProjectItems
IsSaved | ReceiveList (see Remarks)
Macros (see Remarks) | Signals (see Remarks)
MessageFilters (see Remarks) | Timings (see Remarks)
Name | TransmitList (see Remarks)
Methods
AddItem | RemoveItem
BeginUpdate | Save
EndUpdate | SaveAs
Remarks

The Project object can be accessed by using the ActiveProject property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Project object by referencing the PCAN-Explorer Project System Type Library, which resides in the library module PrjSys.dll. The Project object implements the Dual Interface IPEProject (IID: A4B49DA6-0306-4C01-94B2-70D5532DB3F6).

The properties Connections, Macros, MessageFilters, Signals, and Timings each return a ProjectItems collection containing objects that represent these project items.

The properties ReceiveList and TransmitList each return a ProjectItem object. These objects are used internally to manage user settings associated with the message lists, and which are saved in the project file.


ProjectItem Object

The ProjectItem object represents an item in a PCAN-Explorer Project.

Application

Project

ProjectItems

ProjectItem

The ProjectItem object has the following properties:

Properties
Application | Object
Collection | Project
Kind | ProjectItems
Name |
Methods

BeginUpdate

EndUpdate
Remarks

The ProjectItem objects can be accessed by using the ProjectItems property of the Project object.

Add-ins and other clients that can use early binding can access the members of the ProjectItem object by referencing the PCAN-Explorer Project System Type Library, which resides in the library module PrjSys.dll. The ProjectItem object implements the Dual Interface IPEProjectItem (IID: 0B43E279-BD7C-440D-83EB-7586F92E643B).

See also

ProjectItems Collection


ReceiveEvent Object

The ReceiveEvent object encapsulates a received message that is passed to callback functions that handle receive-related events.

Application

ReceiveMessages

ReceiveMessage

ReceiveEvent

The ReceiveEvent object has the following properties and methods:

Properties
Bus | MsgType
Data | PGN
Data64 | Priority
DataArray | RcvNet
DataLength | SourceAddress
DataVariant | SymbolName
DestinationAddress | Timeout
DLC | Timestamp
EventCount | TimestampAbs
ID | TimestampAbsString
MaxCycleTime | TimingErrorCount
MinCycleTime | VariableStringValue
MinInterval | VariableValue
Methods

PrintToOutputWindow

Remarks

Callback Libraries can access the ReceiveEvent object in callback handler functions. It is provided as a function parameter for the events OnReceive and OnTimingError.

Callback Libraries that can use early binding can access the members of the ReceiveEvent object by referencing the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder. The ReceiveEvent object implements the interface IPEReceiveEvent.


ReceiveMessage Object

The ReceiveMessage object represents a received CAN message.

Application

ReceiveMessages

ReceiveMessage

The ReceiveMessage object has the following properties:

Properties
Application | MsgType
Collection | Multiplexer
Connection | PGN
Data | Priority
Data64 | RcvNet
DataArray | SourceAddress
DataLength | Symbol
DataVariant | Timeout
DestinationAddress | Timestamp
DLC | TimestampAbs
EventCount | TimestampAbsString
ID | TimingErrorCount
MaxCycleTime | VariableStringValue
MinCycleTime | VariableValue
MinInterval |
Remarks

The ReceiveMessage object can be accessed by using the ReceiveMessages property of the Application object.

Add-ins and other clients that can use early binding can access the members of the ReceiveMessage object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The ReceiveMessage object implements the Dual Interface IPEReceiveMessage (IID: 63D7F7C2-966C-49DD-AF85-D93EEA76C1FB).


ReceiveTransmitWindow Object

The ReceiveTransmitWindow object represents the view of the central Receive/Transmit window.

Application

Windows

Window

ReceiveTransmitWindow

The ReceiveTransmitWindow object has the following properties:

Properties
Application | SplitState
Parent | TransmitMessages
ReceiveMessages | Window
Remarks

The ReceiveTransmitWindow object is returned by the Object property of the Window object, if the window is the Receive/Transmit window.

Add-ins and other clients that can use early binding can access the members of the ReceiveTransmitWindow object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The ReceiveTransmitWindow object implements the Dual Interface IPEReceiveTransmitWindow (IID: FE69211A-18A0-4C37-B057-582E611DB39B).

Example
VBS Macro

Sub ReceiveTransmitWindowExample()

Dim objRxTx

Set objRxTx = Windows(peWindowKindReceiveTransmit).Object

MsgBox objRxTx.Window.Caption

End Sub

See also

Window Object


Signal Object

The Signal object represents a logical or physical value. The Signal object itself is part of a Signals collection.

Application

Signals

Signal

The Signal object has the following properties and methods:

Properties
Application | RunningMaxTime
Collection | RunningMean
Comment | RunningMin
DataType | RunningMinTime
DecimalPlaces | ShortName
Enum | Source
EnumName | SourceKind
InitValue | SPN
LongName | StatisticsEnabled
Max | StringValue
Min | Unit
Name | Value
RunningMax | ValueChangeTime
Methods
BeginUpdate | RegisterCallback
CalculateStatisticsFromTracer | UnregisterCallback
EndUpdate |
Remarks

The Signal objects can be accessed by using the Signals property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Signal object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Signal object implements the Dual Interface IPESignal (IID: 3C14E50F-47CC-407A-89EE-9F93E01C50A5).


Symbol Object

The Symbol object represents a CAN message that has been equipped with new properties to bring it in a clearly readable form for the user. The Symbol object itself is part of a Symbols collection.

Application

SymbolsManager

Symbols

Symbol

The Symbol object has the following properties:

Properties
Application | MuxLength
CanId | MuxStart
CanIdHi | Name
Collection | PGN
Comment | Priority
DefaultMultiplexer | SourceAddress
DestinationAddress | Type
IsExtended | XferDirection
Multiplexers |
Remarks

The Symbol objects can be accessed by using the Item method of a Symbols collection.

Add-ins and other clients that can use early binding can access the members of the Symbol object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Symbol object implements the Dual Interface IPESymbol (IID: EBBF2C1F-6E68-4619-BCCC-378321D876AA).

See also

Symbols Collection

Multiplexer Object

SymbolsManager Collection


TextDocument Object

The TextDocument object represents an opened text file.

Application

Documents

TextDocument

The TextDocument object has the following properties and methods:

Properties
ActiveWindow | Language
Application | Name
Collection | Object
FullName | Path
IsActive | Selection
IsReadOnly | TabSize
IsSaved | Type
Kind |
Methods
Close | Save
PrintOut |
Remarks

The TextDocument object can be accessed by using the Documents property of the Application object.

Add-ins and other clients that can use early binding can access the members of the TextDocument object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TextDocument object implements the Dual Interface IPETextDocument (IID: A57FAF44-FAF3-4B16-A395-07E12D1F54BC).

See also

Document Object

Documents Collection


TextEditor Object

The TextEditor object represents the PCAN-Explorer text editor.

Application

TextEditor

The TextEditor object has the following properties. These properties have influence on all text files, that are opened in the editor. For details about text documents, see TextDocument object.

Properties
Application | Overtype
Parent |
Remarks

The TextEditor object can be accessed by using the TextEditor property of the Application object.

Add-ins and other clients that can use early binding can access the members of the TextEditor object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TextEditor object implements the Dual Interface IPETextEditor (IID: 4A80C598-2CA6-4A57-AA22-08AA095D745E).


TextSelection Object

The TextSelection object represents a selection in a text editor window. A selection is a single point (the cursor position) or a continuous area of text.

Application

Documents

TextDocument

TextSelection

Using the TextSelection object, you can move the cursor position, check which text is selected and alter the contents of the selection.

The TextSelection object has the following properties and methods:

Properties
Application | Parent
CurrentColumn | Text
CurrentLine |
Methods
Backspace | GoToLine
Cancel | LineDown
CharLeft | LineUp
CharRight | MoveTo
Copy | PageDown
Cut | PageUp
Delete | Paste
EndOfLine | SelectAll
FindText | StartOfLine
Remarks

The TextSelection object can be accessed by using the Selection property of the TextDocument object.

Add-ins and other clients that can use early binding can access the members of the TextSelection object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TextSelection object implements the Dual Interface IPETextSelection (IID: 60C8731A-ACC8-41FF-8CFF-21470B8EDAD5).

See also

Document Object


TextWindow Object

The TextWindow object represents a window containing an opened text document.

Application

Windows

Window

TextWindow

The TextWindow object has the following properties:

Properties
Application | Selection
Parent | Window
Remarks

The TextWindow object is returned by the Object property of the Window object, if the window is a text window.

Add-ins and other clients that can use early binding can access the members of the TextWindow object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TextWindow object implements the Dual Interface IPETextWindow (IID: 06A18C9C-9E8D-4638-A0BB-1FE46BA569C2).

Example
VBS Macro

Sub TextWindowExample()

' Open a text window before execution

Dim objTW

Set objTW = ActiveWindow.Object

MsgBox objTW.Window.Caption

End Sub

See also

Window Object


TraceMessage Object

The TraceMessage object represents a recorded CAN message.

Application

Windows

Window

TraceWindow

Tracer

Messages

TraceMessage

The TraceMessage object has the following properties:

Properties
Application | IsTimeout
Collection | MsgType
Connection | Multiplexer
Data | PGN
Data64 | Priority
DataArray | SourceAddress
DataLength | Symbol
DataVariant | Timestamp
DestinationAddress | TimestampAbs
DLC | TimestampAbsString
EventCount | VariableStringValue
ID | VariableValue
IsReceived |
Remarks

The TraceMessage object can be accessed by using the Messages property of the Tracer object.

Add-ins and other clients that can use early binding can access the members of the TraceMessage object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TraceMessage object implements the Dual Interface IPETraceMessage (IID: 9875021A-820A-45C6-90FE-455749D84F66).


Tracer Object

The Tracer object represents a PCAN-Explorer Tracer for the logging of CAN messages.

Application

Windows

Window

TraceWindow

Tracer

The Tracer object has the following properties and methods:

Properties
Application | Messages
BufferType | Parent
BufferSize | PlaybackPosition
CanIdFormat | PlaybackRepeat
DataFormat | PlaybackRepeatCount
Description | PlaybackRepeatPause
Document | ShowAbsoluteTime
EntryCount | ShowDLC
FillingLevel | StartTime
Filter | TimestampFormat
FirstMessageSetsStartTime | TraceState
Methods
AbortOperation | Play
ApplyFilter | Start
Pause | Stop
Remarks

The Tracer object can be accessed by using the Tracer property of the TraceWindow object.

Add-ins and other clients that can use early binding can access the members of the Tracer object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Tracer object implements the Dual Interface IPETracer (IID: 43674C7C-22FB-4D2E-9438-11109E5CAA92).


TraceWindow Object

The TraceWindow object represents the view of a Tracer object.

Application

Windows

Window

TraceWindow

The TraceWindow object has the following properties:

Properties
Application | Tracer
Parent | Window
Remarks

The TraceWindow object is returned by the Object property of the Window object, if the window is a trace window.

Add-ins and other clients that can use early binding can access the members of the TraceWindow object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TraceWindow object implements the Dual Interface IPETraceWindow (IID: 8CF6A535-EC1C-4674-92F8-71F7B1E7FA59).

Example
VBS Macro

Sub TraceWindowExample()

' Open a trace window before execution

Dim objTW

Set objTW = ActiveWindow.Object

MsgBox objTW.Window.Caption

End Sub

See also

Window Object


TransmitEvent Object

The TransmitEvent object encapsulates a transmit message that is passed to callback functions that handle transmit-related events.

Application

TransmitMessages

TransmitMessage

TransmitEvent

The TransmitEvent object has the following properties and methods:

Properties
Bus | IsPaused
Comment | LastError
Creator | LastErrorType
CycleTime | MsgType
Data | PGN
Data64 | Priority
DataArray | SourceAddress
DataLength | SymbolName
DataVariant | Timestamp
DestinationAddress | TimestampAbs
DLC | TimestampAbsString
EventCount | VariableStringValue
ID | VariableValue
Methods

PrintToOutputWindow

Remarks

Add-ins and Callback Libraries can access the TransmitEvent object in callback handler functions. It is provided as a function parameter for the events OnBeforeTransmit, OnAfterTransmit, OnResume, OnPause, and OnReset.

Add-ins and Callback Libraries that can use early binding can access the members of the TransmitEvent object by referencing the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder. The TransmitEvent object implements the interface IPETransmitEvent.


TransmitMessage Object

The TransmitMessage object represents a CAN message to be sent.

Application

TransmitMessages

TransmitMessage

The TransmitMessage object has the following properties and methods:

Properties
Application | IsPaused
Collection | LastError
Comment | LastErrorType
Connection | MsgType
Creator | Multiplexer
CycleTime | PGN
Data | Priority
Data64 | SourceAddress
DataArray | Symbol
DataLength | Timestamp
DataVariant | TimestampAbs
DestinationAddress | TimestampAbsString
DLC | VariableStringValue
EventCount | VariableValue
ID |
Methods
BeginUpdate | Write
EndUpdate |
Remarks

The TransmitMessage object can be accessed by using the TransmitMessages property of the Application object.

Add-ins and other clients that can use early binding can access the members of the TransmitMessage object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TransmitMessage object implements the Dual Interface IPETransmitMessage (IID: ED66C1FD-9678-46CE-90E2-C75055CCDD03).


TransmitWindow Object

The TransmitWindow object represents the view of a TransmitMessages collection.

Application

Windows

Window

TransmitWindow

The TransmitWindow object has the following properties:

Properties
Application | Parent
Messages | Window
Remarks

The TransmitWindow object is returned by the Object property of the Window object, if the window is a transmit window.

Add-ins and other clients that can use early binding can access the members of the TransmitWindow object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TransmitWindow object implements the Dual Interface IPETransmitWindow (IID: 8A7AB4F4-B5D5-457F-A3C9-932606DE950A).

Example
VBS Macro

Sub TransmitWindowExample()

' Open a Transmit List before execution

Dim objTW

Set objTW = ActiveWindow.Object

MsgBox objTW.Window.Caption

End Sub

See also

Window Object


Variable Object

The Variable object represents a logical or physical value, which corresponds to a defined part of data bytes (a bit string) of a CAN message. The Variable object itself is part of a Variables collection.

Application

SymbolsManager

Symbols

Symbol

Multiplexers

Multiplexer

Variables

Variable

The Variable object has the following properties:

Properties
Application | IsTraced
AutoTransmit | LongName
BitCount | Max
BitStart | Min
Collection | Name
Comment | Offset
DataType | OutputFormat
DecimalPlaces | Parent
DefaultValue | QualifiedName
DisplayMode | Signal
Enum | SPN
EnumName | Unit
Factor | Value
IsMotorola |
Methods

MessageToValue

Remarks

The Variable objects can be accessed by using the Variables property of the Multiplexer object.

Add-ins and other clients that can use early binding can access the members of the Variable object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Variable object implements the Dual Interface IPEVariable (IID: 2997DE92-E56F-4D2F-B670-64DFD4792C25).

See also

Multiplexer Object


VBSMacroFile Object

The VBSMacroFile object represents a loaded VBS Macro file.

Application

VBSMacroFiles

VBSMacroFile

The VBSMacroFile object has the following properties:

Properties
Application | DisplayName
Collection | FullName
Description | IsEnabled
Remarks

The VBSMacroFile objects can be accessed by using the VBSMacroFiles property of the Application object.

Add-ins and other clients that can use early binding can access the members of the VBSMacroFile object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The VBSMacroFile object implements the Dual Interface IPEVBSMacroFile (IID: 919C4868-BB1C-4C8F-B7C2-31EF9D3EDF36).

See also

VBSMacroFiles Collection


Window Object

A Window object represents a window of the user interface.

Application

Windows

Window

The Window object has the following properties and methods:

Properties
Application | Next
Caption | Object
Collection | ObjectKind
Document | Previous
Height | Top
HWnd | Type
IsActive | Width
IsVisible | WindowState
Kind | WindowStyle
Left |
Methods

Close

Remarks

Each opened window is represented by a Window object. This object has members (properties and methods) that you can use to manipulate the window.

The current (active) window can be accessed by using the ActiveWindow property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Window object by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Window object implements the Dual Interface IPEWindow (IID: 806CA7BF-5B13-4398-ABCC-BE4ABD789C67).


Collections

The term describes a collection of objects that can be created and erased dynamically during runtime. For example, the Documents collection of the Application object contains all open documents in the user interface.

Following collections are available:

Collection | Description
AddIns | All Add-ins listed in the Add-In Manager dialog box. A collection of AddIn objects.
Connections | All connections in the current project. A collection of one or more Connection objects.
Documents | All open documents. A collection of one or more Document objects or TextDocument objects.
Enums | The Enums that are defined in a Symbols file. A collection of Enum objects.
J1939Filters | The filters of a J1939 node. A collection of J1939Filter objects.
MessageFilters | All message filters in the current project. A collection of MessageFilter objects.
Messages | A collection of Message objects, e.g. ReceiveMessage objects, TraceMessage objects, or TransmitMessage objects.
Multiplexers | All Multiplexers of a Symbol. A collection of Multiplexer objects.
OutputWindowPanes | The individual tabs of the output window. A collection of OutputWindowPane objects.
PCANClientConnections | A collection of PCANClientConnection objects.
PCANMessages | A collection of CAN messages.
ProjectItems | A collection of ProjectItem objects.
ReceiveMessages | Received CAN messages. A collection of ReceiveMessage objects.
Signals | A collection of Signal objects.
Symbols | A collection of Symbol objects.
SymbolsManager | A collection of Symbols collections.
TransmitMessages | CAN messages to be sent. A collection of TransmitMessage objects.
Variables | All variables of a Multiplexer. A collection of Variable objects.
VBSMacroFiles | All currently loaded VBS Macro files. A collection of VBSMacroFile objects.
Windows | All open windows. A collection of windows.


AddIns Collection

The AddIns collection represents all Add-ins listed in the Add-In Manager dialog box. The AddIns collection contains AddIn objects.

Application

AddIns

The AddIns collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods

Item

Remarks

The AddIns collection contains all AddIn objects. To find a particular object, iterate through the collection by using the AddIns property of the Application object.

Add-ins and other clients that can use early binding can access the members of the AddIns collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The AddIns collection implements the Dual Interface IPEAddIns (IID: 738E5267-E324-47C3-9C7D-A5D2AD49E38A).

Example

Consider the following VBScript Macro:

VBS Macro

Sub AddInsExample()

Dim objAddIn

For Each objAddIn In AddIns

' Access objAddIn here.

' For example:

MsgBox objAddIn.Name

Next

End Sub

See also

AddIn Object


Connections Collection

The Connections collection represents all connections between PCAN-Explorer and CAN buses. The Connections collection contains one or more Connection objects.

Application

Connections

The Connections collection has the following properties and methods:

Properties
Application | Parent
Count | ReceiveMessages
_NewEnum | TransmitMessages
Methods
Add | Remove
Item |
Remarks

The Connections collection contains all Connection objects. To find a particular object, iterate through the collection by using the Connections property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Connections collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Connections collection implements the Dual Interface IPEConnections (IID: 3CD268E7-9A47-4B96-864C-F26BA502FF15).

Example

Consider the following VBScript Macro, which lists the names of all connections in a message box:

VBS Macro

Sub ConnectionsExample()

Dim objConnection, str

For Each objConnection In Connections

' Access objConnection here.

' For example:

str = str & objConnection.Name & vbCrLf

Next

MsgBox str

End Sub

See also

Connection Object


Documents Collection

The Documents collection represents all open documents. The Documents collection contains one or more Document or TextDocument objects.

Application

Documents

The Documents collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | Open
AddDocumentType | SaveAll
CloseAll | TranslateFileName
Item |
Remarks

The Documents collection contains all Document objects. To find a particular object, iterate through the collection by using the Documents property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Documents collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Documents collection implements the Dual Interface IPEDocuments (IID: C1956813-808F-499A-B03F-B375FCD41AE5).

Example

Consider the following VBScript Macro, which lists all open documents in a message box:

VBS Macro

Sub DocumentsExample()

Dim objDocument, str

For Each objDocument In Documents

' Access objDocument here.

' For example:

str = str & objDocument.FullName & vbCrLf

Next

MsgBox str

End Sub

See also

Document Object

TextDocument Object


Enums Collection

The Enums collection represents all Enums that are defined in a Symbols file. The Enums collection contains Enum objects.

Application

SymbolsManager

Symbols

Enums

The Enums collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | Remove
Item |
Remarks

The Enums collection contains all Enum objects. To find a particular object, iterate through the collection by using the Enums property of a Symbols collection.

Add-ins and other clients that can use early binding can access the members of the Enums collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Enums collection implements the Dual Interface IPEEnums (IID: 606C76DF-981C-4622-996F-044B5D33ED6F).

Example

Consider the following VBScript macro, which lists all Enums defined in a specific Symbols file in the Output Window, on the Macros tab:

VBS Macro

Sub EnumsExample()

Dim objSymbols, objEnum

Set objSymbols = SymbolsManager("MySymbolsFile.sym")

For Each objEnum In objSymbols.Enums

' Access objEnum here.

' For example:

PrintToOutputWindow objEnum.Name

Next

End Sub

See also

Enum Object


J1939Filters Collection

The J1939Filters collection can be used to control the messages that are received from its parent J1939Node object.

Application

Connections

Connection

J1939Node

J1939Filters

The J1939Filters collection has the following properties and methods:

Properties
Count | _NewEnum
IsOpenThroughout | Parent
Item |
Methods
Add | OpenThroughout
Clear | Remove
Get |
Remarks

The J1939Filters collection contains J1939Filter objects. The J1939Filters collection can be accessed by using the Filters property of the J1939Node object. This object has members (properties and methods), that you can use to manipulate the J1939 filters.

Add-ins and other clients that can use early binding can access the members of the J1939Filters collection by referencing the J1939Pcan6 Type Library, which resides in the J1939 Add-in library module J1939Pcan.dll. The J1939Filters collection implements the Dual Interface IPCANJ1939Filters (IID: 3495C9B6-F81D-432B-A5F0-F7A5AB7FE417).


MessageFilters Collection

The MessageFilters collection represents all message filters in the current project. The MessageFilters collection contains one or more MessageFilter objects.

Application

MessageFilters

The MessageFilters collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | Item
Duplicate | Remove
Remarks

The MessageFilters collection contains all MessageFilter objects of the currently loaded project. To find a particular object, iterate through the collection by using the MessageFilters property of the Application object.

Add-ins and other clients that can use early binding can access the members of the MessageFilters collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The MessageFilters collection implements the Dual Interface IPEMessageFilters (IID: 00C00AF7-76C4-436E-B41A-200188430390).

Example

Consider the following VBScript Macro, which lists all message filters in a message box:

VBS Macro

Sub MessageFiltersExample()

Dim objFilter, str

For Each objFilter In MessageFilters

' Access objFilter here.

' For example:

str = str & "Filter " & objFilter.Name & " has " & _

objFilter.ItemCount & " items" & vbCrLf

Next

MsgBox str

End Sub


Messages Collection

The Messages collection represents a collection of CAN messages. The Messages collection contains one or more message objects, e.g. ReceiveMessage objects, TraceMessage objects, or TransmitMessage objects.

The Messages collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | FindSymbol
Clear | Item
FindID | Remove
FindMultiplexer |
Remarks

You can access the Messages collection for example by using the Messages property of the Tracer object.

Add-ins and other clients that can use early binding can access the members of the Messages collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Messages collection implements the Dual Interface IPEMessages (IID: 2850BCEE-4BEC-4CEE-9C7F-C0D5371B4ADE).

See also

Connections Collection

Tracer Object


Multiplexers Collection

The Multiplexers collection represents all Multiplexers of a Symbol. The Multiplexers collection contains one or more Multiplexer objects.

Application

SymbolsManager

Symbols

Symbol

Multiplexers

The Multiplexers collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods

Item

Remarks

The Multiplexers collection contains Multiplexer objects. To find a particular object, you can iterate through the collection by using the Multiplexers property of the respective Symbol object.

Add-ins and other clients that can use early binding can access the members of the Multiplexers collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Multiplexers collection implements the Dual Interface IPEMultiplexers (IID: 6BF30FA9-2337-455B-98F9-9B6AD5570D4E).

Example

Consider the following VBScript Macro, which lists all Multiplexers of the first Symbol in the first Symbols file of the current project:

VBS Macro

Sub MultiplexersExample()

Dim objCollection, objSymbol, objMux

If SymbolsManager.Count > 0 Then

Set objCollection = SymbolsManager.Item(1)

If objCollection.Count > 0 Then

Set objSymbol = objCollection.Item(1)

For Each objMux In objSymbol.Multiplexers

' Access objMux here.

' For example:

PrintToOutputWindow objMux.Name

Next

End If

End If

End Sub

See also

Symbols Collection

Symbol Object

Multiplexer Object


OutputWindowPanes Collection

The OutputWindowPanes collection represents the tabs in the output window. The OutputWindowPanes collection contains one or more OutputWindowPane objects.

Application

Windows

Window

OutputWindow

OutputWindowPanes

The OutputWindowPanes collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods

Add

Item
Remarks

The OutputWindowPanes collection contains all OutputWindowPane objects. To find a particular object, you can iterate through the collection by using the OutputWindowPanes property of the OutputWindow object.

Add-ins and other clients that can use early binding can access the members of the OutputWindowPanes collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The OutputWindowPanes collection implements the Dual Interface IPEOutputWindowPanes (IID: 6CA975C0-FD4D-4809-996B-1C99D5F0145E).

Example

Consider the following VBScript Macro, which adds a new pane to the output window:

VBS Macro

Sub PanesExample()

Dim win, OW, pane

Set win = Windows(peWindowKindOutput)

Set OW = win.Object

Set pane = OW.OutputWindowPanes("My pane")

If pane Is Nothing Then

' Add a new pane to the Output window

Set pane = OW.OutputWindowPanes.Add("My pane")

End If

' Access the new pane here.

' For example:

pane.OutputString("Test")

End Sub

See also

OutputWindow Object

OutputWindowPane Object


PCANClientConnections Collection

The PCANClientConnections collection represents all connections between a PCANClient object and CAN buses. The PCANClientConnections collection contains one or more PCANClientConnection objects.

PCANClient

PCANClientConnections

The PCANClientConnections collection has the following properties and methods:

Properties
Count | Parent
_NewEnum |
Methods
Add | Remove
Item |
Remarks

The PCANClientConnections collection contains PCANClientConnection objects. To find a particular object, iterate through the collection by using the Connections property of the PCANClient object.

Add-ins and other clients that can use early binding can access the members of the PCANClientConnections collection by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANClientConnections collection implements the Dual Interface IPCANClientConnections (IID: 6E46257E-5C11-4CCC-B0C2-04BB02501B1F).

Example

Consider the following VBScript Macro, which connects a PCANClient object to the PCAN-net "TestNet":

VBS Macro

Sub NewClientConnectionSample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Name = "MyClient"

client.Device = "pcan_usb"

Set conn = client.Connections.Add("TestNet")

' Access the PCANClientConnection object here

End Sub

See also

PCANClient Object


PCANMessages Collection

The PCANMessages collection represents CAN messages. The PCANMessages collection contains one or more PCANMessage objects.

PCANClient

PCANMessages

The PCANMessages collection has the following properties and methods:

Properties
Count | Parent
_NewEnum |
Methods

Add

Item
Remarks

You can access the PCANMessages collection by using the Messages property of the PCANClient object.

Add-ins and other clients that can use early binding can access the members of the PCANMessages collection by referencing the PCAN4 Type Library, which resides in the library module Pcan4.dll. The PCANMessages collection implements the Dual Interface IPCANMessages (IID: 1866BFE9-D2EF-4A1E-8A20-0907EEA371EB).

Example

Consider the following VBS Macro, which connects a PCANClient object to a PCAN-net, and then transmits a CAN message:

VBS Macro

Sub PCANMessagesExample()

Dim client, conn, msg

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

Set msg = client.Messages.Add

' Access the PCANMessage object here.

' For example:

With msg

.Bus = 1

.ID = &H100

.DLC = 3

.Data(0) = &H11

.Data(1) = &H22

.Data(2) = &H33

.Write conn, 0

End With

End Sub

See also

PCANClient Object

PCANMessage Object


ProjectItems Collection

The ProjectItems collection represents a group of items in a project. The ProjectItems collection contains one or more ProjectItem objects.

Application

Project

ProjectItems

The ProjectItems collection has the following properties and methods:

Properties
Application | Parent
Count | Project
_NewEnum |
Methods
AddItem | RemoveItem
CanAddItem | RenameItem
Item |
Remarks

The ProjectItems collection contains ProjectItem objects. You can access the ProjectItems collection e.g. by using the ProjectItems property of the Project object.

Add-ins and other clients that can use early binding can access the members of the ProjectItems collection by referencing the PCAN-Explorer Project System Type Library, which resides in the library module PrjSys.dll. The ProjectItems collection implements the Dual Interface IPEProjectItems (IID: D511D272-625F-401F-B223-ECA77F395C7E).

Example

Consider the following VBS Macro, which lists all files of the current project in the output window, on the Macro tab:

VBS Macro

Sub ProjectItemsExample()

If Not ActiveProject Is Nothing Then _

OutputItems ActiveProject.ProjectItems

End Sub

Sub OutputItems(items)

Dim i, item

For i = 1 To items.Count

Set item = items(i)

If item.Kind = peProjectItemKindFile Then _

PrintToOutputWindow item.Object.RelativePath

If Not (item.ProjectItems Is Nothing) Then _

OutputItems item.ProjectItems

Next

End Sub

See also

ProjectItem Object


ReceiveMessages Collection

The ReceiveMessages collection represents received CAN messages. The ReceiveMessages collection contains one or more ReceiveMessage objects.

Application

ReceiveMessages

The ReceiveMessages collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Filter |
Methods
Add | Item
Clear | RegisterCallback
FindID | Remove
FindMultiplexer | UnregisterCallback
FindSymbol |
Remarks

The ReceiveMessages collection contains all ReceiveMessage objects. You can access the ReceiveMessages collection by using the ReceiveMessages property of the Application object.

Add-ins and other clients that can use early binding can access the members of the ReceiveMessages collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The ReceiveMessages collection implements the Dual Interface IPEReceiveMessages (IID: 9C3F48A5-E9BA-4898-91C2-941612E9F343).

Example

Consider the following VBS Macro, which displays the number of entries in the Receive List:

VBS Macro

Sub ReceiveMessagesExample()

MsgBox "Number of entries: " & ReceiveMessages.Count

End Sub

See also

Messages Collection

TransmitMessages Collection


Signals Collection

The Signals collection represents all Signals of a Multiplexer. The Signals collection contains one or more Signal objects.

Application

Signals

The Signals collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | SelectSignal
Item | SelectSignals
Remove |
Remarks

The Signals collection contains all Signal objects. To find a particular object, you can iterate through the collection by using the Signals property of the Application object.

Add-ins and other clients that can use early binding can access the members of the Signals collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Signals collection implements the Dual Interface IPESignals (IID: 5895A0A5-4C9D-4C79-85DC-B84EAFE12676).

Example

Consider the following VBScript Macro, which prints the name of all Signals to the output window, on the Macros tab:

VBS Macro

Sub SignalsExample()

Dim objSignal

For Each objSignal In Signals

' Access objSignal here.

' For example:

PrintToOutputWindow objSignal.Name

Next

End Sub

See also

Signal Object


Symbols Collection

The Symbols collection contains all Symbols defined in a Symbols file. The Symbols collection contains one or more Symbol objects.

Application

SymbolsManager

Symbols

The Symbols collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Document | Title
Enums |
Methods

Item

Remarks

The Symbols collection contains Symbol objects. To find a particular object, you can iterate through the collection by using the Symbols property of the Connection object, or by using the Item method of the SymbolsManager collection.

Add-ins and other clients that can use early binding can access the members of the Symbols collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Symbols collection implements the Dual Interface IPESymbols (IID: 32530A86-13F0-4965-A614-A9E22DC75A08).

Example

Consider the following VBScript macro, which prints the names of all symbols in the first Symbols file to the Output Window, on the Macros tab:

VBS Macro

Sub SymbolsCollectionExample()

Dim objCollection, objSymbol

If SymbolsManager.Count > 0 Then

Set objCollection = SymbolsManager.Item(1)

For Each objSymbol In objCollection

' Access objSymbol here.

' For example:

PrintToOutputWindow objSymbol.Name

Next

End If

End Sub

See also

Symbol Object


SymbolsManager Collection

The SymbolsManager collection contains all Symbols collections that are assigned to the connections in the current project. The SymbolsManager collection contains one or more Symbols collections.

Application

SymbolsManager

The SymbolsManager collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Enums |
Methods

Item

UpdateSymbols
Remarks

The SymbolsManager collection contains Symbols collections. To find a particular object, you can iterate through the collection by using the SymbolsManager property of the Application object.

Add-ins and other clients that can use early binding can access the members of the SymbolsManager collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The SymbolsManager collection implements the Dual Interface IPESymbolsManager (IID: 7E687603-B7D3-4EC6-AFBF-0DF94BF42290).

Example

Consider the following VBScript Macro, which shows all currently loaded Symbols files in a message box:

VBS Macro

Sub SymbolsManagerExample()

Dim objSymbols, str

For Each objSymbols In SymbolsManager

' Access objSymbols here.

' For example:

str = str & objSymbols.Document.FullName

Next

MsgBox str

End Sub

See also

Symbols Collection


TransmitMessages Collection

The TransmitMessages collection represents CAN messages to be sent. The TransmitMessages collection contains one or more TransmitMessage objects.

Application

TransmitMessages

The TransmitMessages collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Add | PauseAll
Clear | RegisterCallback
FindID | Remove
FindMultiplexer | ResumeAll
FindSymbol | UnregisterCallback
Item |
Remarks

The TransmitMessages collection contains TransmitMessage objects. You can access the TransmitMessages collection by using the TransmitMessages property of the Application object, or by using the Messages property of the TransmitWindow object.

Add-ins and other clients that can use early binding can access the members of the TransmitMessages collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The TransmitMessages collection implements the Dual Interfaces IPETransmitMessages (IID: F59F8D70-86B1-46F0-8412-CB5964CEB694), and IPETransmitMessagesEx (IID: 9938AECE-5968-42AF-92B5-89EF73F90713), which is derived from IPETransmitMessages.

Example

Consider the following VBS Macro, which adds a new message to the Transmit List:

VBS Macro

Sub TransmitMessagesExample()

Dim msg

Set msg = TransmitMessages.Add

' Initialize the CAN message

With msg

If Connections.Count > 0 Then _

Set .Connection = Connections(1)

.ID = &H100

.DataLength = 3

.Data(0) = &H11

.Data(1) = &H22

.Data(2) = &H33

End With

End Sub

The same can be done in a C# application, for example in a Desktop Console App:

C#

static void Main(string[] args)

{

IPEApplication app = new PCANExplorer6.Application();

app.MainWindow.IsVisible = true;

// Open a project

app.Documents.Open("$(MyDocsDir)\\PCAN-Explorer 6\\Projects\\MyProject\\MyProject.peproj");

// Create and initialize a Transmit Message

IPETransmitMessage msg = app.TransmitMessages.Add() as IPETransmitMessage;

if (app.Connections.Count > 0)

msg.Connection = app.Connections.Item(1);

msg.ID = 0x100;

msg.DataLength = 3;

msg.Data[0] = 0x11;

msg.Data[1] = 0x22;

msg.Data[2] = 0x33;

}

See also

Messages Collection

ReceiveMessages Collection


Variables Collection

The Variables collection represents all variables of a Multiplexer, or the virtual variables in a Symbols collection. The Variables collection has one or more Variable objects.

Application

SymbolsManager

Symbols

Symbol

Multiplexers

Multiplexer

Variables

The Variables collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods

Item

Remarks

The Variables collection contains Variable objects. To find a particular object, you can iterate through the collection by using the Variables property of the corresponding Multiplexer object.

Add-ins and other clients that can use early binding can access the members of the Variables collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Variables collection implements the Dual Interface IPEVariables (IID: EA036A0A-92B3-4844-9730-F960B9FD4E7E).

Example

The following code snippet from a VBScript Macro lists all Variables of a Multiplexer object in the output window, on the Macros tab:

VBS Macro

Dim objVar

For Each objVar In objMux.Variables

' Access objVar here.

' For example:

PrintToOutputWindow objVar.Name

Next

See also

Multiplexer Object

Variable Object

Symbols Collection


VBSMacroFiles Collection

The VBSMacroFiles collection represents all loaded VBS Macro files. The VBSMacroFiles collection contains VBSMacroFile objects.

Application

VBSMacroFiles

The VBSMacroFiles collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods

Item

Remarks

The VBSMacroFiles collection contains all VBSMacroFile objects. To find a particular object, iterate through the collection by using the VBSMacroFiles property of the Application object.

Add-ins and other clients that can use early binding can access the members of the VBSMacroFiles collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The VBSMacroFiles collection implements the Dual Interface IPEVBSMacroFiles (IID: 1687BACA-AA94-4F11-B3D2-DF01B7855BA4).

Example

Consider the following VBScript Macro, which shows all loaded VBS Macro files in a message box:

VBS Macro

Sub VBSMacroFilesExample()

Dim objFile, str

For Each objFile In VBSMacroFiles

' Access objFile here.

' For example:

str = str & objFile.FullName

Next

MsgBox str

End Sub

See also

VBSMacroFile Object


Windows Collection

The Windows collection represents all open windows in PCAN-Explorer.

Application

Windows

The Windows collection has the following properties and methods:

Properties
Application | _NewEnum
Count | Parent
Methods
Arrange | Item
CloseAll |
Remarks

The Windows collection contains all Window objects. To find a particular object, iterate through the collection by using For Each ... Next in a VBScript Macro.

Add-ins and other clients that can use early binding can access the members of the Windows collection by referencing the PCAN-Explorer Type Library, which resides in the program module PcanExpl.exe. The Windows collection implements the Dual Interface IPEWindows (IID: C4F64075-F612-4AC8-A082-92C76E0131EC).

Example

The following VBS Macro prints the captions of all windows to the output window, on the Macros tab:

VBS Macro

Sub WindowsExample()

Dim objWindow

For Each objWindow In Windows

' Access objWindow here.

' For example:

PrintToOutputWindow objWindow.Caption

Next

End Sub

See also

Window Object


Properties

Properties are the objects' characteristics. Window objects, for example, have Height and Width properties. These properties correspond to the height and the width of the windows.

For more information about properties, see Introduction to Properties.

  • Properties A-F

  • Properties G-K

  • Properties L-P

  • Properties Q-T

  • Properties U-Z


Properties A-F

The following table contains all properties beginning with letters A to F:

Property | Description
AccCode | Sets or returns the acceptance code value of a MessageFilterItem object.
AccMask | Sets or returns the acceptance mask value of a MessageFilterItem object.
ActiveDocument | Returns the Document or TextDocument object that is currently active.
ActivePane | Returns the active pane in the Output window.
ActiveProject | Returns the Project object that is currently loaded.
ActiveWindow | Returns a Window object that represents the active window (the window on top).
AddIns | Returns the AddIns collection that represents all the Add-ins listed in the Add-in Manager dialog box.
AddressClaimStatus | Returns the current address claiming status of a J1939 node.
AddressName | Sets or returns a J1939AddrName object.
Application | Returns the PCAN-Explorer Application object.
ApplicationDataDirectory | Returns the directory that PCAN-Explorer uses to store files containing settings and other data.
AsString | Returns a human-readable interpretation of a bit rate value.
AutoConnect | Sets or returns whether a PCANClient object automatically connects to a PCAN net.
AutoRegister | Sets or returns whether PCAN-Explorer registers itself automatically at the PCAN system at start-up.
AutoTransmit | Sets or returns whether the parent Multiplexer of a Variable is transmitted automatically, when the Variable's value is changed.
BitCount | Returns the number of bits that are used by a variable in the data bytes of the CAN message.
BitRate | Returns the bit rate of a connection.
BitStart | Returns a variable's first bit's index in the data bytes of the CAN message.
BTR0BTR1 | Returns the value of the bus timing registers BTR0 and BTR1 if the PCANBitrate object represents a bit rate for an SJA1000 CAN controller.
BufferSize | Sets or returns the buffer size of a tracer.
BufferType | Sets or returns the type of data buffer a tracer uses to store logged CAN messages.
Bus | Sets or returns the Bus number (1-16) that is assigned to the object.
CalculateBusLoad | Sets or returns whether the current bus load is calculated and the bus load indicator is shown for a connection.
CanId | Returns the CAN ID of a Symbol.
CanIdFormat | Sets or returns the format that is used to display CAN IDs in a trace window.
CanIdHi | Returns the upper CAN ID of a Symbol.
Caption | Returns a string containing the caption of a window.
ClaimedAddress | Returns the address that is currently claimed for a J1939 connection.
ClientName | Sets or returns the name of the PCAN client a J1939 node uses for low-level CAN communication.
Clock | Returns the clock frequency on which a CAN bit rate parameter set is based on.
Collection | Returns the collection containing the object supporting this property.
Color | Returns the color that has been defined to display a Multiplexer.
Comment | Returns the comment that has been defined for a Multiplexer, Symbol, Signal, or Variable object.
CommunicationObject | Returns an object that is responsible for the communication of messages through the connected bus.
Connected | Returns whether the J1939 node object is connected to a CAN bus.
Connection (Variation 1) | Sets or returns a string specifying the connection.
Connection (Variation 2) | Sets or returns a Connection object with which a message object is associated.
Connections (Variation 1) | Returns the Connections collection.
Connections (Variation 2) | Returns the PCANClientConnections collection.
Count | Returns the number of elements in a collection.
Creator | Sets or returns the text that is displayed in transmit lists in the "Creator" column for a message.
CurrentColumn | Returns the column of the caret in a Text window.
CurrentDirectory | Sets or returns the directory used by the Open command on the File menu.
CurrentLine | Returns the line number where the caret is located in a Text window.
CurrentTime | Returns the current PCAN-Explorer time that is used as a basis for generating timestamps.
CycleTime [Variation 1] | Sets or returns the transmit cycle time of a CAN message.
CycleTime [Variation 2] | Returns the transmit cycle time of a Multiplexer.
Data | Sets or returns the data bytes of a CAN message.
Data64 | Sets or returns the 8 data bytes of a CAN message in a single call.
DataArray | Sets or returns all data bytes of a CAN message in a SafeArray.
DataBitrate | Returns the data bit rate of a CAN FD bit rate.
DataFormat | Sets or returns the format that is used to display data bytes in a trace window.
DataLength | Returns the number of data bytes of a Multiplexer.
DataType | Returns the data type of a Signal or a Variable.
DataVariant | Sets or returns all data bytes of a CAN message in a Variant.
DecimalPlaces | Sets or returns the number of decimal places that are displayed for a Signal value or Variable value.
DefaultData | Returns the data bytes of a Multiplexer, which are filled with the default values of the Variables.
DefaultMultiplexer | Returns the Default Multiplexer of a Symbol.
DefaultValue | Returns a Variables's default value.
Description | Sets or returns a string containing the object's description.
DestinationAddress | Sets or returns a J1939 Destination Address.
Device [Variation 1] | Sets or returns the name of the device, which serves as basis of the PCAN system and manages the used CAN hardware.
Device [Variation 2] | Returns or sets the PCAN device that the object uses to access CAN hardware and to communicate with J1939 buses.
DisplayMode | Returns the display mode of a Multiplexer or a Variable.
DisplayName | Returns the name of a VBS Macro file as it is displayed in the various PCAN-Explorer windows.
DLC | Sets or returns the Data Length Code of a CAN message.
Document | Retrieves the Document object associated with the object.
Documents | Returns a Documents collection.
DriverVersion | Returns the version of the driver that is installed for managing the CAN hardware.
EntryCount | Returns the number of entries in a trace buffer or file.
Enum | Returns the Enum object that is associated with a Signal or Variable.
EnumName | Sets or returns the name of an Enum that is associated with a Signal or Variable.
Enums | Returns the Enums collection.
ErrorFrames | Sets or returns whether a PCAN client shall receive Error Frames.
ErrorFramesEnabled | Sets or returns whether Error Frames can pass through a MessageFilterItem object if the filter item operates in Options mode.
ErrorWarningsEnabled | Sets or returns whether Error Warnings can pass through a MessageFilterItem object if the filter item operates in Options mode.
EventCount | Returns a value indicating the number of times a CAN message has been received or transmitted.
ExcludeMode | Sets or returns whether a filter item operates in Exclude mode.
ExtensibilityObject | Allows access to the PEAddIn object implemented by an Add-in.
Factor | Returns the multiplier that was defined for the for the variable to transform its value from a raw value into a physical value.
FillingLevel | Returns the current filling level of a tracer.
Filter | Sets or returns a MessageFilter object that is used by the object to filter messages.
FilterCode | Sets or returns the acceptance code of the message filter for this PCAN client.
FilterMask | Sets or returns the acceptance mask of the message filter for this PCAN client.
Filters | Returns a J1939Filters collection that can be used to control the messages that are received from a J1939Node object.
FirstMessageSetsStartTime | Determines, whether the timestamp of the first message logged by a tracer is used as the reference time that marks the start of a tracer.
Flags | Returns the Flags attribute of a J1939Filter object.
FullName | Returns the full name of a file including the file path.

See also

Properties G-K

Properties L-P

Properties Q-T

Properties U-Z


AccCode Property

Applies to: MessageFilterItem object

Sets or returns the acceptance code value of a MessageFilterItem object that operates in Code/Mask mode.

Syntax

object.AccCode [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Long that specifies a new value for the property.

Property value

A Long value that specifies the acceptance code of a filter that operates in Code/Mask mode.

Remarks

Together with the AccMask property, the AccCode property specifies a filter according to the filter mechanism of a SJA1000 CAN controller.

The AccCode property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemCodeMask.

See also

AccMask Property

Type Property


AccMask Property

Applies to: MessageFilterItem object

Sets or returns the acceptance mask value of a MessageFilterItem object that operates in Code/Mask mode.

Syntax

object.AccMask [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Long that specifies a new value for the property.

Property value

A Long value that specifies the acceptance mask of a filter that operates in Code/Mask mode.

Remarks

Together with the AccCode property, the AccMask property specifies a filter according to the filter mechanism of a SJA1000 CAN controller.

The AccMask property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemCodeMask.

See also

AccCode Property

Type Property


ActiveDocument Property

Applies to: Application object

Returns the Document or TextDocument object that is currently active.

Syntax

object.ActiveDocument

Parameters

object

An expression that evaluates to an Application object.

Property value

The Document or a TextDocument object that is currently active.

Remarks

An active document is one that has the focus. To make another document active, set the focus on its window.

The document retrieved is a Document object or a TextDocument object. The type of the object depends on the type of the document.

If the window that is currently active in the PCAN-Explorer user interface does not have a document, for example the Receive/Transmit window, the ActiveDocument property returns the value Nothing in VBScript. In Visual C++ this corresponds to the value NULL, and C# to the value null.

Example
VBS Macro

Sub DocumentExample()

' A new document must be created before

' this code can be executed.

Dim doc, desc

Set doc = ActiveDocument

If Not doc Is Nothing Then

desc = "You are working on a "

If doc.ReadOnly Then

desc = desc & "write protected"

Else

desc = desc & "writable"

End If

desc = desc & " document named " & doc.Name

Else

desc = "No document is active"

End If

MsgBox desc

End Sub


ActivePane Property

Applies to: OutputWindow object

Gets the most recently active pane in the Output Window.

Syntax

object.ActivePane

Parameters

object

An expression that evaluates to an OutputWindow object.

Property value

An OutputWindowPane object.

Example
VBS Macro

Sub ActivePaneExample()

Dim win

Dim OW

Dim pane

Set win = Windows(peWindowKindOutput)

Set OW = win.Object

' Add a new pane to the Output window

Set pane = OW.OutputWindowPanes.Add("My Pane")

' Display a line of text

pane.OutputString("A Text")

MsgBox "Active page: " & OW.ActivePane.Name

End Sub


ActiveProject Property

Applies to: Application object

Returns the Project object that represents the currently loaded project.

Syntax

object.ActiveProject

Parameters

object

An expression that evaluates to an Application object.

Property value

A Project object.

Example

The following example displays the name of the currently loaded project:

VBS Macro

Sub ActiveProjectExample()

Dim prj

Set prj = ActiveProject

MsgBox "Loaded project: " & prj.Name

End Sub


ActiveWindow Property

Applies to: Application object, Document object

Returns a Window object that represents the active window (the window on top).

Syntax

object.ActiveWindow

Parameters

object

An expression that evaluates to an Application object or a Document object.

Property value

A Window object.

Remarks

If you access the ActiveWindow property of the Application object, you get the currently active window inside the PCAN-Explorer main window. If no window is currently active, the property returns the value Nothing in VBScript. In Visual C++ this corresponds to the value NULL, and C# to the value null.

Example
VBS Macro

Sub ActiveDocumentExample()

' A new document must be created before

' this code can be executed.

Dim objDoc

Set objDoc = ActiveDocument

MsgBox objDoc.ActiveWindow.Caption

End Sub


AddIns Property

Applies to: Application object

Returns the AddIns collection that represents all the Add-ins listed in the Add-in Manager dialog box.

Syntax

object.AddIns

Parameters

object

An expression that evaluates to an Application object.

Property value

An AddIns collection.

Remarks

The AddIns collection represents all the Add-ins listed in the Add-in Manager dialog box (Tools menu). Each Add-in in the collection is represented by an AddIn object.

Example

The following example accesses the AddIns collection:

VBS Macro

Sub AddInsExample()

MsgBox AddIns.Count,,"Number of Add-ins"

End Sub


AddressClaimStatus Property

Applies to: J1939Node object

Returns the current address claiming status of a J1939 node.

Syntax

object.AddressClaimStatus

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A TClaimedStatus enum value. The following values are possible:

  • tcsNone (0): No address has been claimed yet.

  • tcsNotClaim (1): The addressing protocol is disabled for the node. See UseAddressingProtocol property.

  • tcsClaiming (2): The node object is currently in the process of claiming an address.

  • tcsClaimed (3): An address has been claimed.

  • tcsCannotClaim (4): Claiming an address was not successful. Possible reason: An address conflict exists because another J1939 ECU on the bus has claimed the same address, and has a lower NAME value.

  • tcsReleased (5): A previously claimed address was released because the ReleaseAddress method was called.

Example

In the following example, a J1939 node claims an address and then displays the address claiming status:

VBS Macro

Sub J1939_AddressClaimStatusExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdUSB ' = 5

node.ClientName = "Macro"

node.NetName = "TestNet"

node.PreferredAddress = 10

If node.Connect Then

node.ClaimAddress

Select Case node.AddressClaimStatus

Case tcsCannotClaim:

MsgBox "Cannot claim address 10",,"Macro"

Case tcsClaimed:

MsgBox "Address 10 claimed",,"Macro"

End Select

End If

End Sub

See also

ClaimAddress Method

ClaimedAddress Property

PreferredAddress Property

ReleaseAddress Method

UseAddressingProtocol Property


AddressName Property

Applies to: J1939Node object

Sets or returns a J1939AddrName object, which encapsulates the NAME value that uniquely identifies an ECU on the network.

Syntax

object.AddressName [=NameObj]

Parameters

object

An expression that evaluates to a J1939Node object.

NameObj

An expression that evaluates to a J1939AddrName object.

Property value

A J1939AddrName object.

Example

The following example changes a property of the NAME value:

VBS Macro

Sub J1939_AddressNameExample()

' The first connection in the project

' must be a J1939 connection

If Connections(1).Protocol = peProtocolJ1939 Then

' Access the J1939Node object

Dim node

Set node = Connections(1).CommunicationObject

node.AddressName.FunctionInstance = 2

End If

End Sub


Application Property

Applies to: AddIn object, AddIns collection, Application object, CallbackLibraryEvent object, Connection object, Connections collection, Document object, Documents collection, Enum object, Enums collection, MessageFilter object, MessageFilters collection, Multiplexer object, Multiplexers collection, OutputWindow object, OutputWindowPane object, OutputWindowPanes collection, Project object, ProjectItem object, ReceiveMessage object, ReceiveMessages collection, ReceiveTransmitWindow object, Signal object, Signals collection, Symbol object, Symbols collection, TextDocument object, TextEditor object, TextSelection object, TextWindow object, TraceMessages collection, Tracer object, TransmitMessage object, TransmitMessages collection, TransmitWindow object, Variable object, Variables collection, VBSMacroFile object, VBSMacroFiles collection, Window object, Windows collection

Returns the PCAN-Explorer Application object.

Syntax

object.Application

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

The Application object.

Remarks

The Application object represents the whole PCAN-Explorer application. It allows the access to other objects in the PCAN-Explorer object model and makes the access to methods and properties possible, which influence the whole application.

Example

The following example returns the PCAN-Explorer Application object, using the Document object:

VBScript

Dim app

Set app = myDocument.Application


ApplicationDataDirectory Property

Applies to: Application object

Returns the directory that PCAN-Explorer uses to store files containing settings and other data.

Syntax

object.ApplicationDataDirectory

Parameters

object

An expression that evaluates to an Application object. When you access the ApplicationDataDirectory property of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

Property value

A String containing the directory that PCAN-Explorer uses to store files containing settings and other data.

Example

The following example displays the directory, into which PCAN-Explorer stores data files:

VBScript

MsgBox ApplicationDataDirectory


AsString Property

Applies to: PCANBitrate object

Returns a human-readable interpretation of a bit rate value.

Syntax

object.AsString

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A String value that indicates the bit rate, e.g. "1 Mbit/s" for a CAN bit rate, or "Nominal 500 kbit/s, Data 2 Mbit/s" for a CAN FD bit rate.

Example

The following example displays the bit rate of the first connection in the project:

VBS Macro

Sub AsStringExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

MsgBox "Bit rate of Hardware = " & bitrate.AsString

End If

End Sub


AutoConnect Property

Applies to: PCANClient object

Sets or returns whether a PCANClient object automatically connects to a PCAN net.

Syntax

object.AutoConnect [=boolean]

Parameters

object

An expression that evaluates to a PCANClient object.

boolean

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether the PCANClient object automatically connects to a PCAN net when a new connection is added using the Add method of the PCANClientConnections collection. If True, the object automatically connects to the PCAN net (the default). If False, the object does not automatically connect to a PCAN net. A connection to the net then must be established manually by setting the IsConnected property of the PCANClientConnection object.

Example

The following example manually connects a PCANClient object to the net "TestNet":

VBScript

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.AutoConnect = False

Set conn = client.Connections.Add("TestNet")

conn.IsConnected = True

See also

PCANClientConnections Collection


AutoRegister Property

Applies to: PCANClient object

Sets or returns whether a PCANClient object registers itself automatically at the PCAN system when a client name is assigned.

Syntax

object.AutoConnect [=boolean]

Parameters

object

An expression that evaluates to a PCANClient object.

boolean

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the PCANClient object automatically registers itself at the PCAN system when a client name is assigned by setting the Name property. If True, the object automatically registers itself at the PCAN system (the default). If False, the object does not automatically register itself at the PCAN system. The object then must be registered manually by invoking the Register method of the PCANClient object.

Remarks

The AutoRegister property is mainly important at design time of programs that make use of the PCANClient COM component in order to use the PCAN system for communication with CAN busses. The PCANClient COM component can be linked into various development environments, e.g. like Visual Studio or Delphi. At design time, the values of the properties can be configured in a visual property editor. These values are then applied to the properties at the runtime of the created program.


AutoTransmit Property

Applies to: Variable object

Sets or returns whether the Multiplexer that contains the Variable is transmitted automatically when the Variable's value is set by using either its Value or StringValue property.

Syntax

object.AutoTransmit [=value]

Parameters

object

An expression that evaluates to a Variable object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the Multiplexer is transmitted automatically. If True, the Multiplexer is transmitted automatically (the default). If False, the Multiplexer is not transmitted automatically.

Remarks

In the object hierarchy, a Multiplexer object is always the immediate parent of a Variable object. A Multiplexer can be empty if there are no Multiplexers defined for the parent Symbol. In this case, it only serves as a container for the Symbol's Variables.

If the value of a Signal is set, which is based on a CAN variable, no CAN message will be sent if the Variable's AutoTransmit property is set to False.

If the AutoTransmit property is set to True, the Multiplexer is transmitted once each time the value of the Variable is set using the Value or StringValue properties. Even if the Variable's value hasn't changed.

Example

The following example changes the Variable SendSymbolMux.SendMux.HexValue2 from the sample file "Sample.sym", so that the parent Multiplexer is not transmitted automatically:

VBScript

Dim symbols, variable

Set symbols = SymbolsManager("Sample")

Set variable = symbols("SendSymbolMux").Multiplexers("SendMux").Variables("HexValue2")

variable.AutoTransmit = False

- or -

VBScript

Dim variable

Set variable = Signals("HexValue2").Source

variable.AutoTransmit = False

- or -

VBScript

Signals("HexValue2").Source.AutoTransmit = False

See also

StringValue Property

Value Property

Source Property


BitCount Property

Applies to: Variable object

Returns the number of bits that are used by a variable in the data bytes of the CAN message.

Syntax

object.BitCount

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Long value that indicates the number of bits used by the variable.

Example

The following example retrieves the length of a variable:

VBScript

Dim l

l = myVar.BitCount

See also

BitStart Property


BitRate Property

Applies to: Connection object

Returns the bit rate of a connection.

Syntax

object.BitRate

Parameters

object

An expression that evaluates to a Connection object.

Property value

A String value that indicates the bit rate of the connection.

Examples: For standard CAN or J1939 connections, "500 kbit/s"; for CAN FD connections, "Nominal 500 kbit/s, Data 2 Mbit/s".

Remarks

The BitRate property of the Connection object is read-only.

Example

The following example displays the bit rate of the first connection in the project:

VBS Macro

Sub BitRateExample()

MsgBox Connections(1).BitRate

End Sub


BitStart Property

Applies to: Variable object

Returns a variable's first bit's index in the data bytes of the CAN message.

Syntax

object.BitStart

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Long value that indicates the index of the first bit in the data bytes of the CAN message. The index value is 0-based. Index 0 is bit 0 of data byte 0, index 63 is bit 7 of data byte 7.

Example

The following example retrieves the start index of a variable:

VBScript

Dim i

i = myVar.BitStart

See also

BitCount Property


BTR0BTR1 Property

Applies to: PCANBitrate object

Returns the value of the bus timing registers BTR0 and BTR1 if the PCANBitrate object represents a bit rate for an SJA1000 CAN controller.

Syntax

object.BTR0BTR1

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A Long containing a 16-bit value, which is a combination of the two 8-bit values from the bus timing registers BTR0 and BTR1 of the SJA1000 CAN controller. To get a human-readable interpretation of the bit rate value, access the AsString property.

Remarks

If the PCANBitrate object represents a bit rate for an SJA1000 CAN controller, the Clock property has the value 8000000 (8 MHz).

Example

The following example queries the BTR0BTR1 property of a PCANBitrate object:

VBS Macro

Sub BTR0BTR1Example()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

If bitrate.Clock = 8000000 Then

MsgBox "BTR0/BTR1 = " & Hex(bitrate.BTR0BTR1) & "h"

End If

End If

End Sub

See also

HardwareBaudRate Property

NetBaudRate Property


BufferSize Property

Applies to: Tracer object

Sets or returns the buffer size of a tracer.

Syntax

object.BufferSize [=value]

Parameter

object

An expression that evaluates to a Tracer object.

value

A Long specifying a new buffer size for the tracer.

Property value

A Long value that indicates the current size of the buffer.

Remarks

The BufferSize property only has a meaning if the BufferType property is either set to peTraceBufferTypeLinear or peTraceBufferRing.

Setting the BufferSize property of a tracer that is currently recording messages clears the buffer.

Example

The following example displays the buffer size of a tracer:

VBS Macro

Sub BufferSizeExample()

If ActiveWindow.Kind = peDocumentKindTrace Then

Dim tracer

Set tracer = ActiveWindow.Object.Tracer

MsgBox tracer.BufferSize

End If

End Sub

See also

BufferType Property


BufferType Property

Applies to: Tracer object

Sets or returns the type of data buffer a tracer uses to store logged CAN messages.

Syntax

object.BufferType [=type]

Parameter

object

An expression that evaluates to a Tracer object.

type

A PeTraceBufferType enum value that specifies a new type for the buffer.

Property value

A PeTraceBufferType enum value. Possible values are:

  • peTraceBufferTypeDynamic (0): A dynamic buffer that continuously expands while messages are logged.

  • peTraceBufferTypeLinear (1): A buffer with a fixed size. If the buffer is full, the tracer stops.

  • peTraceBufferTypeRing (2): A buffer with a fixed size. If the buffer is full, the oldest messages in the buffer will be overwritten.

  • peTraceBufferTypeFile (3): Trace data is not held in memory but is stored in a file that grows in size while messages are logged.

Example

The following example configures a tracer to use a ring buffer.

VBScript

myTracer.BufferType = peTraceBufferTypeRing

See also

FillingLevel Property


Bus Property

Applies to: Connection object, MessageFilterItem object, ReceiveEvent object, TransmitEvent object

Sets or returns the Bus number (1-16) that is assigned to the object.

Syntax

object.Bus [=value]

Parameter

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long that sets the new value of the property.

Property value

A Long value that specifies a Bus number (1-16).

Remarks

The Bus property of the ReceiveEvent and TransmitEvent object is read-only.


CalculateBusLoad Property

Applies to: Connection object

Sets or returns whether the current bus load is calculated and the bus load indicator is shown for a connection.

Syntax

object.CalculateBusLoad [=boolean]

Parameters

object

An expression that evaluates to a Connection object.

boolean

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the bus load is calculated and the bus load indicator is shown for a connection:

  • False: The bus load calculation is disabled and the bus load indicator is hidden (the default)

  • True: The bus load calculation is enabled and the bus load indicator is shown.

Remarks

If the bus load calculation is enabled, the current bus load is shown in the Bus Load column in the Connections Window.

Example

The following example activates the bus load calculation for the first connection in the project:

VBS Macro

Sub CalculateBusLoadExample()

Connections(1).CalculateBusLoad = True

End Sub


CanId Property

Applies to: Symbol object

Returns the CAN ID of a Symbol.

Syntax

object.CanId

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A Long value that represents the CAN ID that is assigned to the Symbol.

Example

The following example shows the CAN ID's of all symbols in a Symbols collection in a message box:

VBS Macro

Sub CanIdExample()

If SymbolsManager.Count = 0 Then Exit Sub

' Get the first Symbols collection

Dim symbols

Set symbols = SymbolsManager(1)

Dim mySymbol, strMsg

For Each mySymbol In symbols

strMsg = strMsg & Hex(mySymbol.CanId) & vbCrLf

Next

MsgBox strMsg,,"CAN ID's"

End Sub


CanIdFormat Property

Applies to: Tracer object

Sets or returns the format that is used to display CAN IDs in a trace window.

Syntax

object.CanIdFormat [=value]

Parameters

object

An expression that evaluates to a Tracer object.

boolean

A PeTraceCanIdFormat enum value that sets the new value of the property.

Property value

A PeTraceCanIdFormat enum value. Possible values are:

  • peTraceCanIdFormatHexadecimal (0): CAN IDs are displayed in hexadecimal notation.

  • peTraceCanIdFormatDecimal (1): CAN IDs are displayed in decimal notation.

Example

The following example toggles the value of the CanIdFormat property of the foreground tracer window:

VBS Macro

Sub CanIdFormatExample()

   If ActiveDocument.Kind = peDocumentKindTrace Then

      Dim tracer

      Set tracer = ActiveWindow.Object.Tracer

      If tracer.CanIdFormat = peTraceCanIdFormatHexadecimal Then

        tracer.CanIdFormat = peTraceCanIdFormatDecimal

      Else

        tracer.CanIdFormat = peTraceCanIdFormatHexadecimal

      End If

   End If

End Sub

See also

DataFormat Property

TimestampFormat Property


CanIdHi Property

Applies to: Symbol object

Returns the upper CAN ID of a Symbol.

Syntax

object.CanIdHi

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A Long value that represents the upper CAN ID of a range of CAN ID's that is assigned to a symbol.

Remarks

Symbols that represent receive-only messages can interpret a range of CAN ID's. When a range of CAN ID's is assigned to a Symbol, the CanIdHi property contains the upper limit of the CAN ID's to be interpreted.

Example

The following example lists all CAN ID's of Symbols that interpret a range of CAN ID's, and shows them in a message box:

VBS Macro

Sub CanIdHiExample()

If SymbolsManager.Count = 0 Then Exit Sub

' Get the first Symbols collection

Dim symbols

Set symbols = SymbolsManager(1)

Dim mySymbol, strMsg

For Each mySymbol In symbols

If mySymbol.CanIdHi > mySymbol.CanId Then

strMsg = strMsg & Hex(mySymbol.CanId) & "-" & _

Hex(mySymbol.CanIdHi) & vbCrLf

End If

Next

MsgBox strMsg,,"CAN ID's"

End Sub


Caption Property

Applies to: Window object

Returns a string containing the caption of a window.

Syntax

object.Caption

Parameters

object

An expression that evaluates to a Window object.

Property value

A String value that represents the caption of the window.

Example

The following example returns the caption of the active window:

VBScript

Dim cap

cap = ActiveWindow.Caption


ClaimedAddress Property

Applies to: J1939Node object

Returns the address that is currently claimed for a J1939 connection.

Syntax

object.ClaimedAddress

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A Byte value that represents the currently claimed address. If no address is currently claimed, the property contains the Null Address (254).

Example

The following example shows the currently claimed address of the first J1939 connection in the project:

VBS Macro

Sub J1939_ClaimedAddressExample()

If Connections(1).Protocol = peProtocolJ1939 Then

Dim node

Set node = Connections(1).CommunicationObject

If Not node Is Nothing Then

' Connection is enabled

MsgBox node.ClaimedAddress,,"Claimed Address"

End If

End If

End Sub

See also

ClaimAddress Method

PreferredAddress Property

ReleaseAddress Method

UseAddressingProtocol Property


ClientName Property

Applies to: J1939Node object

Sets or returns the name of the PCAN client the J1939 node uses for low-level CAN communication.

Syntax

object.ClientName [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A String value that specifies the new value of the property.

Property value

A String value that specifies the name of the PCAN client that will be created when the connection is activated.

Remarks

Setting the ClientName property while the node is already connected raises an error. The LastError property then returns the value errAlreadyConnected (2).

Example

The following example creates a new node and sets its ClientName property:

VBS Macro

Sub J1939_ClientNameExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdUSB

' Set the client name for the node

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then

' ...

End If

End Sub


Clock Property

Applies to: PCANBitrate object

Returns the clock frequency on which a CAN bit rate parameter set is based on.

Syntax

object.Clock

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A Long value that indicates the clock frequency in Hz, e.g. 80,000,000.

Remarks

A clock frequency of 8,000,000 Hz (8 MHz) indicates that the bit rate is defined for the BTR0/BTR1 registers of an older SJA1000 CAN controller, which is used in CAN hardware like PCAN-USB adaptors or PCAN-PCI cards. Higher clock frequencies like 20, 24, 30, 40, 60, or 80 MHz indicate that the bit rate is defined for a CAN-FD-compatible CAN hardware, like PCAN-USB FD adaptors or PCAN-PCI Express FD cards.

Example

The following example displays the clock frequency of the hardware bit rate currently used by the first connection in the project:

VBS Macro

Sub ClockExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

MsgBox "Clock frequency of bit rate = " & bitrate.Clock & " Hz"

End If

End Sub


Collection Property

Applies to: AddIn object, Connection object, Document object, Enum object, J1939Filter object, MessageFilter object, MessageFilterItem object, Multiplexer object, OutputWindowPane object, PCANClient object, PCANMessage object, ProjectItem object, ReceiveMessage object, Signal object, Symbol object, TextDocument object, TraceMessage object, TransmitMessage object, Variable object, VBSMacroFile object, Window object

Returns the collection containing the object supporting this property.

Syntax

object.Collection

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A collection relating to the object. In general, the collection name is a plural form of the object name.

Example

The following example accesses the Collection property:

VBS Macro

Sub CollectionExample()

Dim win, str

For Each win In ActiveWindow.Collection

str = str & win.Caption

Next

MsgBox str,,"All Windows"

End Sub


Color Property

Applies to: Multiplexer object

Returns the color that has been defined to display a Multiplexer.

Syntax

object.Color

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Long value that represents an RGB value.

Example

The following example extracts the base colors from a Multiplexer color:

VBScript

Dim Red, Green, Blue

Red = myMux.Color Mod &HFF

Green = (myMux.Color Mod &HFF00) \ 256

Blue = (myMux.Color Mod &HFF0000) \ 65536


Comment Property

Applies to: Multiplexer object, Signal object, Symbol object, TransmitEvent object, TransmitMessage object, Variable object

Sets or returns the comment text for an object.

Syntax

object.Comment

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that represents the comment that has been defined for the object.

Remarks

The Comment properties of the Multiplexer, Symbol, and Variable objects are read-only.

Example

The following example displays the names and comments of the symbols in "Sample.sym" in a message box:

VBS Macro

Sub CommentExample()

Dim symbols, symbol, strMsg

Set symbols = SymbolsManager("Sample")

For Each symbol In symbols

strMsg = strMsg & symbol.Name & vbTab & symbol.Comment & vbCrLf

Next

MsgBox strMsg,,"Symbol Comments"

End Sub


CommunicationObject Property

Applies to: Connection object

Returns an object that is responsible for the communication of messages through the connected bus.

Syntax

object.CommunicationObject

Parameters

object

An expression that evaluates to a Connection object.

Property value

The type of the returned object depends on the protocol the connection uses:

Protocol | Value of Protocol Property | Returned Object
CAN | peProtocolCAN (0) | PCANClientConnection
J1939 | peProtocolJ1939 (1) | J1939Node
Example

The following example accesses the communication object of the first connection in the project:

VBS Macro

Sub CommunicationObjectExample()

Dim CommObj

Set CommObj = Connections(1).CommunicationObject

If Not CommObj Is Nothing Then

' The connection is enabled

Select Case Connections(1).Protocol

Case peProtocolCAN

' Access properties and methods of the

' PCANClientConnection object here

' ...

Case peProtocolJ1939

' Access properties and methods of the

' J1939Node object here

' ...

End Select

End If

End Sub

See also

Protocol Property


Connected Property

Applies to: J1939Node object

Returns whether the J1939 node object is connected to a CAN bus.

Syntax

object.Connected

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A Boolean value that specifies whether the object is connected to a CAN bus or not. If True, the object is connected to a CAN bus. If False, the object is not connected to a CAN bus.

Example

The following example creates a new node and connects it to a CAN bus:

VBS Macro

Sub J1939_ConnectedExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdUSB

node.ClientName = "Macro"

node.NetName = "TestNet"

node.Connect

If node.Connected Then

' Connection successful

' ...

End If

End Sub


Connection Property [Variation 1]

Applies to: Connection object

Sets or returns a string specifying the connection.

Syntax

object.Connection [=value]

Parameters

object

An expression that evaluates to a Connection object.

value

A String that specifies the value of the property.

Property value

A String in the form NetName@DeviceName that specifies with which PCAN net and PCAN device the Connection object is associated.

Example

The following examples access the Connection property:

VBS Macro

Sub ConnectionGetExample()

Dim conn, str

For Each conn In Connections

str = str & "Bus " & conn.Bus & " = " & conn.Connection & vbCrLf

Next

MsgBox str,,"Project Connections"

End Sub
VBS Macro

Sub ConnectionSetExample()

Connections("MyConnection").Connection = "TestNet@pcan_usb"

End Sub


Connection Property [Variation 2]

Applies to: ReceiveMessage object, TraceMessage object, TransmitMessage object

Sets or returns the Connection object with which the message object is associated.

Syntax

object.Connection [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Connection object.

Property value

A Connection object with which the message object is associated.

Example

The following example displays the connection name of the first message in the Transmit List:

VBS Macro

Sub ConnectionExample2()

If TransmitMessages.Count > 0 Then

Dim msg

Set msg = TransmitMessages(1)

If Not msg.Connection Is Nothing Then

MsgBox str,,"Message Connection"

End If

End If

End Sub


Connections Property [Variation 1]

Applies to: Application object

Returns the Connections collection.

Syntax

object.Connections

Parameters

object

An expression that evaluates to an Application object.

Property value

A Connections collection.

Remarks

The Connections collection represents all connections of PCAN-Explorer to CAN buses. Each connection in the collection is represented by a Connection object.

Example

The following example accesses the Connections collection:

VBS Macro

Sub ConnectionsExample()

MsgBox "Count: " & Connections.Count,,"Project Connections"

End Sub


Connections Property [Variation 2]

Applies to: PCANClient object

Returns the PCANClientConnections collection.

Syntax

object.Connections

Parameters

object

An expression that evaluates to a PCANClient object.

Property value

A PCANClientConnections collection.

Remarks

The PCANClientConnections collection represents all connections of a PCANClient object to CAN buses. Each connection in the collection is represented by a PCANClientConnection object.

Example

The following example accesses the Connections collection:

VBS Macro

Sub ConnectionsExample2()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "MyClient"

Set conn = client.Connections.Add("TestNet")

' Access the PCANClientConnection object here

' ...

End Sub


Count Property

Applies to: AddIns collection, Connections collection, Documents collection, Enum object, Enums collection, J1939Filters collection, MessageFilters collection, Multiplexers collection, OutputWindowPanes collection, PCANClientConnections collection, PCANMessages collection, ReceiveMessages collection, Signals collection, Symbols collection, TraceMessages collection, TransmitMessages collection, VBSMacroFiles collection, Windows collection

Returns the number of elements in a collection.

Syntax

object.Count

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value that specifies the number of elements in the collection.

Example

The following example prints all documents in the Documents collection:

VBS Macro

Sub CountExample()

Dim i

For i = 1 To Documents.Count

Documents.Item(i).PrintOut

Next

End Sub


Creator Property

Applies to: TransmitEvent object, TransmitMessage object

Sets or returns the text that is displayed in transmit lists in the "Creator" column for the message.

Syntax

object.Creator [=value]

Parameters

object

An expression that evaluates to a TransmitEvent or TransmitMessage object.

value

A String value that specifies the new value of the property.

Property value

A String value that specifies the text that is displayed in transmit lists in the "Creator" column for the message.

Remarks

The Creator property of the TransmitEvent object is read-only.

Example

The following example creates a new message in the transmit list and sets its properties:

VBS Macro

Sub CreatorExample()

Dim msg

Set msg = TransmitMessages.Add

Set msg.Connection = Connections(1)

msg.ID = &H100

msg.Creator = "Me"

End Sub


CurrentColumn Property

Applies to: TextSelection object

Returns the column of the caret in a Text window.

Syntax

object.CurrentColumn

Parameters

object

An expression that evaluates to a TextSelection object.

Property value

A Long value that indicates the horizontal position of the caret.

Remarks

A selection is a single point (the caret) or a range of text. If the TextSelection object represents a range of selected text, the CurrentColumn and CurrentLine properties indicate the active end of the selection. This is the point where the user has stopped dragging the mouse.

The status bar of a Text window also shows the location of the caret.

Example

The following example retrieves the column of the caret:

VBScript

Dim ColNum

ColNum = ActiveDocument.Selection.CurrentColumn


CurrentDirectory Property

Applies to: Application object

Sets or returns the directory used by the Open command on the File menu.

Syntax

object.CurrentDirectory [=string]

Parameters

object

An expression that evaluates to an Application object.

string

A String value that specifies the new value of the property.

Property value

A String value that indicates the current directory of the PCAN-Explorer 6 process. The returned directory name does not have a trailing backslash ("\").

Example

The following example sets the current directory to C:\Program Files (x86)\PCAN-Explorer 6:

VBScript

CurrentDirectory = "C:\Program Files (x86)\PCAN-Explorer 6"


CurrentLine Property

Applies to: TextSelection object

Returns the line number where the caret is located in a Text window.

Syntax

object.CurrentColumn

Parameters

object

An expression that evaluates to a TextSelection object.

Property value

A Long value that indicates the line number where the caret is located.

Remarks

A selection is a single point (the caret) or a range of text. If the TextSelection object represents a range of text, the CurrentColumn and CurrentLine properties indicate the active end of the selection. That is the point where the user has stopped dragging the mouse.

Example

The following example gets the line number of the caret:

VBScript

Dim LineNum

LineNum = ActiveDocument.Selection.CurrentLine


CurrentTime Property

Applies to: Application object

Returns the current PCAN-Explorer time that is used as a basis for generating timestamps.

Syntax

object.CurrentTime

Parameters

object

An expression that evaluates to an Application object.

Property value

A DATE value.

Example

The following example displays the current PCAN-Explorer time:

VBScript

MsgBox CurrentTime


CycleTime Property [Variation 1]

Applies to: TransmitEvent object, TransmitMessage object

Sets or returns the transmit cycle time of a CAN message.

Syntax

object.CycleTime [=value]

Parameters

object

An expression that evaluates to a TransmitEvent or TransmitMessage object.

value

A Long value that specifies the value of the property.

Property value

A Long value that specifies the transmit cycle time in milliseconds.

Example

The following example creates a new message in the transmit list and sends it with a cycle time of 500 ms:

VBS Macro

Sub CycleTimeExample()

Dim msg

Set msg = TransmitMessages.Add

Set msg.Connection = Connections(1)

msg.ID = &H100

msg.CycleTime = 500

End Sub


CycleTime Property [Variation 2]

Applies to: Multiplexer object

Returns the transmit cycle time of a Multiplexer.

Syntax

object.CycleTime

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Long value that indicates the transmit cycle time in Milliseconds.

Example

The following example lists all Multiplexers of a Symbol with their default transmit cycle time and displays them in a message box:

VBScript

Dim mux, strMsg

For Each mux In mySymbol

strMsg = strMsg & mux.Name & vbTab & mux.CycleTime & vbCrLf

Next

MsgBox strMsg,,"Multiplexers CycleTime"


Data Property

Applies to: PCANMessage object, ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object, J1939Msg object, J1939RcvMsg object

Sets or returns the data bytes of a CAN message.

Syntax

object.Data ( index ) [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

index

A Long value that specifies the index of the accessed data byte (0-7 for PCANMessage object, 0-1785 for all other objects).

value

A Long value that sets the new value of the data byte.

Property value

An indexed Long value that specifies one data byte of a CAN message (0-255).

Remarks

The Data property of the J1939RcvMsg object is read-only.

Example

The following example shows the contents of the data bytes of a received CAN message:

VBS Macro

Sub DataExample()

If ReceiveMessages.Count = 0 Then Exit Sub

Dim msg, str, i

' Get the first message from the Receive list

Set msg = ReceiveMessages.Item(1)

str = "ID=" & Hex(msg.ID) & " Data="

For i = 0 To msg.DataLength-1

str = str & Hex(msg.Data(i)) & " "

Next

MsgBox str,,"Message Data"

End Sub


Data64 Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns the 8 data bytes of a CAN message in a single call.

Syntax

object.Data64 [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

An Int64 value that sets the new value of the data bytes.

Property value

An Int64 value that specifies the data bytes of a CAN message (Intel format, LSB is in data byte 0, MSB is in data byte 7).

Remarks

Only Add-ins and Callback DLLs can set or query the Data64 property, VBScript macros are not capable of this.

Example

The following example can be used as a handler for the Callback Library On Before Transmit event to increase a 64-bit counter value before the message with CAN ID 123h is transmitted:

C++ Callback DLL

HRESULT __stdcall ID123_Data64Example(PCANExplorer6::IPETransmitEvent *pEvent)

{

static long long counter;

long id;

if (SUCCEEDED(pEvent->get_ID(&id)) && (id == 0x123))

pEvent->put_Data64(++counter);

return S_OK;

}


DataArray Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object, J1939Msg object, J1939RcvMsg object

Sets or returns all data bytes of a CAN message in a SafeArray.

Syntax

object.DataArray [=array]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

array

A SafeArray that contains the new data bytes for the message. The following conditions must be true for the array:

  • the array must consist of VT_UI1 elements

  • the lower bound must be 0 or 1

  • the number of elements in the array must not exceed 8 for CAN messages, 64 for CAN FD messages, or 1785 for J1939 messages.

The number of elements in the array determine the new Data Length Code of the message.

Property value

A SafeArray containing the data bytes of the message in VT_UI1 elements. The lower bound of the array is 0 and the upper bound the size of the message -1.

Remarks

Before assigning a SafeArray that contains more than 8 data bytes, either configure the message as CAN FD message, or assign a connection to the message that uses the J1939 protocol by setting the Connection property. Otherwise an error is raised.

The DataArray property cannot be used with VBScript macros. Use the DataVariant property instead.

The DataArray property of the J1939RcvMsg object is read-only.


DataBitrate Property

Applies to: PCANBitrate object

Returns the data bit rate of a CAN FD bit rate.

Syntax

object.DataBitrate

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A Double value that indicates the data bit rate in bits per second. If the parent PCANBitrate object does not represent a CAN FD bit rate, the property returns the value 0.

Example

The following example displays the bit rate of the hardware currently used by the first connection in the project:

VBS Macro

Sub DataBitrateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

MsgBox "Bit rate: Nominal=" & bitrate.NominalBitrate & _

", Data=" & bitrate.DataBitrate

End If

End Sub

See also

NominalBitrate Property


DataFormat Property

Applies to: Tracer object

Sets or returns the format that is used to display data bytes in a trace window.

Syntax

object.DataFormat [=value]

Parameters

object

An expression that evaluates to a Tracer object.

boolean

A PeTraceDataFormat enum value that sets the new value of the property.

Property value

A PeTraceDataFormat enum value. Possible values are:

  • peTraceDataFormatHexadecimal (0): Data bytes are displayed in hexadecimal notation.

  • peTraceDataFormatDecimal (1): Data bytes are displayed in decimal notation.

Example

The following example changes the value of the DataFormat property of the foreground tracer window:

VBS Macro

Sub DataFormatExample()

   If ActiveDocument.Kind = peDocumentKindTrace Then

      Dim tracer

      Set tracer = ActiveWindow.Object.Tracer

      tracer.DataFormat = peTraceDataFormatDecimal

   End If

End Sub

See also

CanIdFormat

TimestampFormat Property


DataLength Property

Applies to: Multiplexer object, ReceiveEvent object, ReceiveMessage object, TransmitEvent object, TraceMessage object, TransmitMessage object

Returns the number of data bytes assigned to the object.

Syntax

object.DataLength [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long value that specifies the new value of the property.

Property value

A Long value that indicates the number of data bytes.

Remarks

The DataLength properties of the Multiplexer, ReceiveEvent, and TransmitEvent objects are read-only.

Example

The following example displays all the Multiplexers of a Symbol with the number of the data bytes:

VBScript

Dim mux, strMsg

For Each mux In mySymbol

strMsg = strMsg & mux.Name & vbTab & CStr(mux.DataLength) & vbCrLf

Next

MsgBox strMsg,,"Multiplexers"


DataType Property

Applies to: Signal object, Variable object

Sets or returns the data type of a Signal or Variable.

Syntax

object.DataType [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A PeDataType enum value that specifies the new value of the property.

Property value

A PeDataType enum value. Possible values are:

  • peDataTypeBit (1): a single bit

  • peDataTypeChar (2): an ASCII character (8-bit)

  • peDataTypeString (3): an ASCII-String

  • peDataTypeSigned (4): a signed value (2-64 bit)

  • peDataTypeUnsigned (5): an unsigned value (1-64 bit)

  • peDataTypeFloat (6): a floating-point value according to IEEE754 (32-bit)

  • peDataTypeEnum (7): an enumeration

  • peDataTypeDouble (8): a double-precision floating-point value (64-bit).

  • peDataTypeRaw (9): The Signal or Variable contains raw data that is not associated with a specific data type.

Remarks

The DataType property of the Variable object is read-only.

Example

The following example returns the type of a Signal:

VBScript

Dim theType

theType = mySignal.DataType


DataVariant Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns all data bytes of a CAN message in a Variant.

Syntax

object.DataVariant [=variant]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

variant

A Variant that contains the new data bytes for the message.

If variant contains an array, the number of elements in the array must not exceed 8 for CAN messages, 64 for CAN FD messages, or 1785 for J1939 messages. The number of elements in the array determine the new Data Length Code of the message.

Property value

A Variant containing an array with the data bytes of the message.

Remarks

Before assigning a Variant that contains an array with more than 8 data bytes, either configure the message as CAN FD message, or assign a connection to the message that uses the J1939 protocol by setting the Connection property. Otherwise an error is raised.

Example

The following example adds a new transmit message and initializes its data bytes:

VBS Macro

Sub DataVariantExample()

Dim msg

Set msg = TransmitMessages.Add

msg.ID = &H100

msg.DataVariant = Array(1,2,3,4)

End Sub


DecimalPlaces Property

Applies to: Signal object, Variable object

Sets or returns the number of decimal places that are displayed for a Signal value or Variable value.

Syntax

object.DecimalPlaces [=value]

Parameters

object

An expression that evaluates to a Signal object or Variable object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that specifies the number of decimal places defined for the Signal or Variable. The value -1 indicates that the number of displayed decimal places is determined by the global decimal places setting in PCAN-Explorer.

Remarks

The DecimalPlaces property of the Variable object is read-only.

Example

The following example creates a new virtual Signal and its value is displayed with 2 decimal places:

VBS Macro

Sub DecimalPlacesExample()

Dim sig

Set sig = Signals("MySignal")

If sig Is Nothing Then

Set sig = Signals.Add("MySignal")

End If

sig.DataType = peDataTypeFloat

sig.DecimalPlaces = 2

End Sub


DefaultMultiplexer Property

Applies to: Symbol object

Returns the Default Multiplexer of a Symbol.

Syntax

object.DefaultMultiplexer

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A Multiplexer object.

Remarks

The default Multiplexer is an empty Multiplexer that is automatically created for Symbols for which no other Multiplexers are defined explicitly.

Example

The following example displays the name of the Default Multiplexer of the Symbol "RcvSymbol" (defined in the symbol file "Sample.sym"):

VBS Macro

Sub DefaultMultiplexerExample()

Dim symbols, mux

Set symbols = SymbolsManager("Sample")

Set mux = symbols("RcvSymbol").DefaultMultiplexer

PrintToOutputWindow mux.Name

End Sub


DefaultData Property

Applies to: Multiplexer object

Returns the data bytes of a Multiplexer, which are filled with the default values of the Variables.

Syntax

object.DefaultData ( index )

Parameters

object

An expression that evaluates to a Multiplexer object.

index

A Long value indicating the index (0-7) of the data byte to be retrieved.

Property value

An indexed Long value that represents the value of a single data byte (0-255).

The data bytes that can be retrieved through the DefaultData property do not contain any data of the Multiplexer itself. The Multiplexer data can be retrieved by using its MuxData property.

Example

The following example shows the contents of the data bytes of a Multiplexer in a message box:

VBScript

Dim strMsg, i

For i = 0 To 7

strMsg = strMsg & Hex(myMux.DefaultData(i)) & " "

Next

MsgBox strMsg,,"Default Data"


DefaultValue Property

Applies to: Variable object

Returns a Variables's default value.

Syntax

object.DefaultValue

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Variant value that represents the Variable's default value.

Example

The following example displays the default value of the Variable "MyVar" in a message box:

VBS Macro

Sub DefaultValueExample()

Dim symbols, v

Set symbols = SymbolsManager("MySymbols")

Set v = symbols("MySymbol").DefaultMultiplexer.Variables("MyVar")

MsgBox v.DefaultValue

End Sub


Description Property

Applies to: AddIn object, Enum object, MessageFilter object, Project object, Tracer object, VBSMacroFile object

Sets or returns a string containing the object's description.

Syntax

object.Description [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A String value that specifies the new value of the property.

Property value

A String that represents the description of the object.

Remarks

The Description properties of the Add-in object and Enum object are read-only.

Example

The following example lists all registered Add-ins along with their descriptions:

VBS Macro

Sub DescriptionExample()

Dim objAddIn, strMsg

For Each objAddIn In AddIns

strMsg = strMsg & objAddIn.Name & ": " & _

objAddIn.Description & vbCrLf

Next

MsgBox strMsg,,"Add-ins"

End Sub


DestinationAddress Property

Applies to: J1939Filter object, MessageFilterItem object, ReceiveEvent object, ReceiveMessage object, Symbol object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns a J1939 Destination Address.

Syntax

object.DestinationAddress [=address]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

address

A Byte value that sets the new value of the property.

Property value

A Byte value that specifies a Destination Address (0-255).

Remarks

The DestinationAddress properties of the J1939Filter, ReceiveEvent, Symbol, and TransmitEvent objects are read-only.

For the J1939Filter object, the DestinationAddress property returns the Destination Address attribute of the filter. If the Flags property includes the tfmDestination flag, all J1939 messages sent to the specified Destination Address can pass the filter.

For the MessageFilterItem object, the DestinationAddress property only has an effect if the Type property is set to peFilterItemJ1939 and the J1939FilterFlags property includes the peJ1939DestinationAddress flag.

The DestinationAddress property of message objects is only relevant for PDU1 messages, or for PDU2 messages that have more than 8 data bytes, which are transmitted using the transport protocol.


Device Property [Variation 1]

Applies to: Connection object, PCANClient object

Returns or sets the name of the PCAN device that the object uses to access CAN hardware and to communicate with CAN buses.

Syntax

object.Device [=value]

Parameters

object

An expression that evaluates to a Connection object or a PCANClient object.

value

A String value that specifies the new name of the device to be used. Allowed device names are: "peakcan", "pcan_virtual", "pcan_isa", "pcan_dng", "pcan_pci", "pcan_usb", "pcan_pccard", and "pcan_lan".

Property value

A String value that specifies the name of the PCAN device used.

Remarks

The Device property of the Connection object is read-only.

Example

The following example configures a new client so that it uses the device "pcan_pci":

VBS Macro

Sub DeviceExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

' Set the device for the client

client.Device = "pcan_pci"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

If conn.IsConnected Then _

MsgBox "Client is connected. See PCAN Status Display."

End Sub


Device Property [Variation 2]

Applies to: J1939Node object

Returns or sets the PCAN device that the object uses to access CAN hardware and to communicate with J1939 buses.

Syntax

object.Device [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A TCANDevices enum value that specifies the new device to be used.

Property value

A TCANDevices enum value:

  • tcdPeakcan (1): The "peakcan" device is used.

  • tcdISA (2): The "pcan_isa" device is used.

  • tcdDNG (3): The "pcan_dng" device is used.

  • tcdPCI (4): The "pcan_pci" device is used.

  • tcdUSB (5): The "pcan_usb" device is used.

  • tcdPCCard (6): The "pcan_pccard" device" is used.

  • tcdVirtual (7): The "pcan_virtual" device is used.

  • tcdLAN (8): The "pcan_lan" device is used.

Example

The following example configures a new J1939 node object so that it uses the device "pcan_pci":

VBS Macro

Sub J1939_DeviceExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

' Set the device for the node

node.Device = tcdPCI

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then _

MsgBox "Node is connected. See PCAN Status Display."

End Sub


DisplayMode Property

Applies to: Multiplexer object, Variable object

Returns the display mode of a Multiplexer or a Variable.

Syntax

object.DisplayMode

Parameters

object

An expression that evaluates to a Multiplexer object or a Variable object.

Property value

A PeDisplayMode enum value:

  • peDisplayOff (0): Multiplexer or Variable is not displayed.

  • peDisplayValue (1): Only the value of a Multiplexer or Variable is displayed.

  • peDisplayAll (2): Name and value of a Multiplexer or Variable is displayed in the form Name=Value.

Example

The following example returns the display mode of a Multiplexer:

VBS Macro

Sub DisplayModeExample()

Dim sym, mux, mode

Set sym = SymbolsManager("MySymbols").Item("MySymbol")

Set mux = sym.Multiplexers("Mux1")

mode = mux.DisplayMode

' ...

End Sub


DisplayName Property

Applies to: VBSMacroFile object

Returns the name of a VBS Macro file as it is displayed in the various PCAN-Explorer windows.

Syntax

object.DisplayName

Parameters

object

An expression that evaluates to a VBSMacroFile object.

Property value

A String value that indicates the name of the VBS Macro file.

Example

The following example shows the display names of all loaded VBS Macro files in the Output window, on the Macro tab:

VBS Macro

Sub DisplayNameExample()

Dim file

For Each file In VBSMacroFiles

PrintToOutputWindow file.DisplayName

   Next

End Sub

See also

FullName Property


DLC Property

Applies to: PCANMessage object, ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Returns or sets the Data Length Code of a CAN message.

Syntax

object.DLC [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long that specifies the new value of the property.

Property value

A Long value that specifies the Data Length Code of the CAN message (0-8 for PCANMessage object, 0-1785 for all other objects).

Remarks

The DLC properties of the ReceiveEvent and TransmitEvent objects are read-only.

Example

The following example sets the DLC property of a PCANMessage object:

VBS Macro

Sub PCANMessagesExample()

Dim client, conn, msg

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

Set msg = client.Messages.Add

' Access the PCANMessage object here.

With msg

.Bus = 1

.ID = &H100

.DLC = 3

.Data(0) = &H11

.Data(1) = &H22

.Data(2) = &H33

.Write conn, 0

End With

End Sub

See also

ID Property

Data Property


Document Property

Applies to: Symbols object, Tracer object, Window object

Returns the Document object associated with the object.

Syntax

object.Document

Parameters

object

An expression that evaluates to a Symbols object, a Tracer object, or a Window object.

Property value

The Document object associated with the object.

Example

The following example displays the full path name of the document that is associated with the active window:

VBS Macro

Sub DocumentExample()

If Not ActiveWindow.Document Is Nothing Then _

MsgBox ActiveWindow.Document.FullName

End Sub


Documents Property

Applies to: Application object

Returns a Documents collection.

Syntax

object.Documents

Parameters

object

An expression that evaluates to an Application object.

Property value

A Documents collection that represents the collection of all opened documents. Each document in the collection is represented by a Document object.

Example

The following example accesses the Documents collection:

VBS Macro

Sub DocumentsExample()

MsgBox "Number of open documents = " & Documents.Count

End Sub


DriverVersion Property

Applies to: PCANClient object

Returns the version of the driver that is installed for managing the CAN hardware.

Syntax

object.DriverVersion

Parameters

object

An expression that evaluates to a PCANClient object.

Property value

A String value that contains information about the driver version, usually including a copyright note, and the information about the platform the driver is intended for.

Remarks

The driver's version can also be retrieved in the Windows Control Panel in the "CAN-Hardware" module.

Example

The following example retrieves the version of the currently used PCAN device driver and displays it in a message box:

VBS Macro

Sub DriverVersionExample()

If Connections.Count = 0 Then Exit Sub

Dim conn

Set conn = Connections(1)

If conn.Protocol = peProtocolCAN Then

' Access the PCANClient object

Dim client

Set client = conn.CommunicationObject.Parent

MsgBox client.DriverVersion,,"Driver Version"

End If

End Sub


EntryCount Property

Applies to: Tracer object

Returns the number of entries in a trace buffer or file.

Syntax

object.EntryCount

Parameter

object

An expression that evaluates to a Tracer object.

Property value

A Long value indicating the current number of entries.

Example

The following example displays the number of entries in the active tracer:

VBS Macro

Sub EntryCountExample()

Dim tracer, count

If ActiveWindow.Kind = peDocumentKindTrace Then

Set tracer = ActiveWindow.Object.Tracer

count = tracer.EntryCount

MsgBox count

End If

End Sub

See also

FillingLevel Property


Enum Property

Applies to: Signal object, Variable object

Returns the Enum object that is associated with a Signal or Variable.

Syntax

object.Enum

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

Property value

An Enum object.

Example

The following example displays the name of the associated Enum object for each Signal:

VBS Macro

Sub EnumExample()

Dim sig, strMsg

For Each sig In Signals

If Not sig.Enum Is Nothing Then _

strMsg = strMsg & sig.Name & " has Enum " & sig.Enum.Name & vbCrLf

Next

MsgBox strMsg

End Sub

See also

EnumName Property


EnumName Property

Applies to: Signal object, Variable object

Sets or returns the name of an Enum that is associated with a Signal or Variable.

Syntax

object.EnumName [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A String that specifies the new value of the property.

Property value

A String value that specifies the name of the Enum object that is associated with the Signal or Variable.

Remarks

The EnumName property of the Variable object is read-only.

Example

The following example displays the name of the associated Enum object for each Signal that has the peDataTypeEnum data type:

VBS Macro

Sub EnumNameExample()

Dim sig, strMsg

For Each sig In Signals

If sig.DataType = peDataTypeEnum Then _

strMsg = strMsg & sig.Name & vbTab & sig.EnumName & vbCrLf

Next

MsgBox strMsg

End Sub

See also

EnumName Property

Send Feedback | Copyright © 2022 PEAK-System Technik GmbH. All rights reserved.


Enums Property

Applies to: Symbols collection, SymbolsManager collection

Returns an Enums collection.

Syntax

object.Enums

Parameters

object

An expression that evaluates to a Symbols collection or a SymbolsManager collection.

Property value

An Enums collection. Each Enum in the collection is represented by an Enum object.

The Enums property of a Symbols collection represents all Enums that are defined in the Symbols file that the Symbols collection represents.

The Enums collection returned by the SymbolsManager.Enums property is usually empty in PCAN-Explorer 6.

Attention

In PCAN-Explorer 5, the Enums of all loaded Symbols files were merged into the single SymbolsManager.Enums collection.

In PCAN-Explorer 6, the Enums defined in a specific Symbols file can be accessed via the Enums property of the respective Symbols collection. The SymbolsManager.Enums collection is still available, mostly for backward compatibility, but is usually empty unless Enums were added to the collection by a VBS macro or an Add-in.
Example

The following example accesses the Enums that were defined in a specific Symbols file:

VBS Macro

Sub EnumsExample()

MsgBox "Number of Enums = " & SymbolsManager("MySymbolsFile.sym").Enums.Count

End Sub


ErrorFrames Property

Applies to: PCANClient object

Sets or returns whether a PCAN client shall receive Error Frames.

Syntax

object.ErrorFrames [=value]

Parameters

object

An expression that evaluates to a PCANClient object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the PCAN client receives Error Frames. If True, the client receives Error Frames. If False, The client ignores Error Frames (the default).

Example
VBS Macro

Sub ErrorFramesExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

If client.IsRegistered Then

' Configure the client to receive Error Frames

client.ErrorFrames = True

' ...

Else

MsgBox "Error while registering client!"

End If

End Sub


ErrorFramesEnabled Property

Applies to: MessageFilterItem object

Sets or returns whether Error Frames can pass through the MessageFilterItem object if the filter item operates in Options mode.

Syntax

object.ErrorFramesEnabled [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether Error Frames can pass through the filter item or not. If True, Error Frames can pass through the filter item. If False, Error Frames are blocked by the filter item (the default).

Remarks

The ErrorFramesEnabled property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemOptions.

See also

ErrorWarningsEnabled Property

RTREnabled Property

Type Property


ErrorWarningsEnabled Property

Applies to: MessageFilterItem object

Sets or returns whether Error Warnings can pass through the MessageFilterItem object if the filter item operates in Options mode.

Syntax

object.ErrorWarningsEnabled [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether Error Warnings can pass through the filter item. If True, Error Warnings can pass through the filter item. If False, Error Warnings are blocked by the filter item (the default).

Remarks

The ErrorWarningsEnabled property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemOptions.

See also

ErrorFramesEnabled Property

RTREnabled Property

Type Property


EventCount Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Returns a value indicating the number of times a CAN message has been received or transmitted.

Syntax

object.EventCount

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value representing the number of times the CAN message has been received or transmitted.

Example

The following example retrieves the event count of a message:

VBS Macro

Sub EventCountExample()

If ReceiveMessages.Count = 0 Then Exit Sub

' Access the first message in the Receive list

Dim msg, count

Set msg = ReceiveMessages(1)

count = msg.EventCount

' ...

End Sub


ExcludeMode Property

Applies to: MessageFilterItem object

Sets or returns whether the filter item operates in Exclude mode.

Syntax

object.ExcludeMode [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether the filter item operates in Exclude mode.

Remarks

The ExcludeMode property only has an effect, if the Type property of the MessageFilterItem object is set to either peFilterItemIDRange, peFilterItemCodeMask, or peFilterItemJ1939.

See also

Type Property


ExtensibilityObject Property

Applies to: AddIn object

Allows access to the PEAddIn object implemented by an Add-in.

Syntax

object.ExtensibilityObject

Parameters

object

An expression that evaluates to an AddIn object.

Property value

An IPEExtensibility interface.


Factor Property

Applies to: Variable object

Returns the multiplier that was defined for the for the variable to transform its value from a raw value into a physical value.

Syntax

object.Factor

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Double value representing the multiplier that was defined for the variable to transform its value from a raw value into a physical value.

Example

The following example gets the factor of a variable:

VBScript

Dim fac

fac = myVar.Factor

See also

Offset Property


FillingLevel Property

Applies to: Tracer object

Returns the current filling level of a tracer.

Syntax

object.FillingLevel

Parameter

object

An expression that evaluates to a Tracer object.

Property value

A Long value indicating the current filling level in Percent (0-100).

Remarks

The filling level of a Tracer that has its BufferType property set to peTraceBufferTypeDynamic or peTraceBufferTypeFile is always 100%.

Example

The following example displays the filling level of the active tracer:

VBS Macro

Sub FillingLevelExample()

Dim tracer, fill

If ActiveWindow.Kind = peDocumentKindTrace Then

Set tracer = ActiveWindow.Object.Tracer

fill = tracer.FillingLevel

MsgBox fill & "%"

End If

End Sub

See also

EntryCount Property


Filter Property

Applies to: Connection object, ReceiveMessages collection, Tracer object

Sets or returns a MessageFilter object that is used by the object to filter messages.

Syntax

object.Filter [=value]

Parameter

object

An expression that evaluates to a ReceiveMessages collection or a Tracer object.

value

A reference to a MessageFilter object.

Property value

A MessageFilter object.

Example

The following example creates a new filter and configures a tracer to record only the single CAN-ID 100h:

VBS Macro

Sub FilterExample()

Dim myFilter

Set myFilter = MessageFilters("MyFilter")

If myFilter Is Nothing Then

' MyFilter does not yet exist in the current project

Set myFilter = MessageFilters.Add("MyFilter")

' Add a new filter item

Dim myItem

Set myItem = myFilter.AddItem

myItem.Type = peFilterItemIDRange

myItem.IDfrom = &H100

myItem.IDto = &H100

End If

' Now assign the filter to a tracer

Dim doc

Set doc = Documents("Trace1")

If doc Is Nothing Then

Dim tracer

Set tracer = doc.ActiveWindow.Object.Tracer

tracer.Filter = myFilter

' Finally, start the tracer

tracer.Start

End If

End Sub

See also

MessageFilter Object


FilterCode Property

Applies to: PCANClient object

Sets or returns the acceptance code of the message filter for this PCAN client.

Syntax

object.DLC [=value]

Parameters

object

An expression that evaluates to a PCANClient object.

value

A Long that sets the acceptance code.

Property value

A Long value representing the acceptance code of the PCAN client's message filter.

Remarks

Together with the FilterMask property, the FilterCode property configures which of the received CAN messages are passed on from the connected PCAN net to PCAN-Explorer.

Example

The following example gets the acceptance code of the first CAN connection:

VBS Macro

Sub FilterExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim client

Set client = Connections(1).CommunicationObject.Parent

MsgBox "Code = " & Hex(client.FilterCode) & vbCrLf & _

"Mask = " & Hex(client.FilterMask),,"Filter"

End If

End Sub

See also

FilterMask Property


FilterMask Property

Applies to: PCANClient object

Sets or returns the acceptance mask of the message filter for this PCAN client.

Syntax

object.DLC [=value]

Parameters

object

An expression that evaluates to a PCANClient object.

value

A Long that sets the acceptance mask.

Property value

A Long value representing the acceptance mask of the PCAN client's message filter.

Remarks

Together with the FilterCode property, the FilterMask property configures which of the received CAN messages are passed on from the connected PCAN net to PCAN-Explorer.

Example

The following example gets the acceptance mask of the first CAN connection:

VBS Macro

Sub FilterExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim client

Set client = Connections(1).CommunicationObject.Parent

MsgBox "Code = " & Hex(client.FilterCode) & vbCrLf & _

"Mask = " & Hex(client.FilterMask),,"Filter"

End If

End Sub

See also

FilterCode Property


Filters Property

Applies to: J1939Node object

Returns a J1939Filters collection that can be used to control the messages that are received from the J1939Node object.

Syntax

object.Filters

Parameter

object

An expression that evaluates to a JJ1939Node object.

Property value

A J1939Filters collection.

Example

The following example configures the filter of a J1939Node object so that only a single PGN is received:

VBS Macro

Sub J1939_FiltersExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdPCI

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then

' Add a filter for PGN 65132 (Tachograph)

node.Filters.Add tfmPGN, 65132, 0, 0, 0

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939RcvMsg")

While Not node.Read(msg)

Wait 100

Wend

' A message with PGN 65132 has been received

' ...

End If

End Sub

See also

J1939Node object

J1939Filter object


FirstMessageSetsStartTime Property

Applies to: Tracer object

Determines whether the timestamp of the first message logged by a tracer is used as the reference time that marks the start of the tracer.

Syntax

object.FirstMessageSetsStartTime [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A Boolean that sets the new value of the property.

Property value

A Boolean value that determines whether the timestamp of the first logged message is used as the reference time that marks the start of the tracer.


Flags Property

Applies to: J1939Filter object

Returns the Flags attribute of the filter.

Syntax

object.Flags

Parameters

object

An expression that evaluates to a J1939Filter object.

Property value

A combination of TFilterMask values that specify which fields of a J1939 message are taken into account by this filter. Can be one or a combination of the following values: tfmPGN (1), tfmPriority (2), tfmSource (4), or tfmDestination (8).


FullName Property

Applies to: AddIn object, Application object, CallbackLibraryEvent object, Document object, Project object, TextDocument object, VBSMacroFile object

Returns the full name of a file including the file path.

Syntax

object.FullName

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value representing the full name of the file.

The following table summarizes the results of using the FullName property with the objects in the Applies To list:

Object | Result
AddIn | Returns the full path of the Add-in DLL, e.g. "C:\Program Files (x86)\PCAN-Explorer 6\AddIns\LineWriter.dll"
Application | Returns the full path of the PCAN-Explorer application, e.g. "C:\Program Files (x86)\PCAN-Explorer 6\PcanExpl.exe".
Project | Returns the full path of the currently loaded PCAN-Explorer project, e.g. "C:\Users\User Name\Documents\PCAN-Explorer 6\Projects\My Project.peproj"
Document TextDocument | Returns the full path of the file, that contains the document, e.g. "C:\Users\User Name\Documents\PCAN-Explorer 6\Symbols\Sample.sym"
VBSMacroFile | Returns the full path of the VBS Macro file, e.g. "C:\Users\User Name\Documents\PCAN-Explorer 6\Macros\Sample.pem"
CallbackLibraryEvent | Returns the full path of the Callback Library, e.g. "C:\Users\User Name\Documents\MyProject\MyCallbackLibrary.dll"
Example

The following example displays the full path to every document in the Documents collection:

VBS Macro

Sub FullNameExample()

Dim i

For i = 1 To Documents.Count

PrintToOutputWindow Documents.Item(i).FullName

   Next

End Sub

See also

Name Property

Path Property


Properties G-K

The following table contains all properties beginning with letters G to K:

Property | Description
Guid | Returns an Add-in's CLSID as obtained from the Add-in's registry entry.
Handle | Returns a handle value of the object.
HardwareBaudRate | Sets or returns the value of the bus timing registers in the SJA1000 CAN controller of the connected CAN hardware.
HardwareBitRate | Returns a PCANBitrate object that describes the current bit rate of a CAN hardware.
HardwareBitRateText | Returns the bit rate of a connected CAN hardware, as a text.
HardwareHandle | Returns the handle of a connected CAN hardware.
HardwareInterrupt | Returns the interrupt that is used by the connected CAN hardware.
HardwareName | Returns the name of a connected CAN hardware.
HardwarePort | Returns the I/O address that is used by the connected CAN hardware.
HardwareStatus [Variation 1] | Returns the current status of a connected CAN hardware.
HardwareStatus [Variation 2] | Returns the current status of a connected CAN hardware.
HardwareType | Returns the type of a connected CAN hardware.
Height | Sets or returns the height of a window.
HWnd | Returns the window handle of a window.
ID | Sets or returns the CAN ID of a CAN message.
IDfrom | Sets or returns the lower CAN ID of a MessageFilterItem object.
IDto | Sets or returns the upper CAN ID of a MessageFilterItem object.
IncludeEchoes | Sets or returns whether successfully transmitted messages are being echoed back in the receive queue of a J1939Node object.
InitValue | Returns a Signal's initial value.
IsActive | Sets or returns whether a document, a window, or a tracer is active.
IsConnected [Variation 1] | Sets or returns whether PCAN-Explorer is connected to a PCAN net.
IsConnected [Variation 2] | Returns a value indicating whether an Add-in is loaded and connected.
IsEcho | Returns whether the message an echo of a transmitted J1939 message.
IsEnabled | Sets or returns whether the object is enabled or not.
IsExtended | Returns whether a Symbol represents a CAN message with a standard 11-bit ID or an extended 29-bit ID.
IsMotorola | Returns whether the individual bytes of a Multiplexer or Variable are arranged in the Motorola order.
IsOpenThroughout | Sets or returns whether the reception filter of a J1939Node object is completely open.
IsPaused | Sets or returns whether a CAN message is transmitted periodically, or whether a Multiplexer is transmitted periodically by default.
IsReadOnly | Sets or returns whether a document is write protected in PCAN-Explorer.
IsReceived | Returns whether a recorded CAN message has been received or transmitted.
IsRegistered | Sets or returns whether PCAN-Explorer is registered at a PCAN device.
IsRTR | Returns whether a Multiplexer represents a Remote Transmission Request (RTR) message.
IsSaved | Returns a document's saved status, indicating whether a document has changed since it was last saved.
IsTimeout | Returns whether a time-out event was recorded for a CAN message.
IsTraced | Returns whether a Multiplexer or a Variable object will be recorded by the tracer.
IsValid | Returns whether a connection is valid or not.
IsVisible | Sets or returns the visibility of a window.
Item | Retrieves a specific object from a collection.
ItemCount | Returns the number of filter items in a filter.
J1939FilterFlags | Sets or returns a value that determines which J1939 attributes are taken into account to filter J1939 messages.
Kind | Returns a GUID string indicating the kind or type of the object.

See also

Properties A-F

Properties L-P

Properties Q-T

Properties U-Z


Guid Property

Applies to: AddIn object

Returns the Add-in's CLSID as obtained from the Add-in's registry entry.

Syntax

object.Guid

Parameters

object

An expression that evaluates to an AddIn object.

Property value

A String value representing the Add-in's CLSID as obtained from the Add-in's registry entry.

Example

The following example lists all registered Add-ins and their GUIDs:

VBS Macro

Sub GuidExample()

Dim objAddIn, strMsg

For Each objAddIn In AddIns

strMsg = strMsg & objAddIn.Name & " " & _

objAddIn.Guid & vbCrLf

Next

MsgBox strMsg,,"Add-in GUIDs"

End Sub


Handle Property

Applies to: Application object, PCANClient object

Returns a handle value of the object.

Syntax

object.Handle

Parameters

object

An expression that evaluates to a Application object or a PCANClient object.

Property value

A Long value representing the handle of the object.

The following table summarizes the results of using the Handle property with the objects in the Applies To list:

Object | Result
Application | The Windows Application handle.
PCANClient | The client handle that has been assigned to the PCANClient object when registering at the PCAN system. If the PCANClient object is not registered at the PCAN system, the result is 0.
Example

The following example gets the client handle of the first CAN connection and displays it in a message box:

VBS Macro

Sub HandleExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim client

Set client = Connections(1).CommunicationObject.Parent

MsgBox "Client Handle = " client.Handle,,"Macro"

End If

End Sub


HardwareBaudRate Property

Applies to: PCANClientConnection object

Sets or returns the value of the bus timing registers in the SJA1000 CAN controller of the connected CAN hardware. In non-CAN-FD hardware the bus timing registers BTR0/BTR1 control the baud rate that is used for communication.

To access the bit rate parameters of a CAN hardware that operates in CAN FD mode, use the HardwareBitRate property.

Syntax

object.HardwareBaudRate [=value]

Parameters

object

An expression that evaluates to a PCANClientConnection object.

value

A Long value that specifies the new value of the bus timing register.

Property value

A Long containing a 16-bit value, which is a combination of the two 8-bit values from the bus timing registers BTR0 and BTR1 of the SJA1000 CAN controller. To get a human-readable interpretation of the bit rate value, access the HardwareBitRateText property.

Remarks

The bit rate of a hardware can only be set and retrieved if the PCANClientConnection object is connected to a PCAN net, which in turn is connected to a CAN hardware. If the object is connected to a virtual net that has no hardware connection, then the HardwareHandle property returns the value 0.

Example

The following example sets the baud rate of a CAN controller (type SJA1000) to 1 Mbit/s:

VBS Macro

Sub HardwareBaudRateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn

Set ClientConn = Connections(1).CommunicationObject

ClientConn.HardwareBaudRate = &H0014

End If

End Sub

See also

HardwareBitRateText Property

HardwareHandle Property

NetBaudRate Property


HardwareBitRate Property

Applies to: PCANClientConnection object

Returns a PCANBitrate object that describes the current bit rate of a CAN hardware.

Syntax

object.HardwareBitRate

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A PCANBitrate object.

Remarks

The bit rate of a hardware can only be retrieved if the PCANClientConnection object is connected to a PCAN net, which in turn is connected to a CAN hardware. If the object is connected to a virtual net that has no hardware connection, then the HardwareHandle property returns the value 0.

Example

The following example gets the bit rate of a CAN controller:

VBS Macro

Sub HardwareBitRateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

' Access the PCANBitrate object here

MsgBox "Bit rate of Hardware = " & bitrate.AsString

End If

End Sub

See also

HardwareBitRateText Property

HardwareBaudRate Property

NetBitRate Property


HardwareBitRateText Property

Applies to: PCANClientConnection object

Returns the bit rate of the connected CAN hardware, as a text.

Syntax

object.HardwareBitRateText

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A String representing the bit rate of the connected CAN hardware. The bit rate of a hardware can only be retrieved if the PCANClientConnection object is connected to a PCAN net, which in turn is connected to a CAN hardware. If the object is only connected to a virtual net that has no hardware connection, then the returned string is empty.

The HardwareBitRateText property returns the same string as the HardwareBitRate.AsString property.

Example

The following example displays the bit rate of the hardware that is associated with the first Connection in the project:

VBS Macro

Sub HardwareBitRateTextExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn

Set ClientConn = Connections(1).CommunicationObject

MsgBox "Bit rate of Hardware = " & ClientConn.HardwareBitRateText

End If

End Sub

See also

HardwareBitRate Property

NetBitRateText Property


HardwareHandle Property

Applies to: J1939Node object, PCANClientConnection object

Returns the handle of a connected CAN hardware.

Syntax

object.HardwareHandle

Parameters

object

An expression that evaluates to a J1939Node object or a PCANClientConnection object.

Property value

A Long value representing a CAN hardware handle.

If the J1939Node object or PCANClientConnection object is not connected to any PCAN net, or the connected PCAN net is not connected to a CAN hardware, then the HardwareHandle property returns the value 0.

Example

The following example gets the handle of the hardware:

VBS Macro

Sub HardwareHandleExample()

If Connections.Count = 0 Then Exit Sub

Dim conn, handle

Set conn = Connections(1)

Select Case conn.Protocol

Case peProtocolCAN

' Access the PCANClientConnection object

Dim ClientConn

Set ClientConn = conn.CommunicationObject

handle = ClientConn.HardwareHandle

Case peProtocolJ1939

' Access the J1939Node object

Dim node

Set node = conn.CommunicationObject

handle = node.HardwareHandle

End Select

MsgBox "Hardware Handle = " & handle,,"Macro"

End Sub


HardwareInterrupt Property

Applies to: PCANClientConnection object

Returns the interrupt that is used by the connected CAN hardware.

Syntax

object.HardwareInterrupt

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A Long value that represents the interrupt which is used by a connected CAN hardware.

If the PCANClientConnection object is not connected to any PCAN net, or the connected PCAN net is not connected to a CAN hardware, then the HardwareInterrupt property returns the value -1.

Example

The following example gets the interrupt that is used by the connected hardware.

VBS Macro

Sub HardwareInterruptExample()

' The first connection in the project must

' be a CAN connection

Dim client

If Connections(1).Protocol = peProtocolCAN Then

Set client = Connections(1).CommunicationObject

MsgBox "Interrupt = " & client.Connections(1).HardwareInterrupt

End If

End Sub

See also

HardwarePort Property


HardwareName Property

Applies to: PCANClientConnection object

Returns the name of a connected CAN hardware.

Syntax

object.HardwareName

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A String value that represents the name of a connected CAN hardware.

If the PCANClientConnection object is not connected to any PCAN net, or the connected PCAN net in turn is not connected to a CAN hardware, then the HardwareName property returns an empty string.

Example

The following example gets the name of a connected CAN hardware:

VBS Macro

Sub HardwareNameExample()

' The first connection in the project must

' be a CAN connection

Dim client

If Connections(1).Protocol = peProtocolCAN Then

Set client = Connections(1).CommunicationObject

MsgBox "Name of hardware = " & client.Connections(1).HardwareName

End If

End Sub


HardwarePort Property

Applies to: PCANClientConnection object

Returns the I/O address that is used by the connected CAN hardware.

Syntax

object.HardwarePort

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A Long value that represents the I/O address that is used by a connected CAN hardware.

If the PCANClientConnection object is not connected to any PCAN net, or the connected PCAN net in turn is not connected to a CAN hardware, then the HardwarePort property returns the value 0.

Example

The following example gets the I/O address of the hardware:

VBS Macro

Sub HardwarePortExample()

' The first connection in the project must

' be a CAN connection

Dim client

If Connections(1).Protocol = peProtocolCAN Then

Set client = Connections(1).CommunicationObject

MsgBox "I/O address = " & client.Connections(1).HardwarePort

End If

End Sub

See also

HardwareInterrupt Property


HardwareStatus Property [Variation 1]

Applies to: PCANClientConnection object

Returns the current status of a connected CAN hardware.

Syntax

object.HardwareStatus

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A PCANError enum value that describes the status of the hardware: Possible values are:

  • pcanErrorNoVxd (512): No device driver is loaded.

  • pcanErrorBusOff (16): The connected CAN bus is in BUSOFF state.

  • pcanErrorBusHeavy (8): The connected CAN bus is in BUSHEAVY state.

  • pcanErrorOverrun (2): The reception register of the hardware couldn't be read before a new message was received.

Example

The following example retrieves the hardware status of the first connection in the project:

VBS Macro

Sub HardwareStatusExample()

If Connections.Count = 0 Then Exit Sub

Dim conn, ClientConn, status

Set conn = Connections(1)

If conn.Protocol = peProtocolCAN Then

' Access the PCANClientConnection object

Set ClientConn = conn.CommunicationObject

status = ClientConn.HardwareStatus

MsgBox "Hardware Status: " & ClientConn.Parent.GetErrorText(status)

End If

End Sub

See also

GetErrorText Method


HardwareStatus Property [Variation 2]

Applies to: J1939Node object

Returns the current status of a connected CAN hardware.

Parameters

object

An expression that evaluates to a J1939Node object.

Property values

A Long value that represents a status code. The status codes are identical to the ones returned by the HardwareStatus property of the PCANClient object. Possible values are:

  • 512 (pcanErrorNoDriver): No device driver is loaded.

  • 16 (pcanErrorBusOff): The connected CAN bus is in Bus-off state.

  • 8 (pcanErrorBusHeavy): The connected CAN bus is in BUSHEAVY state.

  • 2 (pcanErrorOverrun): The reception register of the hardware couldn't be read before a new message was received.


HardwareType Property

Applies to: J1939Node object

Returns the type of a connected CAN hardware.

Syntax

object.HardwareType

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A TCANHardware enum value that indicates the type of the connected CAN hardware. Possible values are:

  • tchNone (0): No hardware is connected.

  • tchDongle (1): The connected CAN hardware is a parallel port dongle.

  • tchPluginCard (2): The connected CAN hardware is either a plug-in card for the ISA bus, PCI bus, or PCI Express bus.

  • tchUSB (3): The CAN hardware is connected via a USB port.

  • tchPCCard (4): The connected CAN hardware is a PC Card (PCMCIA).


Height Property

Applies to: Window object

Sets or returns the height of a window.

Syntax

object.Height [=value]

Parameters

object

An expression that evaluates to a Window object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the height of the window in pixels.

Example

The following example sets the height of the active window to 150 pixels:

VBScript

ActiveWindow.Height = 150

See also

Left Property

Top Property

Width Property


HWnd Property

Applies to: Window object

Returns the window handle of the window.

Syntax

object.HWnd

Parameters

object

An expression that evaluates to a Window object.

Property value

A Long value that represents the Window Handle of the associated window.

Example

The following example gets the window handle of the active window and displays it in a message box:

VBS Macro

Sub HWndExample()

Dim h

h = ActiveWindow.HWnd

MsgBox "Window Handle = " & CStr(h)

End Sub


ID Property

Applies to: PCANMessage object, ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object, J1939Msg object, J1939RcvMsg object

Sets or returns the CAN ID of a CAN message.

Syntax

object.ID [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long value that specifies the new CAN identifier of the CAN message (0-1FFFFFFFh).

Property value

A Long value that represents the CAN identifier of the CAN message.

Remarks

The ID properties of the ReceiveEvent and TransmitEvent objects are read-only.

Example

The following example gets the CAN ID's of received messages and shows them in the output window:

VBS Macro

Sub IDExample()

Dim myClient, myConn, myMessage

' Create a new PCAN client, connect it, and

' open its filter

Set myClient = CreateObject("PCAN4.PCANClient")

myClient.Name = "Macro"

Set myConn = myClient.Connections.Add("TestNet")

myConn.RegisterMsg 0, &H7FF, False, False

Wait 1000

' Display all messages that have been received

' within the last Second

Set myMessage = myClient.Messages.Add

While myMessage.Read

PrintToOutputWindow Hex(myMessage.ID)

Wend

End Sub

The following example uses the Callback Library On Before Transmit event to modify data of a message with CAN ID 123h:

C++ Callback DLL

HRESULT __stdcall IDExample(PCANExplorer6::IPETransmitEvent *pEvent)

{

long id;

if (SUCCEEDED(pEvent->get_ID(&id)) && (id == 0x123))

{

// modify data byte 0

pEvent->put_Data(0, ...);

}

return S_OK;

}


IDfrom Property

Applies to: MessageFilterItem object

Sets or returns the lower CAN ID of a MessageFilterItem object that operates in ID Range mode.

Syntax

object.IDfrom [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the lower CAN ID of a range of CAN IDs.

Remarks

The IDfrom property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemIDRange.

See also

IDto Property

Type Property


IDto Property

Applies to: MessageFilterItem object

Sets or returns the upper CAN ID of a MessageFilterItem object that operates in ID Range mode.

Syntax

object.IDto [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the upper CAN ID of a range of CAN IDs.

Remarks

The IDto property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemIDRange.

See also

IDfrom Property

Type Property


IncludeEchoes Property

Applies to: J1939Node object

Sets or returns whether successfully transmitted messages are being echoed back in the receive queue.

Syntax

object.IncludeEchoes [=boolean]

Parameters

object

An expression that evaluates to a J1939Node object.

boolean

A Boolean value that specifies the new value of property.

Property value

A Boolean value that specifies whether messages that were transmitted successfully are being echoed back in the receive queue. If True, echoes are generated for transmitted messages. If False, no echoes are generated for transmitted messages.


IncludeTPMessages Property

Applies to: J1939Node object

Sets or returns whether Transport Protocol messages TPCM and TPDT are included in the messages receive queue.

Syntax

object.IncludeTPMessages [=boolean]

Parameters

object

An expression that evaluates to a J1939Node object.

boolean

A Boolean value that specifies the new value of property.

Property value

A Boolean value that specifies whether Transport Protocol messages TPCM and TPDT are included in the messages receive queue. True by default.


InitValue Property

Applies to: Signal object

Returns a Signal's initial value.

Syntax

object.InitValue

Parameters

object

An expression that evaluates to a Signal object.

Property value

A Double that specifies the Signal's initial value.

Remarks

You cannot use the InitValue property of Signals whose DataType property contains the value peDataTypeString.

Example

The following example displays the initial value of the signal "Speed" in a message box:

VBS Macro

Sub InitValueExample()

Dim sig, init

Set sig = Signals("Speed")

init = sig.InitValue

MsgBox init

End Sub


IsActive Property

Applies to: Application object, Document object, TextDocument object, Tracer object, Window object

Sets or returns whether a document, a window, or a tracer is active.

Syntax

object.IsActive [=boolean]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

boolean

A Boolean value that sets the new value of the property.

Property value

A Boolean value that specifies the state of the object. If True, the object is active. If False, the object is not active.

Example

The following example browses all open documents for the file "Sample.sym". If the file is found, it becomes the active document:

VBS Macro

Sub IsActiveExample()

Dim myDocument

For Each myDocument In Documents

If myDocument.Name = "Sample.sym" Then _

myDocument.IsActive = True

Next

End Sub


IsConnected Property [Variation 1]

Applies to: PCANClientConnection object

Sets or returns whether the PCANClientConnection object is connected to a PCAN net.

Syntax

object.IsConnected [=boolean]

Parameters

object

An expression that evaluates to a PCANClientConnection object.

boolean

A Boolean value that sets the new value of the property. If True, connects the object to the PCAN net that is specified in the NetName property. If False, disconnects the object from the previously connected PCAN net.

Property value

A Boolean value that specifies whether the object is connected or not. If True, the object is connected to a PCAN net. If False, the object is not connected to a PCAN net.

Example

The following example adds a new PCANClientConnection to a PCANClient object and connects it with the net "TestNet":

VBS Macro

Sub IsConnectedExample1()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.AutoConnect = False

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

' The following line establishes the connection

conn.IsConnected = True

' Access the connection here

' ...

MsgBox "Press OK to remove client"

End Sub

See also

AutoConnect Property

Device Property


IsConnected Property [Variation 2]

Applies to: AddIn object

Returns a value indicating whether an Add-in is loaded and connected.

Syntax

object.IsConnected

Parameters

object

An expression that evaluates to an AddIn object.

Property value

A Boolean value that specifies whether the Add-in is loaded and connected. If True, the Add-in is loaded and connected. If False, the Add-in is not loaded or connected.

Example

The following example lists all Add-ins that are loaded and connected:

VBS Macro

Sub IsConnectedExample2()

Dim objAddIn, strMsg

For Each objAddIn In AddIns

If objAddIn.IsConnected Then _

strMsg = strMsg & objAddIn.Name & vbCrLf

Next

MsgBox strMsg,,"Connected Add-ins"

End Sub


IsEcho Property

Applies to: J1939RcvMsg object

Returns whether the message an echo of a transmitted J1939 message.

Syntax

object.IsEcho

Parameters

object

An expression that evaluates to a J1939RcvMsg object.

Property value

A Boolean value that specifies wether the message is an echo or not. If True, the message is an echo. If False, the message is a normal receive message. Echoes will be received by the J1939 node if the IncludeEchoes property is set to True.

See also

J1939Node Object

IncludeEchoes Property


IsEnabled Property

Applies to: CallbackLibraryEvent object, Connection object, MessageFilter object, MessageFilterItem object, VBSMacroFile object

Sets or returns whether the object is enabled or not.

Syntax

object.IsEnabled [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether the object is enabled or not. If True, the object is enabled. If False, the object is not enabled.

Remarks

The IsEnabled property of the CallbackLibraryEvent object indicates, whether event handling is enabled for a Callback Library. The IsEnabled property of the CallbackLibraryEvent is read-only.

The IsEnabled property of the Connection object determines, whether the object has an active connection to a CAN bus or not.

The IsEnabled property of the MessageFilter object determines, whether the filter uses its filter items to filter messages. If the property is set to False, all messages can pass through the filter.

The IsEnabled property of the MessageFilterItem object determines, whether the parent filter uses the filter item to filter messages. Setting the property to False is, from the parent filter's view, the same as if the filter item is not present.

The IsEnabled property of the VBSMacroFile object determines, whether the macro file is loaded. If the macro file is loaded, all of its macros are available via the Macro drop-down list on the toolbar.


IsExtended Property

Applies to: MessageFilterItem object, Symbol object

Returns whether the object belongs to a CAN message that has a 29-bit identifier (Extended ID) or an 11-bit identifier (Standard ID).

Syntax

object.IsExtended [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object or Symbol object.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value.

The IsExtended property of the Symbol object indicates, whether the Symbol represents a 29-bit CAN message. The IsExtended property of the Symbol object is read-only.

The IsExtended property of the MessageFilterItem object determines, whether the filter item is responsible for filtering 29-bit or 11-bit CAN messages.

Example

The following example displays a list of all Symbols along with their IsExtended property value in a message box:

VBS Macro

Sub IsExtendedExample()

If SymbolsManager.Count = 0 Then Exit Sub

' Get the first Symbols collection

Dim symbols

Set symbols = SymbolsManager(1)

' Iterate all symbols

Dim symbol, strMsg

For Each symbol In symbols

strMsg = strMsg & symbol.Name

If symbol.IsExtended Then

strMsg = strMsg & " - Extended" & vbCrLf

Else

strMsg = strMsg & " - Standard" & vbCrLf

End If

Next

MsgBox strMsg,,"Symbols"

End Sub


IsMotorola Property

Applies to: Multiplexer object, Variable object

Returns whether the individual bytes of a Multiplexer or Variable are arranged in the Motorola byte order.

Syntax

object.IsMotorola

Parameters

object

An expression that evaluates to a Multiplexer or Variable object.

Property value

A Boolean value that specifies whether the bytes are arranged in Motorola format or not. If True, the bytes are arranged in Motorola format (also called Big-Endian). If False, the bytes are arranged in Intel format (also called Little-Endian).


IsOpenThroughout Property

Applies to: J1939Filters collection

Returns whether the reception filter of a J1939Node object is completely open.

Syntax

object.IsOpenThroughout

Parameters

object

An expression that evaluates to a J1939Filters collection.

Property value

A Boolean value that specifies whether the reception filter is completely open. If True, all J1939Filter objects in the collection are ignored so that all J1939 messages can pass the filter. If False, the attributes of the J1939Filter objects in the collection determine whether a J1939 message can pass the filter or not.

See also

J1939Filter Object

OpenThroughout Method


IsPaused Property

Applies to: Multiplexer object, TransmitEvent object, TransmitMessage object

Sets or returns whether a CAN message is transmitted periodically, or whether a Multiplexer is transmitted periodically by default.

Syntax

object.IsPaused [=boolean]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

boolean

A Boolean that sets the new value of the property.

Property value

A Boolean value that specifies whether the CAN message is transmitted periodically or not. If True, the CAN message is transmitted periodically. If False, the CAN message is not transmitted periodically.

Remarks

The IsPaused property of the Multiplexer object is read-only. It returns the value of the "Paused" parameter that was defined for the Multiplexer in the Symbols file.

A CAN message can only be transmitted periodically if its CycleTime property contains a value greater than 0.

Example

The following example pauses all periodic messages in the transmit list:

VBS Macro

Sub IsPausedExample()

Dim msg

For Each msg In TransmitMessages

msg.IsPaused = True

Next

End Sub

See also

CycleTime Property


IsReadOnly Property

Applies to: Document object, TextDocument object

Sets or returns whether a document is write protected in PCAN-Explorer.

Syntax

object.IsReadOnly [=boolean]

Parameters

object

An expression that evaluates to a Document object or a TextDocument object.

boolean

A Boolean value that sets the new value of the property. If True, makes the document write protected in PCAN-Explorer. If False, makes the document read/write in PCAN-Explorer, but does not change its status on disk. For example, if the document is read-only on disk, it remains read-only.

Property value

A Boolean value that specifies whether the document is write protected in the PCAN-Explorer environment. If True, the document is write protected. If False, the document is read/write.

Example

The following example makes the active document read-only:

VBScript

ActiveDocument.IsReadOnly = True


IsReceived Property

Applies to: TraceMessage object

Returns whether a recorded CAN message was received or transmitted.

Syntax

object.IsReceived

Parameters

object

An expression that evaluates to a TraceMessage object.

Property value

A Boolean value that indicates wether the CAN message was received or transmitted. If True, the CAN message was received. If False, the CAN message was transmitted.


IsRegistered Property

Applies to: PCANClient object

Sets or returns whether a PCAN client is registered at a PCAN device.

Syntax

object.IsRegistered [=value]

Parameters

object

An expression that evaluates to a PCANClient object.

value

A Boolean value that sets the new value of the property. If True, registers the client at the PCAN device. Alternatively, the Register method of the PCANClient object can be called. If False, removes the client from the PCAN system. Alternatively, the Remove method can be called.

Property value

A Boolean value that specifies whether the client is registered at the PCAN device or not. If True, the client is registered. If False, the the client is not registered.

Remarks

Before a PCANClient object can be registered at a PCAN device, the Device property must contain the name of a PCAN device that is installed and loaded. Furthermore, a client name must be assigned to its Name property.

Example

The following example creates a new PCAN client and registers it:

VBS Macro

Sub IsRegisteredExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

If client.IsRegistered Then

' ...

Else

MsgBox "Error while registering client!"

End If

End Sub


IsRTR Property

Applies to: Multiplexer object

Returns whether a Multiplexer represents a Remote Transmission Request (RTR) message.

Syntax

object.IsRTR

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Boolean value that indicates whether a Multiplexer represents an RTR message. If True, the Multiplexer represents an RTR message. If False, the Multiplexer does not represent an RTR message.

Example

The following example lists all Multiplexers of a Symbol with their IsRTR property and displays them in a message box:

VBScript

Dim mux, strMsg

For Each mux In mySymbol

strMsg = strMsg & mux.Name & vbTab & mux.IsRTR & vbCrLf

Next

MsgBox strMsg


IsSaved Property

Applies to: Document object, TextDocument object, Project object

Returns a document's saved status, indicating whether a document has changed since it was last saved.

Syntax

object.IsSaved

Parameters

object

An expression that evaluates to a Document object, a TextDocument object, or a Project object.

Property value

A Boolean value that indicates the document's saved status:

  • True: Indicates that the document has not been changed since it was created or last saved.

  • False: Indicates that the document has been changed since it was last saved.

Example

The following example shows the saved status of the active document:

VBS Macro

Sub IsSavedExample()

Dim status

status = ActiveDocument.IsSaved

If status Then

MsgBox "Document is saved!"

Else

MsgBox "Document is modified!"

End If

End Sub


IsTimeout Property

Applies to: TraceMessage object

Returns whether a time-out event was recorded for a CAN message.

Syntax

object.IsTimeout

Parameters

object

An expression that evaluates to a TraceMessage object.

Property value

A Boolean value that indicates whether a time-out event occurred when this message was sent or received. If True, a time-out occurred for this message. If False, no time-out occurred for this message.


IsTraced Property

Applies to: Multiplexer object, Variable object

Returns whether the object will be recorded by the tracer.

Syntax

object.IsTraced

Parameters

object

An expression that evaluates to a Multiplexer object or a Variable object.

Property value

A Boolean value that indicates whether the object will be recorded by a tracer. If True, the object will be traced. If False, the object will be ignored.

Remarks

The IsTraced property only has an effect if a message filter has been assigned to a tracer that has a filter element of type "Ajust to marked symbols".


IsValid Property

Applies to: Connection object

Returns whether a connection is valid or not.

Syntax

object.IsValid

Parameters

object

An expression that evaluates to a Connection object.

Property value

A Boolean value that indicates whether the connection is valid or not. If True, the connection is valid. If False, the connection is invalid.

Remarks

Whether a connection is valid or not depends on the value of the Connection property. If the property value references a device and a PCAN net which actually exist on the current computer, then the connection is valid.


IsVisible Property

Applies to: Window object

Sets or returns the visibility of a window.

Syntax

object.IsVisible [=boolean]

Parameters

object

An expression that evaluates to a Window object.

boolean

A Boolean value that sets the visibility of the window. True makes the window visible. False makes the window invisible.

Note

Tabbed Document windows cannot be made invisible. If the IsVisible property of an Tabbed Document window is set to False, the window is only minimized in the working space.
Property value

A Boolean value that specifies the visibility of the window. If True, the window is visible. If False, the window is invisible.

Example

The following example makes the main window of PCAN-Explorer visible:

VBS Macro

MainWindow.IsVisible = True


Item Property

Applies to: J1939Filters collection

Retrieves a specific object from a collection.

Syntax

object.Item ( index )

or

object ( index )

Parameters

object

An expression that evaluates to a J1939Filters collection.

index

A Long that specifies the 1-based index of the object in the collection.

Property value

A J1939Filter object.

Example

The following example accesses all filters in the collection:

VBS Macro

Dim filter, i

For i = 1 To myNode.Filters.Count

Set filter = myNode.Filters(i)

...

Next


ItemCount Property

Applies to: MessageFilter object

Returns the number of filter items in the filter.

Syntax

object.ItemCount

Parameters

object

An expression that evaluates to a MessageFilter object.

Property value

A Long value that indicates the number of filter items in the filter.


J1939FilterFlags Property

Applies to: MessageFilterItem object

Sets or returns a value that determines which J1939 attributes are taken into account to filter J1939 messages.

Syntax

object.J1939FilterFlags [=flags]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

flags

A combination of PeJ1939FilterFlags enum values that sets the new value of the property.

Property value

A combination of PeJ1939FilterFlags enum values. Possible values are:

  • peJ1939PGN (1): The PGN property is taken into account.

  • peJ1939Priority (2): The Priority property is taken into account.

  • peJ1939SourceAddress (3): The SourceAddress property is taken into account.

  • peJ1939DestinationAddress (4): The DestinationAddress property is taken into account.

Remarks

The J1939FilterFlags property only has an effect if the Type property of the MessageFilterItem object is set to peFilterItemJ1939.

See also

Type Property


Kind Property

Applies to: Document object, ProjectItem object, Window object

Returns a GUID string indicating the kind or type of the object.

Syntax

object.Kind

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that indicates the kind or type of the object.

The Kind property of the Document object can return one of the following values:

Kind | Meaning | Alias
{80FDDCF6-A897-4A13-8893-1450FCB1754F} | Text document | peDocumentKindText
{ABF79C99-1166-4A10-90D3-5058EB7E94C5} | Trace document | peDocumentKindTrace
{9B06D6BC-2C36-41CC-8633-E7CFDE493D4F} | Transmit List document | peDocumentKindTransmit
{E76D8F30-5131-43C7-91E8-41CAC563CD90} | HTML document | peDocumentKindHtml
{31191CEB-5D42-4D0B-944D-5DC876238C35} | Plotter document | peDocumentKindPlotter
{DFAFFAC0-2F50-428E-824C-B97089CD5F3F} | Instruments Panel document | peDocumentKindInstrumentsPanel
{932ED998-1332-415b-A667-F5690CE3A42D} | Line Writer document | peDocumentKindLineWriter

The Kind property of the Window object can return one of the following values:

Kind | Meaning | Alias
{80FDDCF6-A897-4A13-8893-1450FCB1754F} | Text document | peDocumentKindText
{ABF79C99-1166-4A10-90D3-5058EB7E94C5} | Trace document | peDocumentKindTrace
{9B06D6BC-2C36-41CC-8633-E7CFDE493D4F} | Transmit List document | peDocumentKindTransmit
{E76D8F30-5131-43C7-91E8-41CAC563CD90} | HTML document | peDocumentKindHtml
{31191CEB-5D42-4D0B-944D-5DC876238C35} | Plotter document | peDocumentKindPlotter
{DFAFFAC0-2F50-428E-824C-B97089CD5F3F} | Instruments Panel document | peDocumentKindInstrumentsPanel
{932ED998-1332-415b-A667-F5690CE3A42D} | Line Writer document | peDocumentKindLineWriter
{7BF0CC9B-1632-4935-AD9A-ACE17D48E2C9} | Main window | peWindowKindMainWindow
{3F159EA3-60F6-46C7-9062-93F1E6750139} | Receive/Transmit window | peWindowKindReceiveTransmit
{48F7B7FB-3CE6-4A06-9310-444871C3B477} | Project Manager window | peWindowKindProjectManager
{FB44BF1E-7C70-4F04-A5B5-A476C4006598} | Connections window | peWindowKindConnections
{7A8A32C4-B718-40D6-9B8B-688F6DEF3068} | Properties window | peWindowKindProperties
{4842AE28-C870-4465-8195-8E0BC9B5DC5A} | Output window | peWindowKindOutput
{EA49F784-6A32-4CFE-A009-A286A8DED2FD} | Watch window | peWindowKindWatch
{27B1E93E-3A39-46E0-9BA8-4B40071A7BF5} | Timing Errors window | peWindowKindTiming
{9D2F99BB-7967-4361-8FA6-7ACD02D41EE3} | Macro Status window | peWindowKindMacroStatus
{0EFDD5ED-3FFB-4fec-AA56-927B865C3B3A} | Library window | peWindowKindLibrary
{D71CB064-8749-45C1-B82B-047AAFC33690} | Start Page | peWindowKindStartPage
{FF2113AB-74F9-412A-8D05-56BB972DB9C0} | News window | peWindowKindNews
{4B0CCB52-16CF-4F69-91FD-6339284F9FBD} | About window | peWindowKindAbout

The Kind property of the ProjectItem object can return one of the following values:

Kind | Meaning | Alias
{BD403830-4B7E-450f-95F5-29DBCEFC83A0} | File | peProjectItemKindFile
{BD403832-4B7E-450f-95F5-29DBCEFC83A0} | Virtual Folder | peProjectItemKindVirtualFolder
{BD403833-4B7E-450f-95F5-29DBCEFC83A0} | Connection | peProjectItemKindConnection
{BD403834-4B7E-450f-95F5-29DBCEFC83A0} | Connections | peProjectItemKindConnections
{BD403835-4B7E-450f-95F5-29DBCEFC83A0} | Message Filter | peProjectItemKindMessageFilter
{BD403836-4B7E-450f-95F5-29DBCEFC83A0} | Message Filters | peProjectItemKindMessageFilters
{BD403837-4B7E-450f-95F5-29DBCEFC83A0} | Message Filter Item | peProjectItemKindMessageFilterItem
{BD403838-4B7E-450f-95F5-29DBCEFC83A0} | Receive List | peProjectItemKindReceiveList
{BD403839-4B7E-450f-95F5-29DBCEFC83A0} | Transmit List | peProjectItemKindTransmitList
{BD40383A-4B7E-450f-95F5-29DBCEFC83A0} | Transmit List Item | peProjectItemKindTransmitListItem
{BD40383B-4B7E-450f-95F5-29DBCEFC83A0} | File Configuration | peProjectItemKindFileConfiguration
{BD40383C-4B7E-450f-95F5-29DBCEFC83A0} | Macros | peProjectItemKindMacros
{BD40383D-4B7E-450f-95F5-29DBCEFC83A0} | Macro | peProjectItemKindMacro
{BD40383E-4B7E-450f-95F5-29DBCEFC83A0} | Signals | peProjectItemKindSignals
{BD40383F-4B7E-450f-95F5-29DBCEFC83A0} | Signal | peProjectItemKindSignal
{BD403840-4B7E-450f-95F5-29DBCEFC83A0} | Timings | peProjectItemKindTimings
Example

The following example shows the kind of the active document:

VBS Macro

Sub KindExample()

' Open a text document before executing this example

Dim objDoc

Set objDoc = ActiveDocument

MsgBox "Kind of the active document: " & objDoc.Kind

End Sub


Properties L-P

The following table contains all properties beginning with letters L to P:

Property | Description
Language [Variation 1] | Sets or returns the (programming) language of a text document, which is used to set the correct syntax highlighting in the text editor.
Language [Variation 2] | Sets or returns the primary language ID of the language that is used for error messages.
LastCANError | Returns the code of the object's last CAN error.
LastError [Variation 1] | Returns the error code of an object's error that has occurred last.
LastError [Variation 2] | Returns the code of the last error that occurred for a J1939 node.
LastError [Variation 3] | Returns the code of the last error that occurred while sending the message.
LastErrorText | Returns the last error that has occurred for the object, as text.
LastErrorType | Returns what kind of error is specified in the LastError property of the TransmitMessage object.
Left | Sets or returns the x-coordinate of a window's left edge.
Length | Sets or returns the length of a J1939 message.
ListenOnly | Sets or returns whether the Listen Only mode is activated for the PCANClientConnection object.
LongName | Sets or returns the long name of an object.
MainWindow | Returns a Window object that represents the main window of PCAN-Explorer.
Max | Sets or returns the upper limit of a Signal's or Variable's range of values.
MaxCycleTime | Returns the measured maximum time interval between two successive reception events.
MessageFilters | Returns a MessageFilters collection.
Messages | Returns a collection of CAN messages.
Min | Sets or returns the lower limit of a Signal's or Variable's range of values.
MinCycleTime | Returns the measured minimum time interval between two successive reception events.
MinInterval | Returns the minimum allowed interval time value that was defined for a Multiplexer.
Monitoring | Sets or returns whether a J1939Node object works as a J1939 network monitor.
MsgType | Sets or returns the type of a CAN message.
Multiplexer | Returns the Multiplexer object that is associated with a CAN message.
Multiplexers | Returns a Multiplexers collection.
MuxData | Returns the data bytes of a Multiplexer, which are filled with the value of the Multiplexer.
MuxLength | Returns the number of bits that a Multiplexer occupies in the data bytes of the CAN message.
MuxStart | Returns a Multiplexer's first bit's index in the data bytes of a CAN message.
MuxValue | Returns the value of a Multiplexer.
Name | Sets or returns the name of an object.
NetBaudRate | Returns the baud rate code that was defined for a connected PCAN net that uses an SJA1000-compatible (non-CAN-FD) baud rate.
NetBitRate | Returns a PCANBitrate object that describes the bit rate that was defined for a connected PCAN net.
NetBitRateText | Returns the bit rate that was defined for the connected PCAN net as text, as a text.
NetHandle | Returns the handle of the connected PCAN net.
NetName | Returns the name of the connected PCAN net.
_NewEnum | References objects in a collection.
Next | Returns the next window in the tab sequence.
NominalBitrate | Returns the nominal (arbitration) bit rate of a CAN or CAN FD bit rate.
NotificationOnAddressClaiming | Sets or returns whether a J1939Node object triggers OnAddressClaiming events during an address claiming process.
NotificationOnAddressLost | Sets or returns whether the J1939Node object triggers OnAddressLost events.
NotificationOnMessageReceived | Sets or returns whether the J1939Node object triggers OnMessageReceived events.
NotificationOnPropertyChange | Sets or returns whether the J1939Node object triggers OnPropertyValueChanged events.
Object | Returns an interface or object that can be accessed by name at run time.
ObjectKind | Returns the type of the Window.Object object, which is a GUID string representing the tool contained in the window.
Offset | Returns the offset that was defined for the for the variable to transform its value from a raw value into a physical value.
Originator | Sets or returns the source address of the originator of a J1939 message.
OutputFormat | Returns the output format of a Variable.
OutputWindowPanes | Returns the OutputWindowPanes collection for the object.
Overtype | Sets or returns whether the editor is in overtype mode.
PacksCount | Returns the number of packages in which the data of this message is distributed.
PacksCountOnReadSessions | Sets or returns the maximum number of large message data packets cleared to send in a TPCM.CTS message.
PacksCountOnWriteSessions | Sets or returns a value that limits the number of requested packets that can be sent by the originator in response to one CTS.
ParameterString | Returns a string with the individual parameters of the bit rate.
Parent | Returns the immediate parent object of a given object.
Path | Returns the path to an object.
PGN | Sets or returns a J1939 Parameter Group Number.
PGNsToRejectOnRTS | Sets or returns a set of PGNs that are rejected by sending TPCM.ConnAbort when a TPCM.RTS message is received for one of them.
PlaybackPosition | Returns the current playback position of a tracer.
PlaybackRepeat | Determines whether trace playback restarts from the beginning when the end of the trace buffer or file is reached.
PlaybackRepeatCount | During playback of a trace buffer or file, determines the number of playback cycles before playback is stopped.
PlaybackRepeatPause | Determines the time delay before playback of a trace buffer or file is repeated.
PostLoadCommand | Sets or returns the name of a command that is executed after a project is loaded.
PreferredAddress | Sets or returns the address that the J1939Node object tries to claim when the ClaimAddress method is called.
Previous | Returns the previous window in the tab sequence.
Priority | Sets or returns a J1939 Priority.
ProgID | Returns a ProgID based on an Add-in's registry entry.
Project | Returns the Project object in which a ProjectItem object or ProjectItems collection is included.
ProjectItems | Returns a ProjectItems collection for the object.
Protocol | Sets or returns the protocol that a connection uses.

See also

Properties A-F

Properties G-K

Properties Q-T

Properties U-Z


Language Property [Variation 1]

Applies to: TextDocument object

Sets or returns the (programming) language of a text document, which is used to set the correct syntax highlighting in the text editor.

Syntax

object.Language [=string]

Parameters

object

An expression that evaluates to a TextDocument object.

string

A string constant of type PeLanguageSettings that specifies the type of the language. Possible values are:

  • peSymbols: Represents "CAN Symbols".

  • peMacro: Represents "Macro".

  • peVBSMacro: Represents "VBS Macro".

Remarks

The Language property has the String type.

Example

The following example sets the language of the active document to "CAN Symbols":

VBS Macro

Sub LanguageExample()

If ActiveDocument.Kind = peDocumentKindText Then _

ActiveDocument.Language = peSymbols

End Sub


Language Property [Variation 2]

Applies to: PCANClient object

Sets or returns the primary language ID of the language that is used for the error messages returned by the GetLongErrorText method.

Syntax

object.Language [=value]

Parameters

object

An expression that evaluates to a PCANClient object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that specifies the primary language ID. Possible language IDs are 9 (English, the default) and 7 (German).


LastCANError Property

Applies to: J1939Node object

Returns the code of the object's last CAN error.

Syntax

object.LastCANError

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A Long value that represents a combination of error codes. The individual error codes are identical to the ones returned by the LastError property of the PCANClient object:

  • 0 (pcanErrorOk): No error occurred.

  • 1 (pcanErrorXmtFull): The transmission buffer in the CAN controller is full.

  • 2 (pcanErrorOverrun): The CAN controller hasn't been read out before the reception of a new message.

  • 4 (pcanErrorBusLight): An error counter has reached the BUSLIGHT limit.

  • 8 (pcanErrorBusHeavy): An error counter has reached the BUSHEAVY limit.

  • 8 (pcanErrorBusWarning): An error counter reached the 'warning' limit.

  • 10h (pcanErrorBusOff): The CAN controller is in bus-off state.

  • 20h (pcanErrorQRcvEmpty): The receive queue is empty.

  • 40h (pcanErrorQOverrun): The reception queue has overflowed.

  • 80h (pcanErrorQXmtFull): The transmission queue is full.

  • 100h (pcanErrorRegTest): The register test of the SJA1000 has failed.

  • 200h (pcanErrorNoDriver): No device driver is loaded.

  • 400h (pcanErrorHwInUse): The hardware is occupied by another net.

  • 800h (pcanErrorNetInUse): A client is connected to the net.

  • 1400h (pcanErrorIllHw): The hardware handle is not valid.

  • 1800h (pcanErrorIllNet): The net handle is not valid.

  • 1C00h (pcanErrorIllClient): The client handle is not valid.

  • 1C00h (pcanErrorMaskIllHandle): Mask for all handle errors.

  • 2000h (pcanErrorResource): A resource (buffer, client, timeout) couldn't be created.

  • 4000h (pcanErrorParamType): The parameter is not permitted/applicable.

  • 8000h (pcanErrorParamVal): Der parameter value is not valid.

  • 10000h (pcanErrorUnknown): Unknown error.

  • 20000h (pcanErrorIllFunction): Function not supported.

  • 40000h (pcanErrorBusPassive): The CAN controller is in error passive state.

  • 1000000h (pcanErrorIllDevice): The indicated device name is not allowed.

See also

LastError Property [Variation 1]

LastError Property [Variation 2]


LastError Property [Variation 1]

Applies to: PCANClient object, PCANMessage object

Returns the error code of an object's error that has occurred last.

Syntax

object.LastError

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A combination of PCANError enum values:

  • pcanErrorOk(0): No error occurred.

  • pcanErrorXmtFull (1): The transmission buffer in the CAN controller is full.

  • pcanErrorOverrun (2): The CAN controller hasn't been read out before the reception of a new message.

  • pcanErrorBusLight (4): An error counter has reached the BUSLIGHT limit.

  • pcanErrorBusHeavy (8): An error counter has reached the BUSHEAVY limit.

  • pcanErrorBusWarning (8): An error counter reached the 'warning' limit.

  • pcanErrorBusOff (10h): The CAN controller is in bus-off state.

  • pcanErrorQRcvEmpty (20h): The receive queue is empty.

  • pcanErrorQOverrun (40h): The reception queue has overflowed.

  • pcanErrorQXmtFull (80h): The transmission queue is full.

  • pcanErrorRegTest (100h): The register test of the SJA1000 has failed.

  • pcanErrorDriver (200h): No device driver is loaded.

  • pcanErrorHwInUse (400h): The hardware is occupied by another net.

  • pcanErrorNetInUse (800h): A client is connected to the net.

  • pcanErrorIllHw (1400h): The hardware handle is not valid.

  • pcanErrorIllNet (1800h): The net handle is not valid.

  • pcanErrorIllClient (1C00h): The client handle is not valid.

  • pcanErrorMaskIllHandle (1C00h): Mask for all handle errors.

  • pcanErrorResource (2000h): A resource (buffer, client, timeout) couldn't be created.

  • pcanErrorParamType (4000h): The parameter is not permitted/applicable.

  • pcanErrorParamVal (8000h): Der parameter value is not valid.

  • pcanErrorUnknown (10000h): Unknown error.

  • pcanErrorIllFunction (20000h): Function not supported.

  • pcanErrorBusPassive (40000h): The CAN controller is in error passive state.

  • pcanErrorIllDevice (1000000h): The indicated device name is not allowed.

Example

The following example retrieves the last error of a PCANClient object:

VBS Macro

Sub LastErrorExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro" ' This registers the client automatically

If Not client.IsRegistered Then

' Error while registering client

MsgBox "Error code: " & client.LastError

End If

End Sub

See also

LastErrorText Property

GetErrorText Method


LastError Property [Variation 2]

PCAN-Explorer: Automation

Objects

LastError Property [Variation 3]

Home Page (Objects) | Reference

Applies to: J1939Node object

Returns the code of the last error that occurred for the J1939 node.

Syntax

object.LastError

Parameters

object

An expression that evaluates to a J1939Node object.

Property value

A TJ1939Error enum value. The following values are possible:

  • errOK (0): No error occurred.

  • errNotConnected (1): The J1939 node is not connected to any PCAN net.

  • errAlreadyConnected (2): The J1939 node is already connected to a PCAN net.

  • errAlreadySending (3): The transmission of a large message to the specified address is already in progress.

  • errWrongParamValue (4): A specified parameter was invalid.

  • errAddressBeingClaimed (5): Claiming an address is already in progress.

  • errAddressLost (6): The previously claimed address was lost.

  • errAddrNotClaimed (7): An address must be claimed first.

  • errAddrClaimFailed (8): Claiming an address has failed.

  • errQueueEmpty (9): There are no messages in the receive queue.

  • errCANObject (10; 0Ah): A CAN error occurred. See LastCANError property for more information.

  • errResource (11; 0Bh): Ab error occurred while allocating or freeing a resource.

  • errAborted (12; 0Ch): An operation was aborted because the connection was lost.

  • errUnknownError (65536; 10000h): An unknown error occurred.

See also

LastCANError Property


LastError Property [Variation 3]

Applies to: TransmitEvent object, TransmitMessage object

Returns the code of the last error that occurred while sending the message.

Syntax

object.LastError

Parameters

object

An expression that evaluates to a TransmitEvent or TransmitMessage object.

Property value

A Long value that represents an error code. The meaning of the error code depends on the contents of the LastErrorType property.

LastErrorType | Description
peErrorTypeCAN (0) | The individual error codes are identical to the ones returned by the LastError property of the PCANClient object.
peErrorTypeJ1939 (1) | The individual error codes are identical to the ones returned by the LastError property of the J1939Node object
peErrorTypeOther (2) Possible errors:
  • 10: No connection is assigned to the transmit message.
  • 11: The assigned connection is not enabled.

See also

LastErrorType Property


LastErrorText Property

Applies to: PCANClient object, PCANMessage object

Returns the last error that has occurred for the object, as text.

Syntax

object.GetLastErrorText

Parameters

object

An expression that evaluates to a PCANClient object or a PCANMessage object.

Return value

The LastErrorText property returns a String containing the error that has occurred last, in text format. Errors can be generated by calling methods or by setting properties of the objects. The last occurred error is saved in the LastError property of the PCANClient object or PCANMessage object.

If the value of the LastError property is 0, The LastErrorText property returns an empty string.

Remarks

The LastErrorText property has the String type.

Example

The following example shows the error occurred last as text:

VBS Macro

Sub LastErrorTextExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Name = "Macro"

If Not client.IsRegistered Then

' Error while registering client at PCAN device

MsgBox "Error: " & client.LastErrorText

End If

End Sub

See also

LastError Property

GetErrorText Method


LastErrorType Property

Applies to: TransmitEvent object, TransmitMessage object

Returns what kind of error is specified in the LastError property of the object.

Syntax

object.LastErrorType

Parameters

object

An expression that evaluates to a TransmitEvent or TransmitMessage object.

Property value

A PeErrorType enum value that indicates what kind of error is specified in the LastError property.

  • peErrorTypeCAN (0): The message is a CAN message, see the LastError property of the PCANClient object for a description of the possible error codes.

  • peErrorTypeJ1939 (1): The message is a J1939 message, see LastError property of the J1939Node object for a description of the possible error codes.

  • peErrorTypeOther (2): This kind of error can occur if the transmit message is not assigned to any bus/connection, or if the assigned connection is not enabled.


Left Property

Applies to: Window object

Sets or returns the x-coordinate of a window's left edge.

Syntax

object.Left [=value]

Parameters

object

An expression that evaluates to a Window object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the x-coordinate of the window's left edge in pixels.

Remarks
Note

Tabbed Document window coordinates are relative to the child window client area. (This area is inside the frame but does not include the docking sites.)
Example

The following example sets the x-coordinate of the active window to 25:

VBScript

ActiveWindow.Left = 25

See also

Height Property

Top Property

Width Property


Length Property

Applies to: J1939Msg object, J1939RcvMsg object

Sets or returns the length of the message.

Syntax

object.Length [=value]

Parameters

object

An expression that evaluates to a J1939Msg object or a J1939RcvMsg object.

value

A value that sets the new value of the data byte.

Property value

A Long value that specifies the length of the J1939 message (0-1785).

Remarks

The Length property of the J1939RcvMsg object is read-only.


ListenOnly Property

Applies to: PCANClientConnection object

Sets or returns whether the Listen Only mode is activated for the PCANClientConnection object.

Syntax

object.ListenOnly [=boolean]

Parameters

object

An expression that evaluates to a PCANClientConnection object.

boolean

A Boolean value that sets the new value of the property.

Property value

A Boolean value that specifies whether the Listen Only mode is activated for the object. If True, the Listen Only mode is activated. If False, the Listen Only mode is deactivated.

Remarks

The ListenOnly property only has an effect if the PCANClientConnection object is connected to a CAN hardware.

In Listen Only mode, the CAN controller gives no acknowledge to the CAN bus, even if a message is received successfully. The CAN controller is forced to be error passive. Message transmission is not possible. The Listen Only mode can be used e.g. for monitoring purposes or software driven bit rate detection.


LongName Property

Applies to: Signal object, Variable object

Sets or returns the long name of an object.

Syntax

object.LongName [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A String value that specifies the new value of the property.

Property value

A String value that specifies the long name of the object.

Remarks

The LongName property of the Variable object is read-only.

See also

Name Property


MainWindow Property

Applies to: Application object

Returns a Window object that represents the main window of PCAN-Explorer.

Syntax

object.MainWindow

Parameters

object

An expression that evaluates to an Application object. When you access the MainWindow property of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

Property value

A Window object.

Example

The following example gets the caption of the main window and displays it in a message box:

VBS Macro

Sub MainWindowExample()

MsgBox MainWindow.Caption

End Sub


Max Property

Applies to: Signal object, Variable object

Sets or returns the upper limit of a Signal's or Variable's range of values.

Syntax

object.Max [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A Long value that sets the new value of the property.

Property value

A Double value that specifies the upper limit of the object's range of values.

The Max property of signals that have the data type peDataTypeString always returns 0.

Remarks

The Max property of the Variable object is read-only.

Example

The following example displays the range of values of the signal "Speed":

VBS Macro

Sub ValueExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Value range: " & sig.Min & "..." & sig.Max

End Sub

See also

Min Property


MaxCycleTime Property

Applies to: ReceiveEvent object, ReceiveMessage object

Returns the measured maximum time interval between two successive reception events.

Syntax

object.MaxCycleTime

Parameters

object

An expression that evaluates to a ReceiveEvent or ReceiveMessage object.

Property value

A Long value that specifies the measured maximum time interval between two successive reception events in milliseconds.

Example

The following example prints the maximum cycle times of each message in the Receive List to the Output window:

VBS Macro

Sub MaxCycleTimeExample()

Dim msg

For Each msg In ReceiveMessages

PrintToOutputWindow "ID=" & Hex(msg.ID) & ", MaxCycleTime=" & _

msg.MaxCycleTime & " ms"

Next

End Sub

See also

MinCycleTime Property


MessageFilters Property

Applies to: Application object

Returns the MessageFilters collection.

Syntax

object.MessageFilters

Parameters

object

An expression that evaluates to an Application object.

Property value

A MessageFilters collection.

Example

The following example accesses the MessageFilters collection:

VBS Macro

Sub MessageFiltersExample()

Dim filter, strMsg

For Each filter In MessageFilters

strMsg = strMsg & filter.Name & vbCrLf

Next

MsgBox strMsg,,"Filters"

End Sub


Messages Property

Applies to: PCANClient object, Tracer object, TransmitWindow object

Returns a collection of CAN messages.

Syntax

object.Messages

Parameters

object

An expression that evaluates to a PCANClient object, a Tracer object, or a TransmitWindow object.

Property value

  • For the PCANClient object a PCANMessages collection is returned.

  • For the Tracer object a TraceMessages collection is returned.

  • For the TransmitWindow object a TransmitMessages collection is returned.

Remarks

The PCANMessages collection represents a collection of CAN messages. Each CAN message in the collection is represented by a PCANMessage object.

The TraceMessages collection represents a collection of CAN messages. Each CAN message in the collection is represented by a TraceMessage object.

The TransmitMessages collection represents a collection of CAN messages. Each CAN message in the collection is represented by a TransmitMessage object.

When you query the Messages property of the Tracer object, the tracer must be either in paused or stopped mode (see TraceState property), otherwise an empty TraceMessages collection is returned.

Example

The following example accesses the Messages property of a Transmit list window:

VBS Macro

Sub MessagesExample()

If ActiveWindow.Kind = peDocumentKindTransmit Then _

MsgBox ActiveWindow.Object.Messages.Count

End Sub


Min Property

Applies to: Signal object, Variable object

Sets or returns the lower limit of a Signal's or Variable's range of values.

Syntax

object.Min [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A Long value that sets the new value of the property.

Property value

A Double value that specifies the lower limit of the object's range of values.

The Min property of signals that have the data type peDataTypeString always returns 0.

Remarks

The Min property of the Variable object is read-only.

Example

The following example displays the range of values of the signal "Speed":

VBS Macro

Sub ValueExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Value range: " & sig.Min & "..." & sig.Max

End Sub

See also

Max Property


MinCycleTime Property

Applies to: ReceiveEvent object, ReceiveMessage object

Returns the measured minimum time interval between two successive reception events.

Syntax

object.MinCycleTime

Parameters

object

An expression that evaluates to a ReceiveEvent or ReceiveMessage object.

Property value

A Long value that specifies the measured minimum time interval between two successive reception events in milliseconds.

Example

The following example prints the minimum cycle times of each message in the Receive List to the Output window:

VBS Macro

Sub MaxCycleTimeExample()

Dim msg

For Each msg In ReceiveMessages

PrintToOutputWindow "ID=" & Hex(msg.ID) & ", MaxCycleTime=" & _

msg.MinCycleTime & " ms"

Next

End Sub

See also

MaxCycleTime Property


MinInterval Property

Applies to: Multiplexer object, ReceiveEvent object, ReceiveMessage object

Returns the minimum allowed interval time value that was defined for a Multiplexer.

Syntax

object.MinInterval

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value that specifies the minimum interval time of the object in Milliseconds.

The value 0 indicates that no minimum interval was defined for the object.

Example

The following example gets the minimum interval time of a Multiplexer:

VBScript

Dim minInt

minInt = myMux.MinInterval

See also

Timeout Property


Monitoring Property

Applies to: J1939Node object

Sets or returns whether a J1939Node object works as a J1939 network monitor.

Syntax

object.Monitoring [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939 node object works as a J1939 network monitor. If True, Monitoring mode is activated. If False, Monitoring mode is deactivated.

In Monitoring mode, the J1939 node processes all of the Transport Protocol messages on the bus, even those that are not explicitly directed to the node because of its claimed address. The node processes the Transport Protocol messages and builds the large messages, which are then placed in the node's receive queue when completely transmitted.


MsgType Property

Applies to: PCANMessage object, ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns the type of a CAN message.

Syntax

object.MsgType [=type]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

type

A combination of PCANMsgType enum values that specify the new value of the property.

Property value

A combination of PCANMsgType enum values that specify the type of the CAN message:

  • pcanMsgTypeStandard (0): A standard frame (11-bit CAN ID).

  • pcanMsgTypeRTR (1): A Remote Request frame.

  • pcanMsgTypeExtended (2): An extended frame (29-bit CAN ID).

  • pcanMsgTypeSingleShot (8): The message uses the Single Shot CAN controller option.

  • pcanMsgTypeErrorFrame (64): An Error Frame.

  • pcanMsgTypeStatus (128): A status message.

  • pcanMsgTypeErrorCounter (256): The message informs about error counter value changes.

  • pcanMsgTypeBusload (512): The message contains busload information.

  • pcanMsgTypeFD (1024): A CAN FD frame. CAN FD frames can have up to 64 data bytes.

  • pcanMsgTypeBRS (2048): A CAN FD frame with active Bit Rate Switch. The data fields in a CAN FD frame are transferred with a higher bit rate if the Bit Rate Switch flag is set.

  • pcanMsgTypeESI (4096): A CAN FD frame with Error State Indicator flag set. The Error State Indicator provides information, whether the sender of the message is in Error Active or Error Passive state.

Remarks

The MsgType properties of the ReceiveEvent and TransmitEvent objects are read-only.

Example

The following example sends a Remote Transmission Request message with an extended CAN ID:

VBS Macro

Sub MsgTypeExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Name = "Macro"

' Connect client to net TestNet

Set conn = client.Connections.Add("TestNet")

If conn.IsConnected Then

Dim msg

Set msg = client.Messages.Add

With msg

.ID = &H100

.DLC = 2

.MsgType = pcanMsgTypeRTR + pcanMsgTypeExtended

.Write conn, 0

End With

End If

End Sub


Multiplexer Property

Applies to: ReceiveMessage object, TraceMessage object, TransmitMessage object

Returns the Multiplexer object that is associated with the CAN message.

Syntax

object.Multiplexer

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Multiplexer object.

Example

The following example displays the Multiplexer name of every symbolic CAN message that the Receive list contains:

VBS Macro

Sub MultiplexerExample()

Dim msg

For Each msg In ReceiveMessages

If Not msg.Multiplexer Is Nothing Then _

PrintToOutputWindow msg.Multiplexer.Name

Next

End Sub

See also

Symbol Property


Multiplexers Property

Applies to: Symbol object

Returns a Multiplexers collection.

Syntax

object.Multiplexers

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A Multiplexers collection.

Remarks

The Multiplexers collection contains all Multiplexers that were defined for a Symbol. Each Multiplexer in the collection is represented by a Multiplexer object.

Example

The following example accesses the Multiplexers collection of a Symbol:

VBScript

Dim muxs

Set muxs = mySymbol.Multiplexers


MuxData Property

Applies to: Multiplexer object

Returns the data bytes of a Multiplexer, which are filled with the value of the Multiplexer.

Syntax

object.MuxData ( index )

Parameters

object

An expression that evaluates to a Multiplexer object.

index

A Long value that specifies the index (0-7) of the accessed data byte.

Property value

An indexed Long value that specifies one data byte of a CAN message (0-255).

Remarks

The data bytes that can be retrieved with the MuxData property do not contain the default data of the signal. The default data can be retrieved with the DefaultData property.

Example

The following example shows how the value of a Multiplexer is embedded in the data bytes of a CAN message:

VBScript

Dim strMsg

For i = 0 To myMux.DataLength-1

strMsg = strMsg & Hex(myMux.MuxData(i)) & " "

Next

MsgBox strMsg

See also

MuxStart Property

MuxLength Property


MuxLength Property

Applies to: Multiplexer object, Symbol object

Returns the number of bits that the Multiplexer occupies in the data bytes of the CAN message.

Syntax

object.MuxLength

Parameters

object

An expression that evaluates to a Multiplexer object or a Symbol object.

Property value

A Long value that specifies the length of the Multiplexer in bits.

Remarks

All Multiplexers contained in a Symbol object have the same number of bits.

See also

MuxStart Property


MuxStart Property

Applies to: Multiplexer object, Symbol object

Returns the Multiplexer's first bit's index in the data bytes of a CAN message.

Syntax

object.MuxStart

Parameters

object

An expression that evaluates to a Multiplexer object or a Symbol object.

Property value

A Long value that specifies the 0-based index of the Multiplexer's fist bit.

Remarks

All Multiplexers contained in a Symbol object have the same start index.

See also

MuxLength Property


MuxValue Property

Applies to: Multiplexer object

Returns the value of the Multiplexer.

Syntax

object.MuxValue

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Long value that specifies the value of the Multiplexer.

Example

The following example retrieves the value of a Multiplexer:

VBScript

Dim v

v = myMultiplexer.MuxValue


Name Property

Applies to: AddIn object, Application object, CallbackLibraryEvent object, Connection object, Document object, Enum object, MessageFilter object, OutputWindowPane object, PCANClient object, Project object, ProjectItem object, Multiplexer object, Signal object, Symbol object, TextDocument object, Variable object

Sets or returns the name of an object.

Syntax

object.Name [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A String value that sets the name of the object.

Property value

A String value that specifies the name of the object.

The following table summarizes the results of using the Name property with the objects in the Applies To list:

Object | Result
AddIn | The name of the Add-in.
Application | The name of the application.
CallbackLibraryEvent | The file name of the Callback Library.
Connection | The name of the connection.
Document | The file name of the current document.
Enum | The name of the enum.
MessageFilter | The name of the message filter.
Multiplexer | The name of the multiplexer.
OutputWindowPane | The label name of the tab.
PCANClient | The name, under which the PCANClient object is registered at a PCAN device.
Project | The name of the project.
ProjectItem | The name of the project item.
Signal | The name of the signal.
Symbol | The name of the symbol.
TextDocument | The file name of the text document, for example "Sample.sym"
Variable | Tthe name of the variable.
Remarks

On file names, the Name property does not return the drive and the folder of the file. To get the drive and directory, use the Path or FullName property.

Only the Name properties of the Connection object, MessageFilter object, PCANClient object, Project object, and Signal object are writable. The Name properties of all other objects are read-only.

Example

The following example retrieves the name of the active document:

VBS Macro

MsgBox ActiveDocument.Name

See also

FullName Property


NetBaudRate Property

Applies to: PCANClientConnection object

Returns the baud rate code that was defined for a connected PCAN net that uses an SJA1000-compatible (non-CAN-FD) baud rate.

To access the bit rate parameters of a PCAN net that represents a CAN FD connection, use the NetBitRate property.

Syntax

object.NetBaudRate

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A Long containing a 16-bit value, which is a combination of the two 8-bit values used to initialize the bus timing registers BTR0 and BTR1 of the SJA1000 CAN controller, when the first client connects to that net. To get a human-readable interpretation of the baud rate value, access the NetBitRateText property.

You can only retrieve the net's bit rate if the PCANClientConnection object is connected to a PCAN net.

Example

The following example retrieves the bit rate of a connected net:

VBS Macro

Sub NetBaudRateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, baud

Set ClientConn = Connections(1).CommunicationObject

baud = ClientConn.NetBaudRate

' Access the baud rate here

' ...

End If

End Sub

See also

NetBitRate Property

HardwareBaudRate Property

HardwareBitRate Property


NetBitRate Property

Applies to: PCANClientConnection object

Returns a PCANBitrate object that describes the bit rate that was defined for a connected PCAN net.

Syntax

object.NetBitRate

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A PCANBitrate object.

Example

The following example retrieves the bit rate of a connected net:

VBS Macro

Sub NetBitRateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.NetBitRate

' Access the PCANBitrate object here

MsgBox "Bit rate of Net = " & bitrate.AsString

End If

End Sub

See also

NetBitRateText Property

NetBaudRate Property

HardwareBitRate Property


NetBitRateText Property

Applies to: PCANClientConnection object

Returns the bit rate that was defined for the connected PCAN net, as a text.

Syntax

object.NetBitRateText

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A String that indicates the bit rate that is defined for the connected PCAN net.

You can only retrieve a net's bit rate if the PCANClientConnection object is connected to a PCAN net.

The NetBitRateText property returns the same string as the NetBitRate.AsString property.

Example

The following example retrieves the bit rate of a connected net:

VBS Macro

Sub NetBitRateTextExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn

Set ClientConn = Connections(1).CommunicationObject

MsgBox "Bit rate of Net = " & ClientConn.NetBitRateText

End If

End Sub

See also

NetBitRate Property

HardwareBitRateText Property


NetHandle Property

Applies to: PCANClientConnection object

Returns the handle of the connected PCAN net.

Syntax

object.NetHandle

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Property value

A Long value that specifies the handle of the connected PCAN net.

If the PCANClientConnection object is not connected to a PCAN net, the NetHandle property returns the value 0.

Example

The following example retrieves the handle of a net:

VBS Macro

Sub NetHandleExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn

Set ClientConn = Connections(1).CommunicationObject

MsgBox "Net handle = " & ClientConn.NetHandle

End If

End Sub


NetName Property

Applies to: J1939Node object, PCANClient object

Sets or returns the name of the PCAN net, with which a PCAN client or J1939 node is connected.

Syntax

object.NetName [=value]

Parameters

object

An expression that evaluates to a J1939Node object or a PCANClient object.

value

A String that specifies the new value of the property.

Property value

A String value that specifies the name of a PCAN net.

Example

The following example retrieves the net name of the first connection in the project:

VBS Macro

Sub NetNameExample()

If Connections.Count = 0 Then Exit Sub

Dim conn

Set conn = Connections(1)

Select Case conn.Protocol

Case peProtocolCAN

' Access the PCANClientConnection object

Dim ClientConn

Set ClientConn = conn.CommunicationObject

MsgBox "Net Name: " & ClientConn.NetName

Case peProtocolJ1939

' Access the J1939Node object

Dim node

Set node = conn.CommunicationObject

MsgBox "Net Name: " & node.NetName

End Select

End Sub


_NewEnum Property

Applies to: AddIns collection, Connections collection, Documents collection, Enums collection, J1939Filter object, MessageFilters collection,Multiplexers collection, PCANClientConnections collection, PCANMessages collection, Signals collection, Symbols collection, ReceiveMessages collection, TraceMessages collection, Tracer collection, TransmitMessages collection, VBSMacroFiles collection, Windows collection

References objects in a collection.

Syntax

object._NewEnum

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Remarks

With Visual C++ or Delphi, you can browse a collection to find a particular item by using the _NewEnum property or the Item method. In Visual Basic, you do not need to use the _NewEnum property, because it is automatically used in the implementation of For Each ... Next.

Example

The following example is a Visual C++ code snippet you can insert into an Add-in's command handler method using the ActiveX Template Library. This example uses the _NewEnum property to iterate through all open windows and display their captions in a message box.

Tip: You can iterate through these windows more efficiently by using the Item method of the Windows object.

Visual C++

CComPtr<IDispatch> pDisp;

CComQIPtr<IPEWindows, &IID_IPEWindows> pWindows;

m_pApplication->Get_Windows(&pDisp);

pWindows = pDisp;

pDisp = NULL;

CComPtr<IUnknown> pUnk;

CComQIPtr<IEnumVARIANT, &IID_IEnumVARIANT> pNewEnum;

if (SUCCEEDED(pWindows->Get__NewEnum(&pUnk)) && pUnk != NULL)

{

pNewEnum = pUnk;

VARIANT varWindow;

CString strCaptions;

CComQIPtr<IPEWindow, &IID_IPEWindow> pWindow;

while (pNewEnum->Next(1, &varWindow, NULL) == S_OK)

{

ASSERT (varWindow.vt == VT_DISPATCH);

pWindow = varWindow.pdispVal;

VariantClear(&varWindow);

CComBSTR bstrCaption;

pWindow->Get_Caption(&bstrCaption);

strCaptions += bstrCaption.m_str;

strCaptions += "\n";

}

MessageBox(NULL, (LPSTR)(LPCTSTR) strCaptions,

"Open Windows", MB_OK | MB_ICONINFORMATION | MB_TOPMOST);

}


Next Property

Applies to: Window object

Returns the next window in the tab sequence.

Syntax

object.Next

Parameters

object

An expression that evaluates to a Window object.

Property value

A Window object.

See also

Previous Property


NominalBitrate Property

Applies to: PCANBitrate object

Returns the nominal (arbitration) bit rate of a CAN or CAN FD bit rate.

Syntax

object.NominalBitrate

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A Double value that indicates the nominal bit rate in bits per second.

Example

The following example displays the bit rate of the hardware currently used by the first connection in the project:

VBS Macro

Sub NominalBitrateExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

MsgBox "Bit rate: Nominal=" & bitrate.NominalBitrate & _

", Data=" & bitrate.DataBitrate

End If

End Sub

See also

DataBitrate Property


NotificationOnAddressClaiming Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object triggers OnAddressClaiming events during an address claiming process.

Syntax

object.NotificationOnAddressClaiming [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939Node object triggers OnAddressClaiming events during an address claiming process or not. If True, events are triggered. If False (the default), events are not triggered.

Remarks

If activated, OnAddressClaiming events are triggered when the value of the AddressClaimStatus property has changed.


NotificationOnAddressLost Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object triggers OnAddressLost events.

Syntax

object.NotificationOnAddressLost [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939Node object triggers OnAddressLost events. If True, events are triggered. If False (the default), events are not triggered.

Remarks

If activated, an OnAddressLost event is triggered when J1939 node lost its claimed address because another J1939 ECU on the bus with a lower NAME value claimed the same address.


NotificationOnMessageReceived Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object triggers OnMessageReceived events.

Syntax

object.NotificationOnMessageReceived [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939Node object triggers OnMessageReceived. If True, events are triggered. If False (the default), events are not triggered.

Remarks

If activated, OnMessageReceived events are triggered when a message has been put into the receive queue of the J1939Node object.


NotificationOnPropertyChange Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object triggers OnPropertyValueChanged events.

Syntax

object.NotificationOnPropertyChange [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939Node object triggers OnPropertyValueChanged events. If True, events are triggered. If False (the default), events are not triggered.

Remarks

If activated, OnPropertyValueChanged events are triggered whenever any property of a J1939Node object has changed.


Object Property

Applies to: Document object, TextDocument object, Window object

Returns an interface or object that can be accessed by name at run time.

Syntax

object.Object

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

An extensibility tool object represented by the window or document.

Example

The following example shows the number of panes in the output window:

VBS Macro

Sub ObjectExample()

Dim win

Set win = Windows(peWindowKindOutput)

Dim OW

Set OW = win.Object

MsgBox "Number of panes: " & OW.OutputWindowPanes.Count

End Sub

See also

ObjectKind Property


ObjectKind Property

Applies to: Window object

Returns the type of the Window.Object object, which is a GUID string representing the tool contained in the window.

Syntax

object.ObjectKind

Parameters

object

An expression that evaluates to a Window object.

Property value

A String value that represents the type of the Window.Object object.

The GUID can be used as index of the Item method of the Window object.

Example

The following example displays the caption and the ObjectKind for every window in the Windows collection:

VBS Macro

Sub ObjectKindExample()

Dim win

Dim str

For Each win In Windows

str = str & win.Caption

str = str & " ObjectKind: " & win.ObjectKind & vbCrLf

MsgBox str

End Sub


Offset Property

Applies to: Variable object

Returns the offset that was defined for the for the variable to transform its value from a raw value into a physical value.

Syntax

object.Offset

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Double value representing the offset that was defined for the variable to transform its value from a raw value into a physical value.

Example

The following example retrieves the offset value of a variable:

VBScript

Dim offset

offset = myVar.Offset

See also

Factor Property


Originator Property

Applies to: J1939Msg object, J1939RcvMsg object

Sets or returns the source address of the originator of the message.

Syntax

object.Originator [=value]

Parameters

object

An expression that evaluates to a J1939Msg object or a J1939RcvMsg object.

value

A Byte that sets the new value of the property.

Property value

A Byte value that specifies the source address of the originator of the message.

Remarks

The Originator property of the J1939RcvMsg object is read-only.


OutputFormat Property

Applies to: Variable object

Returns the output format of a Variable.

Syntax

object.OutputFormat

Parameters

object

An expression that evaluates to a Variable object.

Property value

A PeOutputFormat enum value. The following values are possible:

  • peOutputDec: The value is displayed decimally.

  • peOutputHex: The value is displayed hexadecimally.

  • peOutputBin: The value is displayed binary.

Example

The following example displays the output format of the Variable "Speed":

VBS Macro

Sub OutputFormatExample()

' Open and apply the Symbols file "Sample.sym"

' before running this macro

Dim symbols, v

Set symbols = SymbolsManager("Sample")

Set v = symbols("RcvSymbol").DefaultMultiplexer.Variables("Speed")

Select Case v.OutputFormat

Case peOutputDec

MsgBox "Decimal display"

Case peOutputHex

MsgBox "Hexadecimal display"

Case peOutputBin

MsgBox "Binary display"

End Select

End Sub


OutputWindowPanes Property

Applies to: OutputWindow object

Returns the OutputWindowPanes collection for the object.

Syntax

object.OutputWindowPanes

Parameters

object

An expression that evaluates to an OutputWindow object.

Property value

An OutputWindowPanes collection.

Example

The following example adds a new pane to the Output window and displays a line of text:

VBS Macro

Sub OutputWindowPanesExample()

' Fetch a handle for the output window tool

Dim win

Set win = Windows(peWindowKindOutput)

' Handles for the output window itself and its tabs

Dim OW

Set OW = win.Object

' Create a new tab

Dim OWp

Set OWp = OW.OutputWindowPanes.Add("New page")

' Add a line of text to the new page

OWp.OutputString("Some text")

End Sub


Overtype Property

Applies to: TextEditor object

Sets or returns whether the editor is in Overtype mode.

Syntax

object.Overtype [=boolean]

Parameters

object

An expression that evaluates to a TextEditor object.

boolean

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the editor is in Overtype mode. If True, the editor is in Overtype mode. If False, the editor is in Insert mode.

Remarks

By default, the editor is in Insert mode.

Example

The following example changes the editor mode from Insert to Overtype:

VBScript

TextEditor.Overtype = True


PacksCount Property

Applies to: J1939Msg object, J1939RcvMsg object

Returns the number of packages in which the data of this message is distributed.

Syntax

object.PacksCount

Parameters

object

An expression that evaluates to a J1939Msg object or a J1939RcvMsg object.

Property value

A Long value that indicates the number of packages in which the data of this message is distributed.

See also

PacksCountOnReadSessions Property

PacksCountOnWriteSessions Property


PacksCountOnReadSessions Property

Applies to: J1939Node object

Sets or returns the maximum number of large message data packets cleared to send in a TPCM.CTS message.

Syntax

object.PacksCountOnReadSessions [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that specifies the maximum number of large message data packets cleared to send.

Remarks

The actual number of packets cleared to send in a TPCM.CTS message will never be larger than the requested number or packets from a received TPCM.RTS message.

See also

ReCTSsCountOnReadSessions Property


PacksCountOnWriteSessions Property

Applies to: J1939Node object

Sets or returns a value that limits the number of requested packets that can be sent by the originator in response to one CTS.

Syntax

object.PacksCountOnWriteSessions [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that limits the number of requested packets that can be sent by the originator in response to one CTS.

Remarks

If the responder complies with the limit, the responder ensures that the originator can re-transmit packets that the responder has not received correctly for whatever reason.

See also

RetriesCountOnWriteSessions Property


ParameterString Property

Applies to: PCANBitrate object

Returns a string with the individual parameters of the bit rate.

Syntax

object.ParameterString

Parameters

object

An expression that evaluates to a PCANBitrate object.

Property value

A String value with the comma-separated individual bit rate parameters in the form parameter1=value, parameter2=value, ...

For example: "f_clock=80000000, nom_brp=10, nom_tseg1=5, nom_tseg2=2, nom_sjw=2, data_brp=4, data_tseg1=7, data_tseg2=2, data_sjw=1".

Remarks

Depending on whether the bit rate represents a CAN or a CAN FD bit rate, the returned string only contains the parameters that are necessary to represent the individual bit rate.

Example

The following example displays the parameter string of the hardware bit rate currently used by the first connection in the project:

VBS Macro

Sub ClockExample()

' The first connection in the project must

' be a CAN connection

If Connections(1).Protocol = peProtocolCAN Then

Dim ClientConn, bitrate

Set ClientConn = Connections(1).CommunicationObject

Set bitrate = ClientConn.HardwareBitRate

MsgBox "Parameters of bit rate = " & bitrate.ParameterString

End If

End Sub


Parent Property

Applies to: AddIns collection, Connections collection, Documents collection, Enums collection, J1939Filters collection, MessageFilters collection,Multiplexer object, Multiplexers collection, OutputWindow object, OutputWindowPanes collection, PCANBitrate object, PCANClientConnections collection, PCANMessages collection, Project object, ReceiveMessages collection, ReceiveTransmitWindow object, Signals collection, Symbols collection, TextEditor object, TextSelection object, TextWindow object, TraceMessages collection, Tracer object, TraceWindow object, TransmitMessages collection, TransmitWindow object, Variable object, Variables collection, VBSMacroFiles collection, Windows collection

Returns the immediate parent object of a given object.

Syntax

object.Parent

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

Returns the immediate parent to the object or collection. If you want to get the containing collection, then use the Collection property.

The Parent property's type depends on the object you access the property from (see the table below). For example, the Parent property of the TextSelection object has the TextDocument type.

The following table shows the parent of each object:

Object | Parent Object
AddIns | Application
Connections | Application
Documents | Application
Enums | SymbolsManager
J1939Filters | J1939Node
MessageFilters | Application
Multiplexer | Symbol
Multiplexers | Symbol
OutputWindow | Application
OutputWindowPanes | OutputWindow
PCANBitrate | PCANClientConnection
PCANClientConnection | PCANClient
PCANMessages | PCANClient
Project | Application
ReceiveMessages | Connection
ReceiveTransmitWindow | Application
Signals | Application
Symbols | SymbolsManager
SymbolsManager | Application
TextEditor | Application
TextSelection | TextDocument
TextWindow | TextDocument
Tracer | Application
TraceMessages | Application
TraceWindow | Document
TransmitMessages | Connection or Document
Variable | Multiplexer
Variables | Multiplexer
VBSMacroFiles | Application
Windows | Application
Example
VBScript

Sub ParentExample()

Dim WWin

Set WWin = Windows(peWindowKindWatch)

Dim watch

Set watch = WWin.Object

Dim win

Set win = watch.Parent

MsgBox "ObjectKind of the window: " & win.ObjectKind

End Sub


Path Property

Applies to: Application object, Document object, Project object, TextDocument object

Returns the path to an object.

Syntax

object.Path

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that indicates the path to an object. The path never ends with a backslash ("\") unless the path has the format "C:\".

The Path property does not return the file name and the file name extension of an object. To get the file name and extension, use the Name property or FullName property.

The following table summarizes the results that are obtained when using the Path property of the objects mentioned above:

Object | Results
Application | Returns the path of the PCAN-Explorer program, e.g. "C:\Program Files\PCAN-Explorer 5".
Document TextDocument | Returns the path of the file, that contains the document, e.g. "C:\Users\<User Name>\Documents\PCAN-Explorer\Symbols".
Project | The path of the current project, e.g. "C:\Users\<User Name>\Documents\PCAN-Explorer\Projects\My Project".
Example

The following example retrieves the path of the active document:

VBScript

Sub PathExample()

Dim PathString

PathString = ActiveDocument.Path

' Access PathString here

End Sub


PGN Property

Applies to: J1939Filter object, J1939Msg object, J1939RcvMsg object, MessageFilterItem object, ReceiveEvent object, ReceiveMessage object, Symbol object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns a J1939 Parameter Group Number.

Syntax

object.PGN [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long that specifies the new value of the property.

Property value

A Long value that specifies a Parameter Group Number.

Remarks

The PGN properties of the J1939Filter, J1939RcvMsg, ReceiveEvent, Symbol, and TransmitEvent objects are read-only.

For the J1939Filter object, the PGN property returns the PGN attribute of the filter. If the Flags property includes the tfmPGN flag, all J1939 messages having the specified PGN can pass the filter.

For the MessageFilterItem object, the J1939PGN property only has an effect if the Type property is set to peFilterItemJ1939 and the J1939FilterFlags property includes the peJ1939PGN flag.


PGNsToRejectOnRTS Property

Applies to: J1939Node object

Sets or returns a set of PGNs that are rejected by sending TPCM.ConnAbort when a TPCM.RTS message is received for one of them.

Syntax

object.PGNsToRejectOnRTS [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A String that specifies the new comma-separated set of PGNs to be rejected.

Property value

A String that specifies the comma-separated set of PGNs. For example: "64489, 0xFD78, 7000h, 30000-31000, 0x2000-0x2100".


PlaybackPosition Property

Applies to: Tracer object

Returns the current playback position of a tracer.

Syntax

object.PlaybackPosition

Parameters

object

An expression that evaluates to a Tracer object.

Property value

A Long value that indicates the current playback position, which is an index in the range 0 to EntryCount-1.

See also

EntryCount Property


PlaybackRepeat Property

Applies to: Tracer object

Determines whether trace playback restarts from the beginning when the end of the trace buffer or file is reached.

Syntax

object.PlaybackRepeat [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A Boolean that sets the new value of the property.

Property value

A Boolean value that determines whether trace playback restarts from the beginning when the end of the trace buffer or file is reached.

Example

The following example configures the active tracer for repeated playback.

VBS Macro

Sub PlaybackRepeatExample()

Dim tracer

If ActiveWindow.Kind = peDocumentKindTrace Then

Set tracer = ActiveWindow.Object.Tracer

tracer.PlaybackRepeat = True

tracer.Play

End If

End Sub

See also

PlaybackRepeatCount Property

PlaybackRepeatPause Property


PlaybackRepeatCount Property

Applies to: Tracer object

During playback, determines the number of playback cycles before playback is stopped.

Syntax

object.PlaybackRepeatCount [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A Long that sets the new value of the property.

Property value

A Long value that determines the number of playback cycles before playback is stopped. The value 0 means playback is repeated endlessly, as long as the PlaybackRepeat property has the value True.

See also

PlaybackRepeat Property

PlaybackRepeatPause Property


PlaybackRepeatPause Property

Applies to: Tracer object

Determines the time delay before playback of a trace buffer or file is repeated.

Syntax

object.PlaybackRepeatPause [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A Long that sets the new value of the property.

Property value

A Long value that determines the time delay before playback is repeated when the end of the trace buffer or file is reached during playback. The time delay is specified in milliseconds.

See also

PlaybackRepeat Property

PlaybackRepeatCount Property


PostLoadCommand Property

Applies to: Project object

Sets or returns the name of a command that is executed after a project is loaded.

Syntax

object.PostLoadCommand [=command]

Parameters

object

An expression that evaluates to one a Project object.

command

A String that sets the new value of the property.

Property value

A String value that specifies the name of a PCAN-Explorer command that is executed after a project is loaded.


PreferredAddress Property

Applies to: J1939Node object

Sets or returns the address that the J1939Node object tries to claim when the ClaimAddress method is called.

Syntax

object.PreferredAddress [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that represents the address (0-253) that the node tries to claim when the ClaimAddress method is called. Null address and Global address cannot be claimed by devices.

See also

ClaimAddress Method

ClaimedAddress Property

ReleaseAddress Method

UseAddressingProtocol Property


Previous Property

Applies to: Window object

Returns the previous window in the tab sequence.

Syntax

object.Previous

Parameters

object

An expression that evaluates to a Window object.

Property value

A Window object.

See also

Next Property


Priority Property

Applies to: J1939Filter object, J1939Msg object, J1939RcvMsg object, MessageFilterItem object, ReceiveEvent object, ReceiveMessage object, Symbol object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns a J1939 Priority.

Syntax

object.Priority [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that specifies a Priority (0-7).

Remarks

The Priority properties of the J1939Filter, J1939RcvMsg, ReceiveEvent, Symbol, and TransmitEvent objects are read-only.

For the J1939Filter object, the Priority property returns the Priority attribute of the filter. If the Flags property includes the tfmPriority flag, all J1939 messages having the specified Priority can pass the filter.

For the MessageFilterItem object, the J1939Priority property only has an effect if the Type property is set to peFilterItemJ1939 and the J1939FilterFlags property includes the peJ1939Priority flag.


ProgID Property

Applies to: AddIn object

Returns the ProgID based on the Add-in's registry entry.

Syntax

object.ProgID

Parameters

object

An expression that evaluates to a AddIn object.

Return value

The ProgID property returns a String representing the ProgID of the Add-in.

Example

The following example lists all registered Add-ins and their ProgIDs:

VBS Macro

Sub IsSavedExample()

Dim objAddIn, strMsg

For Each objAddIn In AddIns

strMsg = strMsg & objAddIn.Name & " " & _

objAdd.ProgID & vbCrLf

Next

MsgBox strMsg

End Sub


Project Property

Applies to: ProjectItem object, ProjectItems collection

Returns the Project object in which the object or collection is included.

Syntax

object.Project

Parameters

object

An expression that evaluates to a ProjectItem object or a ProjectItems collection.

Property value

A Project object.


ProjectItems Property

Applies to: Project object, ProjectItem object

Returns a ProjectItems collection for the object.

Syntax

object.ProjectItems

Parameters

object

An expression that evaluates to a ProjectItem object.

Property value

A ProjectItems collection containing project items that may be hierarchically below the project or project item.

Example

The following example lists all files of the current project in the Output window, on the Macro tab:

VBS Macro

Sub ProjectItemsExample()

OutputItems ActiveProject.ProjectItems, ""

End Sub

Sub OutputItems(items, indent)

Dim i, item

For i = 1 To items.Count

Set item = items(i)

If item.Kind = peProjectItemKindFile Then _

PrintToOutputWindow indent & item.Object.RelativePath

If Not (item.ProjectItems Is Nothing) Then

' This item contains child items

OutputItems item.ProjectItems, indent & " "

End If

Next

End Sub


Protocol Property

Applies to: Connection object

Sets or returns the protocol that the connection uses.

Syntax

object.Protocol [=value]

Parameters

object

An expression that evaluates to a Connection object.

value

A PeProtocol enum value that sets the new value of the property.

Property value

A PeProtocol enum value that specifies the protocol that the connection uses to communicate on the CAN bus.

  • peProtocolCAN (0): Raw CAN, no higher protocol is used.

  • peProtocolJ1939 (1): The J1939 protocol.


Properties Q-T

The following table contains all properties beginning with letters Q to T:

Property | Description
QualifiedName | Returns a variable's qualified name.
RcvEventHandle | Sets or returns an event handle that the object uses to notify waiting threads on a received message.
RcvNet | Returns the handle of the PCAN net from which the CAN message has been received.
ReassembleIncomingPackets | Sets or returns whether incoming large message packets are assembled to complete messages.
ReceiveMessages | Returns a ReceiveMessages collection.
Receiving | Sets or returns whether a J1939Node object receives messages.
ReCTSsCountOnReadSessions | Sets or returns the maximum number of Re-CTS during a read session.
RegistryRoot | Returns a string with the path to the root of the PCAN-Explorer registry settings.
ResetOnBusOff | Sets or returns whether the object automatically resets the CAN controller when a bus-off state is detected.
Responder | Sets or returns the destination address of the message.
RetriesCountOnWriteSessions | Sets or returns the maximum number of RTS-retries during a write session.
RTREnabled | Sets or returns whether RTR Frames can pass through a MessageFilterItem object if the filter item operates in Options mode.
RunningMax | Returns the highest value a Signal has reached.
RunningMaxTime | Returns the time at which a Signal reached its highest value.
RunningMean | Returns the arithmetic mean of a Signal's value.
RunningMin | Returns the lowest value a Signal has reached.
RunningMinTime | Returns the time at which a Signal reached its lowest value.
Selection | Returns the TextSelection object, which represents the selected text.
SelfReceive | Sets or returns whether PCAN-Explorer receives CAN messages transmitted by itself.
ShortName | Returns the short name of a signal, in contrast to the fully qualified name.
ShowAbsoluteTime | Sets or returns whether a tracer shows absolute or relative timestamps.
ShowDLC | Determines whether the data length in a trace window is displayed as a Data Length Code or as the number of data bytes.
Signal | Returns the Signal object that is associated with a variable.
Signals | Returns the Signals collection.
Source | Returns the object that servers as data source of a Signal object.
SourceAddress | Sets or returns a J1939 Source Address.
SourceKind | Returns the type of the Signal.Source object, which is a GUID string representing the object.
SplitState | Sets or returns the visual splitting of the Receive/Transmit window.
SPN | Returns a J1939 Suspect Parameter Number.
StartTime | Returns the start time of a tracer.
StatisticsEnabled | Activates or deactivates the calculation of statistical data for a Signal.
StringValue | Sets or returns a signal's value as string.
Symbol | Returns the Symbol object that is associated with a CAN message.
SymbolName | Returns the name of the symbol associated with the CAN message for which a Callback Library event was triggered.
Symbols | Returns the Symbols object.
SymbolsFileName | Sets or returns the name of a Symbols file that is associated with the connection.
SymbolsManager | Returns the SymbolsManager collection.
TabSize | Sets or returns the number of columns in a tab character.
Text | Sets or returns the text in a selection.
TextEditor | Returns the TextEditor object.
TimeFormat | Sets or returns a string that defines how absolute timestamps are displayed in the various windows of PCAN-Explorer.
Timeout | Returns the timeout time value that was defined for a Multiplexer.
Timestamp | Returns the timestamp of a message.
TimestampAbs | Returns the absolute timestamp of a CAN message.
TimestampAbsString | Returns the absolute timestamp of a CAN message as text.
TimestampFormat | Sets or returns the format that is used to display timestamps in a trace window.
TimingErrorCount | Returns the number of timing errors that have occurred for a received CAN message.
Title | Returns the title that was defined for a Symbols file with a global Title parameter.
Top | Sets or returns the y-coordinate of a window's upper edge.
Tracer | Returns the Tracer object contained in a trace window.
TraceState | Returns the current operating state of the tracer.
TransmitMessages | Returns a TransmitMessages collection.
Type [Variation 1] | Returns a string describing the type of the document or window.
Type [Variation 2] | Returns the type of a symbol.
Type [Variation 3] | Returns the type of a Message Filter item.

See also

Properties A-F

Properties G-K

Properties L-P

Properties U-Z


QualifiedName Property

Applies to: Variable object

Returns a variable's qualified name.

Syntax

object.QualifiedName

Parameters

object

An expression that evaluates to a Variable object.

Property value

A String value that represents a fully qualified variable name in the form SymbolName.MultiplexerName.VariableName.

If no multiplexer is defined for the parent symbol, the qualified name is returned in the form SymbolName.VariableName.

Example

The following example retrieves the qualified name of a variable:

VBS Macro

Sub QualifiedNameExample()

Dim sig, v

Set sig = Signals("Speed")

' The source of this signal is a variable

Set v = sig.Source

MsgBox v.QualifiedName,,"Qualified Name"

End Sub

See also

Multiplexer Object

Variable Object


RcvEventHandle Property

Applies to: J1939Node object, PCANClient object

Sets or returns an event handle that the object uses to notify waiting threads on a received message.

Syntax

object.RcvEventHandle [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Long that specifies the new value of the property.

Property value

A Long value that specifies the event handle that the object uses to notify waiting threads on a received message.


RcvNet Property

Applies to: PCANMessage object, ReceiveEvent object, ReceiveMessage object

Returns the handle of the PCAN net from which the CAN message has been received.

Syntax

object.RcvNet

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value that represents the handle of a PCAN net.

Example

The following example accesses the RcvNet property of a PCANMessage object:

VBScript

If myMessage.Read Then

h = myMessage.RcvNet

...

End If


ReassembleIncomingPackets Property

Applies to: J1939Node object

Sets or returns whether incoming large message packets are assembled to complete messages.

Syntax

object.ReassembleIncomingPackets [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939 node object performs the task of assembling complete messages from received packets.


ReceiveMessages Property

Applies to: Application object, Connections collection, ReceiveTransmitWindow object

Returns a ReceiveMessages collection.

Syntax

object.ReceiveMessages

Parameters

object

An expression that evaluates to the Application object, a Connections collection, or a ReceiveTransmitWindow object.

Property value

A ReceiveMessages collection, which represents a collection of CAN messages. Each CAN message in the collection is represented by a ReceiveMessage object.

Example

The following example accesses the ReceiveMessages collection and counts all received messages:

VBS Macro

Sub ReceiveMessagesExample()

Dim msg, cnt

cnt = 0

For Each msg In ReceiveMessages

cnt = cnt + msg.EventCount

Next

MsgBox "Number of received messages: " & cnt

End Sub


Receiving Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object receives messages.

Syntax

object.Receiving [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the object receives messages or not. If True (the default), the object receives messages. If False, the object does not receive messages.

Remarks

The Receiving property can be used to disable receiving of messages temporarily without changing the filter settings.


ReCTSsCountOnReadSessions Property

Applies to: J1939Node object

Sets or returns the maximum number of Re-CTS during a read session.

Syntax

object.ReCTSsCountOnReadSessions [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that specifies the maximum number of Re-CTS during a read session.

Remarks

After the responder has transmitted a CTS, and no data packet (TPDT) is received from the originator within a timeout of 1250 ms, the responder sends again a CTS. When the number of these re-sent CTS reaches the number of specified Re-CTS, the responder aborts the session when the next timeout occurs by sending a TPCM.ConnAbort.

See also

PacksCountOnReadSessions Property


RegistryRoot Property

Applies to: Application object

Returns a string with the path to the root of the PCAN-Explorer registry settings.

Syntax

object.RegistryRoot

Parameters

object

An expression that evaluates to an Application object.

Property value

A String value representing a registry path.

Typically, the registry root of PCAN-Explorer 5 is HKCU\Software\PEAK-System\PCAN-Explorer\5.0\

Example

The following example displays the registry path for the PCAN-Explorer in a message box:

VBS Macro

MsgBox RegistryRoot


ResetOnBusOff Property

Applies to: J1939Node object

Sets or returns whether the object automatically resets the CAN controller when a bus-off state is detected.

Syntax

object.ResetOnBusOff [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the object automatically resets the CAN controller when a bus-off state is detected. If True, the object automatically resets the CAN controller. If False (the default), the object does not automatically reset the CAN controller.

Remarks

Since no communication is possible in a bus-off state, it is useful to let the node catch this event automatically and reset the CAN controller, to avoid extra handling of this problem by a macro or application.


Responder Property

Applies to: J1939Msg object, J1939RcvMsg object

Sets or returns the destination address of the message.

Syntax

object.Responder [=value]

Parameters

object

An expression that evaluates to a J1939Msg object or a J1939RcvMsg object.

value

A Byte that sets the new value of the property.

Property value

A Byte value that specifies the destination address of the message.

Remarks

The Responder property of the J1939RcvMsg object is read-only.

The Responder property ins only relevant for PDU1 messages, or for PDU2 messages that have more than 8 data bytes, which are transmitted using the transport protocol.


RetriesCountOnWriteSessions Property

Applies to: J1939Node object

Sets or returns the maximum number of RTS-retries during a write session.

Syntax

object.RetriesCountOnWriteSessions [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that specifies the maximum number of RTS-retries during a write session.

Remarks

After the originator has transmitted the number of data packets that were cleared to send by the last received CTS, the originator sends again an RTS to request the next data transfer. If the responder does not answer with a CTS within a timeout of 1250 ms, the originator issues again an RTS. When the number of these re-sent RTR reaches the number of specified Retries, the originator aborts the session when the next timeout occurs by sending a TPCM.ConnAbort.

See also

PacksCountOnWriteSessions Property


RTREnabled Property

Applies to: MessageFilterItem object

Sets or returns whether RTR Frames can pass through the MessageFilterItem object if the filter item operates in Options mode.

Syntax

object.RTREnabled [=value]

Parameters

object

An expression that evaluates to a MessageFilterItem object.

value

A Boolean value that specifies the new value of the property.

Property value

A Boolean value that specifies whether RTR Frames (Remote Transmission Requests) can pass through the filter item. If True, RTR Frames can pass through the filter item. If False, RTR Frames are blocked by the filter item (the default).

Remarks

The RTREnabled property only has an effect, if the Type property of the MessageFilterItem object is set to peFilterItemOptions.

See also

ErrorFramesEnabled Property

ErrorWarningsEnabled Property

Type Property


RunningMax Property

Applies to: Signal object

Returns the highest value the Signal has reached.

Syntax

object.RunningMax

Parameters

object

An expression that evaluates to a Signal object.

Property value

A Double value that indicates the highest value the Signal has reached.

The RunningMax property of a Signal that has the data type peDataTypeString always returns 0.

Remarks

A Signal stores its maximum value only if the StatisticsEnabled property is set to True.

Example

The following example displays the highest value of the signal "Speed":

VBS Macro

Sub RunningMaxExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Speed.RunningMax = " & sig.RunningMax

End Sub

See also

RunningMaxTime Property

RunningMean Property

RunningMin Property

RunningMinTime Property

StatisticsEnabled Property


RunningMaxTime Property

Applies to: Signal object

Returns the time at which the Signal reached its highest value.

Syntax

object.RunningMaxTime

Parameters

object

An expression that evaluates to a Signal object.

Property value

A DATE value that indicates the time at which the Signal reached its highest value, which is stored in the RunningMax property.

The RunningMaxTime property of a Signal that has the data type peDataTypeString always returns 0.

Remarks

A Signal stores the time of its highest value only if the StatisticsEnabled property is set to True.

Example

The following example displays the time at which the signal "Speed" reached its highest value:

VBS Macro

Sub RunningMaxTimeExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Speed.RunningMaxTime = " & sig.RunningMaxTime

End Sub

See also

RunningMax Property

RunningMean Property

RunningMin Property

RunningMinTime Property

StatisticsEnabled Property


RunningMean Property

Applies to: Signal object

Returns the arithmetic mean of the Signal's value.

Syntax

object.RunningMean

Parameters

object

An expression that evaluates to a Signal object.

Property value

A Double value that indicates the arithmetic mean of the Signal's value.

The RunningMean property of a Signal that has the data type peDataTypeString always returns 0.

Remarks

A Signal calculates its arithmetic mean only if the StatisticsEnabled property is set to True.

Example

The following example displays the arithmetic mean of the signal "Speed":

VBS Macro

Sub RunningMeanExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Speed.RunningMean = " & sig.RunningMean

End Sub

See also

RunningMax Property

RunningMaxTime Property

RunningMin Property

RunningMinTime Property

StatisticsEnabled Property


RunningMin Property

Applies to: Signal object

Returns the lowest value the Signal has reached.

Syntax

object.RunningMin

Parameters

object

An expression that evaluates to a Signal object.

Property value

A Double value that indicates the lowest value the Signal has reached.

The RunningMin property of a Signal that has the data type peDataTypeString always returns 0.

Remarks

A Signal stores its lowest value only if the StatisticsEnabled property is set to True.

Example

The following example displays the lowest value of the signal "Speed":

VBS Macro

Sub RunningMinExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Speed.RunningMin = " & sig.RunningMin

End Sub

See also

RunningMax Property

RunningMaxTime Property

RunningMean Property

RunningMinTime Property

StatisticsEnabled Property


RunningMinTime Property

Applies to: Signal object

Returns the time at which the Signal reached its lowest value.

Syntax

object.RunningMinTime

Parameters

object

An expression that evaluates to a Signal object.

Property value

A DATE value that indicates the time at which the Signal reached its lowest value, which is stored in the RunningMin property.

The RunningMinTime property of a Signals that has the data type peDataTypeString always returns 0.

Remarks

A Signal stores the time of its lowest value only if the StatisticsEnabled property is set to True.

Example

The following example displays the time at which the signal "Speed" reached its lowest value:

VBS Macro

Sub RunningMinTimeExample()

Dim sig

Set sig = Signals("RcvSymbol.Mux1.Speed")

MsgBox "Speed.RunningMinTime = " & sig.RunningMinTime

End Sub

See also

RunningMax Property

RunningMaxTime Property

RunningMean Property

RunningMin Property

StatisticsEnabled Property


Selection Property

Applies to: TextDocument object, TextWindow object

Returns the TextSelection object, which represents the selected text.

Syntax

object.Selection

Parameters

object

An expression that evaluates to a TextDocument object or a TextWindow object.

Property value

A TextSelection object.

For the TextDocument object, the Selection property gets the object representing the text selected in a document's active window.

For the TextWindow object, the Selection property gets the object representing the text selected in the text window.

Example

The following example deletes the selected text in a text document:

VBS Macro

Sub SelectionExample()

   If ActiveDocument.Kind = peDocumentKindText Then

      ActiveDocument.Selection.Delete

   End If

End Sub


SelfReceive Property

Applies to: PCANClient object

Sets or returns whether a PCAN client receives CAN messages transmitted by itself.

Syntax

object.SelfReceive [=boolean]

Parameters

object

An expression that evaluates to a PCANClient object.

boolean

A Boolean that sets the new value of the property.

Property value

A Boolean value that specifies whether the PCAN client receives CAN messages transmitted by itself. If True, the PCAN client receives messages transmitted by itself. If False (the default), the PCAN client does not receive messages transmitted by itself.

Example

The following example activates the reception of self-transmitted messages for a PCAN client:

VBS Macro

Sub SelfReceiveExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

client.SelfReceive = True

Set conn = client.Connections.Add("TestNet")

If conn.IsConnected Then

' Open the filter so that the self-received

' message won't be blocked

conn.RegisterMsg &H100, &H100, False, False

Dim msg

Set msg = client.Messages.Add

msg.ID = &H100

msg.DLC = 2

msg.Data(0)= 1

msg.Data(1)= 2

msg.Write conn, 0

If msg.Read Then _

MsgBox "Self-receive Message: " & Hex(msg.ID)

End If

End Sub


ShortName Property

Applies to: Signal object

Returns the short name of a signal, in contrast to the fully qualified name.

Syntax

object.ShortName

Parameters

object

An expression that evaluates to a Signal object.

Property value

A String value that indicates the short name of the signal. If the fully qualified name of a signal is, for example, "Symbol.Multiplexer.Name", then the short name of the signal is only "Name".

Example

The following example displays the fully qualified name and the short name of the signal "Speed":

VBS Macro

Sub ShortNameExample()

Dim sig

Set sig = Signals("Speed")

MsgBox sig.Name & vbCrLf & sig.ShortName

End Sub

See also

Name Property


ShowAbsoluteTime Property

Applies to: Tracer object

Sets or returns whether a tracer shows absolute or relative timestamps.

Syntax

object.ShowAbsoluteTime [=boolean]

Parameters

object

An expression that evaluates to a Tracer object.

boolean

A Boolean that sets the new value of the property.

Property value

A Boolean value that specifies whether the tracer shows absolute or relative timestamps. If True, the tracer shows absolute timestamps. If False, the tracer shows relative timestamps.

Remarks

This property is deprecated. Use the TimestampFormat property instead.

Example

The following example toggles the value of the ShowAbsoluteTime property of the tracer in the foreground:

VBS Macro

Sub ShowAbsoluteTimeExample()

   If ActiveDocument.Kind = peDocumentKindTrace Then

      Dim tracer

      Set tracer = ActiveWindow.Object.Tracer

      tracer.ShowAbsoluteTime = Not tracer.ShowAbsoluteTime

   End If

End Sub

See also

TimestampFormat Property


ShowDLC Property

Applies to: Tracer object

Determines whether the data length in a trace window is displayed as a Data Length Code or as the number of data bytes.

Syntax

object.ShowDLC [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A Boolean that sets the new value of the property.

Property value

A Boolean the data length in a trace window is displayed as a Data Length Code or as the number of data bytes. If True, the tracer shows Data Length Codes. If False, the tracer shows the number of data bytes.


Signal Property

Applies to: Variable object

Returns the Signal object that is associated with the variable.

Syntax

object.Signal

Parameters

object

An expression that evaluates to a Variable object.

Property value

A Signal object.

Example

The following example retrieves the Signal object of a Variable and displays its name:

VBS Macro

Sub SignalExample()

' Open and apply the Symbols file "Sample.sym" before

' running this macro

Dim symbols, v

Set symbols = SymbolsManager("Sample")

Set v = symbols("RcvSymbol").DefaultMultiplexer.Variables("Speed")

Dim sig

Set sig = v.Signal

MsgBox sig.Name

End Sub


Signals Property

Applies to: Application object

Returns the Signals collection.

Syntax

object.Signals

Parameters

object

An expression that evaluates to an Application object.

Property value

A Signals collection that represents the collection of all signals in PCAN-Explorer. Each signal in the collection is represented by a Signal object.

Example

The following example accesses the Signals collection:

VBScript

MsgBox Signals.Count


Source Property

Applies to: Signal object

Returns the object that servers as the Signal's data source.

Syntax

object.Source

Parameters

object

An expression that evaluates to a Signal object.

Property value

An object that serves as the Signal's data source, e.g. a Variable object. If the Signal is a virtual Signal, the Source property returns the value Nothing (C/C++: NULL).

Example

The following example shows the qualified name of the Variable that serves as the Signal's data source:

VBS Macro

Sub SourceExample()

Dim src

Set src = Signals("Speed").Source

If Not src Is Nothing Then _

MsgBox src.QualifiedName,,"Macro"

End Sub

See also

Variable Object

SourceKind Property


SourceAddress Property

Applies to: J1939Filter object, MessageFilterItem object, ReceiveEvent object, ReceiveMessage object, Symbol object, TraceMessage object, TransmitEvent object, TransmitMessage object

Sets or returns a J1939 Source Address.

Syntax

object.SourceAddress [=address]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

value

A Byte that specifies the new value of the property.

Property value

A Byte value that specifies a Source Address (0-254).

Remarks

The SourceAddress properties of the J1939Filter, ReceiveEvent, Symbol, and TransmitEvent objects are read-only.

For the J1939Filter object, the SourceAddress property returns the Source Address attribute of the filter. If the Flags property includes the tfmSource flag, all J1939 messages sent from the specified Source Address can pass the filter.

For the MessageFilterItem object, the SourceAddress property only has an effect if the Type property is set to peFilterItemJ1939 and the J1939FilterFlags property includes the peJ1939SourceAddress flag.


SourceKind Property

Applies to: Signal object

Returns the type of the Signal.Source object, which is a GUID string representing the object.

Syntax

object.SourceKind

Parameters

object

An expression that evaluates to a Signal object.

Property value

A String value that represents the kind or type of the Signal.Source object.

The SourceKind property of a virtual signal returns an empty string.

Example

The following example displays the qualified name of the Variable that serves as data source for the Signal "Speed":

VBS Macro

Sub SourceKindExample()

Dim sig

Set sig = Signals("Speed")

If sig.SourceKind = peSourceKindVariable Then _

MsgBox sig.Source.QualifiedName

End Sub

See also

Source Property


SplitState Property

Applies to: ReceiveTransmitWindow object

Sets or returns the visual splitting of the Receive/Transmit window.

Syntax

object.SplitState [=state]

Parameters

object

An expression that evaluates to a ReceiveTransmitWindow object.

state

A PeSplitState enum value that sets the new value of the property.

Property value

A PeSplitState enum value that specifies the state of the window. Possible values are:

  • peSplitStateBothVisible (1): Both the Receive and Transmit lists are visible.

  • peSplitStateRcvMaximized (2): Only the Receive list is visible.

  • peSplitStateXmtMaximized (3): Only the Transmit list is visible.

Example

The following example maximizes the Receive list in the Receive/Transmit window:

VBS Macro

Sub SplitStateExample()

Dim wnd

Set wnd = Windows(peWindowKindReceiveTransmit)

wnd.Object.SplitState = peSplitStateRcvMaximized

End Sub


SPN Property

Applies to: Signal object, Variable object

Returns a J1939 Suspect Parameter Number.

Syntax

object.SPN

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

Property value

A Long value that specifies a Suspect Parameter Number.

Remarks

Suspect Parameter Numbers are assigned to signals or variables in Symbols files by using the optional parameter /spn.


StartTime Property

Applies to: Tracer object

Returns the start time of a tracer.

Syntax

object.StartTime

Parameter

object

An expression that evaluates to a Tracer object.

Property value

A DATE value that represents the start time of the tracer.

Example

The following example displays the start time of the active tracer:

VBS Macro

Sub StartTimeExample()

Dim doc, tracer

doc = Documents.Add(peDocumentKindTrace)

Set tracer = doc.ActiveWindow.Object.Tracer

MsgBox tracer.StartTime,,"Start Time"

End Sub


StatisticsEnabled Property

Applies to: Signal object

Activates or deactivates the calculation of statistical data for a Signal.

Syntax

object.StatisticsEnabled [=value]

Parameters

object

An expression that evaluates to a Signal object.

value

A Boolean that sets the new value of the property.

Property value

A Boolean value that specifies whether the calculation of statistical data is activated for a Signal. If True, statistical data is calculated for the Signal. If False (the default), no statistical data is calculated for the Signal.

Remarks

If calculation of statistical data is activated for a Signal, the properties RunningMin, RunningMinTime, RunningMax, RunningMaxTime, and RunningMean are updated every time the Signal's value is set. If the StatisticsEnabled property is set to False, all values of these properties are reset to 0.

Example

The following example activates the calculation of statistical data for all signals:

VBS Macro

Sub StatisticsEnabledExample()

Dim sig

For Each sig In Signals

sig.StatisticsEnabled = True

Next

End Sub

See also

RunningMax Property

RunningMaxTime Property

RunningMean Property

RunningMin Property

RunningMinTime Property

StatisticsEnabled Property

Send Feedback | Copyright © 2022 PEAK-System Technik GmbH. All rights reserved.


StringValue Property

Applies to: Signal object

Sets or returns a signal's value as string.

Syntax

object.StringValue [=value]

Parameters

object

An expression that evaluates to a Signal object.

value

A String setting the signal's value.

Property value

A String value that represents the current value of a signal or variable, as a string.

Use the StringValue property to get or set the value of a signal that has either the peDataTypeString or the peDataTypeEnum data type (see DataType property).

Example

The following example displays the value of the signal "Speed":

VBS Macro

Sub StringValueExample()

Dim sig

Dim value

Set sig = Signals("StringVar")

value = sig.StringValue

MsgBox "StringValue = " & value,,"StringVar"

End Sub

See also

DataType Property

Value Property


Symbol Property

Applies to: ReceiveMessage object, TraceMessage object, TransmitMessage object

Returns the Symbol object that is associated with the CAN message.

Syntax

object.Symbol

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Symbol object.

Example

The following example displays the CAN-ID of every symbolic CAN message in the Receive list:

VBS Macro

Sub SymbolExample()

Dim msg

For Each msg In ReceiveMessages

If Not msg.Symbol Is Nothing Then

PrintToOutputWindow msg.Symbol & " -> " & Hex(msg.ID) & "h"

End If

Next

End Sub

See also

Multiplexer Property


SymbolName Property

Applies to: ReceiveEvent object, TransmitEvent object

Returns the name of the symbol associated with the CAN message for which a Callback Library event was triggered.

Syntax

object.SymbolName

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that specifies the name of a symbol.


Symbols Property

Applies to: Connection object

Returns the Symbols collection.

Syntax

object.Symbols

Parameters

object

An expression that evaluates to a Connection object.

Property value

A Symbols collection, which represents a collection of Symbol objects.

Example

The following example accesses the Symbols collection of the first connection in the project:

VBS Macro

Sub SymbolsExample()

Dim objConnection

If Connections.Count = 0 Then _

Exit Sub

Set objConnection = Connections(1)

' Access the Symbols property here

' For example:

If objConnection.Symbols Is Nothing Then

PrintToOutputWindow "No Symbols assigned"

Else

PrintToOutputWindow "Connection has " & objConnection.Symbols.Count _

& " Symbols"

End If

End Sub


SymbolsFileName Property

Applies to: Connection object

Sets or returns the name of a Symbols file that is associated with the connection.

Syntax

object.SymbolsFileName [=value]

Parameters

object

An expression that evaluates to a Connection object.

value

A String that specifies the name and path of a Symbols file. If the Symbols file is located in the same directory as the project file, the file path can be omitted. If the CANdb Add-in is loaded, the file could also be a CANdb database file (*.dbc).

Property value

A String value that specifies the file name of the assigned Symbols file. The returned file name does not include the file path.

Example

The following example accesses the SymbolsFileName property of the first connection in the project:

VBS Macro

Sub SymbolsFileNameExample()

Dim objConnection

If Connections.Count = 0 Then _

Exit Sub

Set objConnection = Connections(1)

' Access the SymbolsFileName property here

' For example:

PrintToOutputWindow objConnection.SymbolsFileName

End Sub


SymbolsManager Property

Applies to: Application object

Returns the SymbolsManager collection.

Syntax

object.SymbolsManager

Parameters

object

An expression that evaluates to an Application object.

Property value

A SymbolsManager collection, which contains the Symbols collections of all the connections in the project.


TabSize Property

Applies to: TextDocument object

Sets or returns the number of columns in a tab character.

Syntax

object.TabSize [=value]

Parameters

object

An expression that evaluates to a TextDocument object.

value

A Long that specifies the new value of the property.

Property value

A Long value that specifies .the number of columns in a tab character.

Remarks

When you press the TAB key, you create an indent equal to the size specified by the TabSize property.

Example

The following example sets the number of columns in a tab character to 5 in the active document:

VBScript

ActiveDocument.TabSize = 5


Text Property

Applies to: TextSelection object

Sets or returns the text in a selection.

Syntax

object.Text [=text]

Parameters

object

An expression that evaluates to a TextSelection object.

text

A String that sets the text in the selection.

Property value

A String value that contains the text in the selection. This string can include one or both of the following values:

  • vbCrLf: represents "\r\n" or #13#10

  • vbTab: represents "\t" or #9

Remarks

The Text property is the default property of the TextSelection object. Accordingly, you can reference the TextSelection object without explicitly specifying ".Text" when getting the value of the Text property.

Note

You cannot use the Text property on a text in a column selection.
Example

The following example inserts a tab character by using vbTab with the Text property:

VBS Macro

Dim Sel

Set Sel = ActiveDocument.Selection

Sel.Text = vbTab


TextEditor Property

Applies to: Application object

Returns the TextEditor object.

Syntax

object.TextEditor

Parameters

object

An expression that evaluates to an Application object.

Property value

A the TextEditor object.

Example

The following example changes the editor mode from Insert to Overwrite:

VBScript

Dim EditorObj

Set EditorObj = TextEditor

EditorObj.OverType = True


TimeFormat Property

Applies to: Application object

Sets or returns a string that defines how absolute timestamps are displayed in the various windows of PCAN-Explorer.

Syntax

object.TimeFormat [=value]

Parameters

object

An expression that evaluates to an Application object.

value

A String that specifies the new value of the property.

Property value

A String value that specifies how absolute timestamps are displayed in the various windows of PCAN-Explorer.

The following table shows the format specifiers that can be used to format the output of timestamps:

Specifier | Displays
am/pm | am and pm indication, hour output in 12-hour format.
d | Day as number (1-31), shortest possible form.
dd | 2-digit day (01-31).
ddd | Day name, abbreviated to 2 characters (system locale dependent).
dddd | Day name, not abbreviated (system locale dependent).
h | Hour, shortest possible form. If am/pm is also indicated in the format string, hour is in 12-hour format.
hh | 2-digit hour. If am/pm is also indicated in the format string, hour is in 12-hour format.
m | Month as a number (1-12), shortest possible form.
mm | 2-digit Month (01-12).
mmm | Month name, abbreviated to 3 characters (system locale dependent).
mmmm | Month name, not abbreviated (system locale dependent).
n | Minute, shortest possible form (0-59).
nn | 2-digit Minute (00-59).
s | Second, shortest possible form (0-59).
ss | 2-digit Second (00-59).
x | Microseconds, up to 3 digits (x, xx, xxx).
yy | 2-digit Year.
yyyy | 4-digit Year.
z | Milliseconds, up to 3 digits (z, zz, zzz).
Example

The following example accesses the TimeFormat property:

VBScript

TimeFormat = "hh:nn:ss.zzz.xxx"


Timeout Property

Applies to: Multiplexer object, ReceiveEvent object, ReceiveMessage object

Returns the timeout time value that was defined for a Multiplexer.

Syntax

object.Timeout

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value that specifies the timeout time of the object in Milliseconds.

The value 0 indicates that no timeout was defined for the object.

Example

The following example gets the time-out time of a Multiplexer:

VBScript

Dim timeout

timeout = myMux.Timeout

See also

MinInterval Property


Timestamp Property

Applies to: J1939RcvMsg object, PCANMessage object, ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Returns the timestamp of a message.

Syntax

object.Timestamp

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Long value that specifies the number of Milliseconds that have elapsed since the start of Windows.

See also

TimestampAbs Property

TimestampAbsString Property


TimestampAbs Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Returns the absolute timestamp of a CAN message.

Syntax

object.TimestampAbs

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A DATE value that represents the absolute time stamp of the CAN message.

Example

The following example lists the absolute time stamps of all CAN messages that are currently contained in the Receive list:

VBS Macro

Sub TimestampAbsExample()

Dim msg

For Each msg In ReceiveMessages

PrintToOutputWindow Hex(msg.ID) & "h -> " & msg.TimestampAbs

Next

End Sub

See also

Timestamp Property

TimestampAbsString Property


TimestampAbsString Property

Applies to: ReceiveEvent object, ReceiveMessage object, TraceMessage object, TransmitEvent object, TransmitMessage object

Returns the absolute timestamp of a CAN message as text.

Syntax

object.TimestampAbsString

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that represents the absolute time stamp of a CAN message.

The returned string is formatted according to the format specified in the TimeFormat property.

Example

The following example lists absolute time stamps of all CAN messages that are currently contained in the Receive list:

VBS Macro

Sub TimestampAbsStringExample()

Dim msg

For Each msg In ReceiveMessages

PrintToOutputWindow Hex(msg.ID) & "h -> " & msg.TimestampAbsString

Next

End Sub

See also

Timestamp Property

TimestampAbs Property


TimestampFormat Property

Applies to: Tracer object

Sets or returns the format that is used to display timestamps in a trace window.

Syntax

object.TimestampFormat [=value]

Parameters

object

An expression that evaluates to a Tracer object.

value

A PeTraceTimestampFormat enum value that sets the new value of the property.

Property value

A PeTraceTimestampFormat enum value. Possible values are:

  • peTraceTimestampFormatRelative (0): The timestamp indicates the time offset since start of the recording.

  • peTraceTimestampFormatAbsolute (1): The timestamp is shown as an absolute time.

  • peTraceTimestampFormatDifferential (2): The timestamp indicates the time period between the message and the previous recorded message.

Example

The following example changes the value of the TimestampFormat property of the foreground tracer window:

VBS Macro

Sub TimestampFormatExample()

   If ActiveDocument.Kind = peDocumentKindTrace Then

      Dim tracer

      Set tracer = ActiveWindow.Object.Tracer

      tracer.TimestampFormat = peTraceTimestampFormatAbsolute

   End If

End Sub

See also

CanIdFormat Property

DataFormat Property


TimingErrorCount Property

Applies to: ReceiveEvent object, ReceiveMessage object

Returns the number of timing errors that have occurred for a received CAN message.

Syntax

object.TimingErrorCount

Parameters

object

An expression that evaluates to a ReceiveEvent object or ReceiveMessage object.

Property value

A Long value that specifies the number of timing errors that have occurred for a received CAN message.

Example

The following example gets the number of timing errors of a CAN message:

VBS Macro

Sub TimingErrorCountExample()

Dim rcvmsg

For Each rcvmsg In ReceiveMessages

If rcvmsg.TimingErrorCount > 0 Then

PrintToOutputWindow rcvmsg.TimingErrorCount & _

" timing errors for message " & Hex(rcvmsg.ID) & "h"

End If

Next

End Sub

The following example uses the Callback Library On Timing Error event to print a message to the Output Window when a timing error occurs for a received message:

C++ Callback DLL

HRESULT __stdcall TimingErrorCountExample(PCANExplorer6::IPEReceiveEvent *pEvent)

{

long id, count;

if (SUCCEEDED(pEvent->get_ID(&id)) &&

(SUCCEEDED(pEvent->get_TimingErrorCount(&count)))

{

char buff[100];

sprintf_s(buff, "%d timing errors for message %Xh", count, id);

pEvent->PrintToOutputWindow(CComBSTR::CComBSTR(buff));

}

return S_OK;

}


Title Property

Applies to: Symbols collection

Returns the title that was defined for a Symbols file with a global Title parameter.

Syntax

object.Title

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that specifies the title that was defined for a Symbols file with a global Title parameter.

If no Title parameter was specified in a Symbols file, the title is the name of the file without the name extension and file path.


Top Property

Applies to: Window object

Sets or returns the y-coordinate of a window's upper edge.

Syntax

object.Top [=value]

Parameters

object

An expression that evaluates to a Window object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the y-coordinate of the window's upper edge in pixels.

Remarks
Note

Multiple Document Interface (MDI) child window coordinates are relative to the child window client area. (This area is inside the frame but does not include the docking sites.)
Example

The following example sets the y-coordinate of the active window to 50:

VBScript

ActiveWindow.Top = 50

See also

Height Property

Left Property

Width Property


Tracer Property

Applies to: TraceWindow object

Returns the Tracer object contained in a trace window.

Syntax

object.Tracer

Parameters

object

An expression that evaluates to a TraceWindow object.

Property value

A Tracer object.

Example

The following example retrieves the number of recorded messages from the active tracer:

VBS Macro

Sub TracerExample()

' Open a trace window before running this macro

Dim TraceWin

Set TraceWin = ActiveWindow.Object

Dim TR

Set TR = TraceWin.Tracer

MsgBox "Number of recorded messages: " & TR.Messages.Count

End Sub


TraceState Property

Applies to: Tracer object

Returns the current operating state of the tracer.

Syntax

object.TraceState

Parameters

object

An expression that evaluates to a Tracer object.

Property value

A PeTraceState enum value. The following values are possible:

  • peTraceStopped: The tracer is stopped.

  • peTracePaused: The tracer is stopped temporarily.

  • peTraceStarted: The tracer is recording CAN messages.

  • peTraceLoading: The tracer is loading data from a file.

  • peTraceSaving: The tracer is saving data to a file.

Example

The following example gets the operating state of the active tracer:

VBS Macro

Sub TraceStateExample()

' Open a trace window before running this macro

Dim TraceWin

Set TraceWin = ActiveWindow.Object

Dim state, strMsg

state = TraceWin.Tracer.TraceState

Select Case state

Case peTraceStopped

strMsg = "Tracer is stopped"

Case peTracePaused

strMsg = "Tracer is paused"

Case peTraceStarted

strMsg = "Tracer is recording"

Case peTraceLoading

strMsg = "Tracer is loading"

Case peTraceSaving

strMsg = "Tracer is saving"

End Select

MsgBox strMsg,,ActiveWindow.Caption

End Sub


TransmitMessages Property

Applies to: Application object, Connections collection, ReceiveTransmitWindow object

Returns a TransmitMessages collection.

Syntax

object.TransmitMessages

Parameters

object

An expression that evaluates to the Application object, a Connections collection, or a ReceiveTransmitWindow object.

Property value

A TransmitMessages collection, which represents a collection of CAN messages. Each CAN message in the collection is represented by a TransmitMessage object.

Example

The following example accesses the TransmitMessages collection and counts the number of transmitted messages:

VBS Macro

Sub TransmitMessagesExample()

Dim msg, cnt

cnt = 0

For Each msg In TransmitMessages

cnt = cnt + msg.EventCount

Next

MsgBox "Number of transmitted messages: " & cnt

End Sub


Type Property [Variation 1]

Applies to: Document object, TextDocument object, Window object

Returns a string describing the type of the document or window.

Syntax

object.Type

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that specifies the type of the document or window.

The following table describes what the Type property returns for each object in the Applies To list:

Object | Returned Type | Description
Document | Generic | Contains a file not corresponding to any other type.
 | Tool | Contains a document defined by an Add-in.
 | Trace | Contains a trace file.
 | XmtList | Contains a transmission list.
TextDocument | Text | Contains a text file.
Window | Document | Shows the data of a document.
 | Tool | Contains a tool window. This includes the Start Page and the Receive/Transmit window.
Example

The following example gets the type of the active document:

VBS Macro

Sub DocumentTypeExample()

Dim doctype

doctype = ActiveDocument.Type

MsgBox "Document Type = " & doctype

End Sub


Type Property [Variation 2]

Applies to: Symbol object

Returns the type of a symbol.

Syntax

object.Type

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A PeSymbolType enum value. The following values are possible:

  • peSymbolTypeStandard (0): The symbol represents a standard CAN message that has an 11-bit identifier.

  • peSymbolTypeExtended (1): The symbol represents an extended CAN message that has a 29-bit identifier.

  • peSymbolTypeJ1939PG (2): The symbol represents a J1939 parameter group.

Example

The following example accesses the Type property:

VBS Macro

Sub SymbolTypeExample()

Dim symbol, symtype

Set symbol = SymbolsManager("MySymbols").Item("MySymbol")

symtype = symbol.Type

' ...

End Sub


Type Property [Variation 3]

PCAN-Explorer: Automation

Objects

Type Property

Home Page (Objects) | Reference

Applies to: MessageFilterItem object

Returns the type of a Message Filter item.

Syntax

object.Type

Parameters

object

An expression that represents a MessageFilterItem object.

Property value

A PeMessageFilterItemType enum value. The following values are possible:

  • peFilterItemIDRange (0): The item filters CAN IDs.

  • peFilterItemCodeMask (1): The item filters by Acceptance Code and Mask.

  • peFilterItemAllSymbols (2): The item filters out all messages that do not have a matching symbol.

  • peFilterItemMarkedSymbols (3): Only those symbols pass the filter item that are marked with the Trace flag (-t switch in a Symbols file).

  • peFilterItemJ1939 (4): The item filters by J1939 PGN, Priority, Source Address, Destination Address.

  • peFilterItemOptions (5): The item filters by message type, e.g. RTR, Error Warning, Error Frame.

Example

The following example adds a new message filter to the project and configures a new filter item. The filter is then assigned to a tracer:

VBS Macro

Sub FilterExample()

Dim myFilter

Set myFilter = MessageFilters("MyFilter")

If myFilter Is Nothing Then

' MyFilter does not yet exist in the current project

Set myFilter = MessageFilters.Add("MyFilter")

' Add a new filter item

Dim myItem

Set myItem = myFilter.AddItem

myItem.Type = peFilterItemIDRange

myItem.IDfrom = &H100

myItem.IDto = &H100

End If

' Now assign the filter to a tracer

Dim doc

Set doc = Documents("Trace1.trc")

If Not doc Is Nothing Then

Dim tracer

Set tracer = doc.ActiveWindow.Object.Tracer

tracer.Filter = myFilter

' Finally, start the tracer

tracer.Start

End If

End Sub


Properties U-Z

The following table contains all properties beginning with letters U to Z:

Property | Description
Unit | Returns the physical unit of a signal or a variable.
UseAddressingProtocol | Sets or returns whether the addressing protocol, which is a part of the J1939 network management, is enabled for the J1939 node.
Value | Sets or returns a Signal's or Variable's value.
ValueChangeTime | Returns the time and date, at which the Signal value was set last
Variables | Returns a Variables collection.
VariableStringValue | Accesses a variable value stored in the data bytes of a CAN message.
VariableValue | Accesses a variable value stored in the data bytes of a CAN message.
VBSMacroFiles | Returns the VBSMacroFiles collection.
Version | Returns the version number of PCAN-Explorer or an Add-in.
VisibleVariablesCount | Returns the number of visible Variables of a Multiplexer.
Width | Sets or returns the width of a window.
Window | Returns the Window object that contains this object.
WindowHandle | Sets or returns the handle of a window that is associated with the object.
Windows | Returns the Windows collection.
WindowState | Sets or returns the state of a window.
WindowStyle | Sets or returns the style of a window.
XferDirection | Returns the transfer direction of a Symbol.
XmtQueueEmpty | Returns whether a PCAN client's transmit queue is empty.

See also

Properties A-F

Properties G-K

Properties L-P

Properties Q-T


Unit Property

Applies to: Signal object, Variable object

Returns the physical unit of a signal or a variable.

Syntax

object.Unit

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

Property value

A String that specifies the physical unit of the signal or variable.

Example

The following example displays the unit of the signal "Speed" in a message box:

VBS Macro

Sub UnitExample()

Dim sig

Set sig = Signals("Speed")

MsgBox "Unit = " & sig.Unit,,"Speed"

End Sub


UseAddressingProtocol Property

Applies to: J1939Node object

Sets or returns whether the addressing protocol, which is a part of the J1939 network management, is enabled for the J1939 node.

Syntax

object.UseAddressingProtocol [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the addressing protocol, which is a part of the J1939 network management, is enabled for the J1939 node (see J1939/81 document). If True (the default), the addressing protocol is enabled. If False, the addressing protocol is disabled and no addresses can be claimed on the bus.


Value Property

Applies to: Signal object, Variable object

Sets or returns a signal's or variable's value.

Syntax

object.Value [=value]

Parameters

object

An expression that evaluates to a Signal object or a Variable object.

value

A Double that sets the new value of the signal or variable.

Property value

A Double that represents the current value of the signal or variable.

Remarks

You cannot use the Value property of Signals whose DataType property contains the value peDataTypeString.

Example

The following example displays the value of the signal "Speed" in a message box:

VBS Macro

Sub ValueExample()

Dim sig, value

Set sig = Signals("Speed")

value = sig.Value

MsgBox "Value = " & sig.Value,,"Speed"

End Sub

See also

StringValue Property


ValueChangeTime Property

Applies to: Signal object

Returns the time and date at which the Signal value was set the last time, e.g. when a CAN message was received that contained data for the Signal.

Syntax

object.ValueChangeTime

Parameters

object

An expression that evaluates to a Signal object.

Property value

A DATE value that specifies the time and date at which the Signal value was set the last time.

Example

The following example displays the last value time of the Signal "Speed":

VBS Macro

Sub ValueChangeTimeExample()

Dim sig

Set sig = Signals("Speed")

MsgBox "ValueChangeTime = " & sig.ValueChangeTime,,"Speed"

End Sub


Variables Property

Applies to: Multiplexer object

Returns a Variables collection.

Syntax

object.Variables

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Variables collection, which represents the collection of all variables of a multiplexer. Each variable in the collection is represented by a Variable object.

Example

The following example accesses the Variables collection:

VBScript

Dim vars

Set vars = myMultiplexer.Variables


VariableStringValue Property

Applies to: ReceiveEvent object, ReceiveMessage object, TransmitEvent object, TransmitMessage object, TraceMessage object

Accesses a variable value stored in the data bytes of a CAN message.

Syntax

object.VariableStringValue ( name ) [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

name

A String that specifies the name of the variable to be accessed.

value

A String that sets the new value of the variable.

Property value

A String representing the current value of the variable.

Remarks

The VariableStringValue properties of the ReceiveEvent, ReceiveMessage, and TraceMessage objects are read-only.

If the specified variable name is not found in the message when setting the value of a variable, nothing happens.

If the specified variable name is not found in the message when getting a variable value, then the value 0 is returned.

The string returned from the VariableStringValue property is formatted according to the variable's format specifiers, e.g. the OutputFormat property.

Examples

The following example prints all variable values of a received message to the Output window:

VBS Macro

Sub GetVariableValueExample()

Dim msg, mux, var

Set msg = ReceiveMessages(1)

If Not msg.Multiplexer Is Nothing Then

For Each var In msg.Multiplexer

PrintToOutputWindow var.Name & " = " & msg.VariableStringValue(var.Name)

Next

End If

End Sub

The following example changes a variable value in a transmit message:

VBS Macro

Sub SetVariableValueExample()

TransmitMessages(1).VariableStringValue("MyVariable") = "123"

End Sub

See also

VariableValue Property


VariableValue Property

Applies to: ReceiveEvent object, ReceiveMessage object, TransmitEvent object, TransmitMessage object, TraceMessage object

Accesses a variable value stored in the data bytes of a CAN message.

Syntax

object.VariableValue ( name ) [=value]

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

name

A String that specifies the name of the variable to be accessed.

value

A Double that sets the new value of the variable.

Property value

A Double that represents the current value of the variable.

Remarks

The VariableValue properties of the ReceiveMessage and the TraceMessage objects are read-only.

If the specified variable name is not found in the message when setting the value of a variable, nothing happens.

If the specified variable name is not found in the message when getting a variable value, then the value 0 is returned.

Examples

The following example prints all variable values of a received message to the Output window:

VBS Macro

Sub GetVariableValueExample()

Dim msg, mux, var

Set msg = ReceiveMessages(1)

If Not msg.Multiplexer Is Nothing Then

For Each var In msg.Multiplexer

PrintToOutputWindow msg.VariableValue(var.Name)

Next

End If

End Sub

The following example changes a variable value in a transmit message:

VBS Macro

Sub SetVariableValueExample()

TransmitMessages(1).VariableValue("MyVariable") = 123

End Sub

The following example uses the Callback Library On Before Transmit event to increase a rolling counter variable before the message with CAN ID 123h is transmitted:

C++ Callback DLL

HRESULT __stdcall ID123_RollingCounter(PCANExplorer6::IPETransmitEvent *pEvent)

{

static int counter;

long id;

if (SUCCEEDED(pEvent->get_ID(&id)) && (id == 0x123))

{

if (++counter > 255)

counter = 0;

pEvent->put_VariableValue(CComBSTR::CComBSTR("MyCounter"), (double)counter);

}

return S_OK;

}

See also

VariableStringValue Property


VBSMacroFiles Property

Applies to: Application object

Returns the VBSMacroFiles collection.

Syntax

object.VBSMacroFiles

Parameters

object

An expression that evaluates to an Application object.

Property value

A VBSMacroFiles collection, which represents the collection of all VBS Macro Files listed in the VBS Macro Manager dialog box. Each file in the collection is represented by a VBSMacroFile object.

Example

The following example accesses the VBSMacroFiles collection:

VBS Macro

Sub VBSMacroFilesExample()

MsgBox VBSMacroFiles.Count,,"Number of VBS Macro Files"

End Sub


Version Property

Applies to: AddIn object, Application object, PCANClient object

Returns the version number of PCAN-Explorer or an Add-in.

Syntax

object.Version

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A String value that represents a version number.

The returned version number is formatted as MajorVersion.MinorVersion.Revision, for example "5.1.0".

Example

The following example displays the version number of PCAN-Explorer:

VBS Macro

Sub VersionExample()

MsgBox Version,,"Version"

End Sub


VisibleVariablesCount Property

Applies to: Multiplexer object

Returns the number of visible variables of a multiplexer.

Syntax

object.VisibleVariablesCount

Parameters

object

An expression that evaluates to a Multiplexer object.

Property value

A Long value that specifies the number of visible variables.

The value of the VisibleVariablesCount property arises from the display formats of the Variable, which are defined by their DisplayMode property. All those variables are counted, which have its DisplayMode property set either to peDisplayAll or peDisplayValue.

See also

DisplayMode Property


Width Property

Applies to: Window object

Sets or returns the width of a window.

Syntax

object.Width [=value]

Parameters

object

An expression that evaluates to a Window object.

value

A Long value that specifies the new value of the property.

Property value

A Long value that represents the width of the window in pixels.

Example

The following example gets the width of the active window:

VBScript

Dim width

width = ActiveWindow.Width

See also

Height Property

Left Property

Top Property


Window Property

Applies to: ReceiveTransmitWindow object, TextWindow object, TraceWindow object, TransmitWindow object

Returns the Window object that contains this object.

Syntax

object.Window

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Property value

A Window object.

Example

The following example closes the active window:

VBS Macro

Sub WindowExample()

' Open a window before running this macro

Dim obj

Set obj = ActiveWindow.Object

obj.Window.Close

End Sub


WindowHandle Property

Applies to: J1939Node object, PCANClient object

Sets or returns the handle of a window that is associated with the object.

Syntax

object.WindowHandle [=value]

Parameters

object

An expression that evaluates to a J1939Node object or a PCANClient object.

value

A Long that specifies the new value of the property.

Property value

A Long value representing the window handle that is associated with the object.


Windows Property

Applies to: Application object

Returns the Windows collection.

Syntax

object.Windows

Parameters

object

An expression that evaluates to an Application object. When you access the Windows property of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

Property value

A Windows collection, which represents a collection of all open windows. Each window in the collection is represented by a Window object.

Example

The following example accesses the collection of open windows:

VBS Macro

Sub WindowsExample()

MsgBox "Number of windows: " & Windows.Count,,"Macro"

End Sub


WindowState Property

Applies to: Window object

Sets or returns the state of a window.

Syntax

object.WindowState [=state]

Parameters

object

An expression that evaluates to a Window object.

state

A PeWindowState enum value that specifies the new value of the property.

Property value

A PeWindowState enum value. Possible values are:

  • peWindowStateMaximized: Maximizes the window.

  • peWindowStateMinimized: Minimizes the window.

  • peWindowStateNormal: Restores the normal state of the window.

Example

The following example minimizes the active window:

VBS Macro

Sub WindowStateExample()

ActiveWindow.WindowState = peWindowStateMinimized

End Sub


WindowStyle Property

Applies to: Window object

Sets or returns the style of a window.

Syntax

object.WindowStyle [=value]

Parameters

object

An expression that evaluates to a Window object.

value

A PeWindowStyle enum value that sets the new value of the property.

Property value

A PeWindowStyle enum value that specifies the style of the window. Possible values are:

  • peWindowStyleFloating (1): The window is a floating window.

  • peWindowStyleDockable (2): The window is a dockable window that can be docked to the dock zones of the main window.

  • peWindowStyleTabbed (3): The window is an MDI child window and has an associated tab in the tabs area of the main window.


XferDirection Property

Applies to: Symbol object

Returns the transfer direction of the CAN message that is represented by the symbol.

Syntax

object.XferDirection

Parameters

object

An expression that evaluates to a Symbol object.

Property value

A PeXferDirection enum value. The following values are possible:

  • peXferSend (1): The symbol is transmitted.

  • peXferReceive (2): The symbol is received.

  • peXferBidirectional (3): The symbol is both transmitted and received.

Example

The following example gets the transfer direction of the Symbol "MySymbol":

VBS Macro

Sub XferDirectionExample()

Dim symbol, direction

Set symbol = SymbolsManager("MySymbols").Item("MySymbol")

direction = symbol.XferDirection

' ...

End Sub


XmtQueueEmpty Property

Applies to: J1939Node object, PCANClient object, PCANClientConnection object

Returns whether the transmit queue of the communication object is empty.

Syntax

object.XmtQueueEmpty

Parameters

object

An expression that evaluates to a J1939Node object, a PCANClient object, or a PCANClientConnection object.

Property value

A Boolean value that indicates whether the transmit queue is empty. If True, the transmit queue is empty. If False, the transmit queue still contains unsent messages.

Examples

The following example waits until the transmit queue of the first connection in the project is empty:

VBS Macro

Sub XmtQueueEmptyExample1()

Dim obj

Set obj = Connections(1).CommunicationObject

While Not obj.XmtQueueEmpty

Wait 100

Wend

MsgBox "Queue is empty"

End Sub

The following example transmits some messages and waits until all messages are transmitted before exiting.

VBS Macro

Sub XmtQueueEmptyExample2()

' Create a new PCAN client

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

' Create a new transmit message

Dim msg

Set msg = client.Messages.Add

msg.ID = &H100

msg.DLC = 1

' Now write some messages to the transmit queue

Dim timestamp, i

timestamp = client.GetSystemTime + 100

For i = 1 To 20

msg.Data(0) = i

msg.Write conn, timestamp

timestamp = timestamp + 100

Next

' Finally, wait until all messages have been sent.

' If this is not done, the macro procedure will exit

' immediately so that the client will be deleted, and

' any unsent messages are lost.

While Not client.XmtQueueEmpty

Wait 500

Wend

End Sub


Methods

Methods are actions you take against objects. For example, to add a document to the collection of open documents, you use the Add method of the Documents collection.

For more information about methods, see Applying Methods to PCAN-Explorer Objects.

The following methods are available:

Method | Description
AbortOperation | Aborts any prolonged operation of a tracer, like loading, saving, and filtering.
Activate | Moves the focus to a specific item.
Add (Variation 1) | Creates a new object in a collection.
Add (Variation 2) | Creates a new object in a collection.
Add (Variation 3) | Creates a new document.
Add (Variation 4) | Adds a new Enum value.
Add (Variation 5) | Creates a new filter object in the collection.
AddCommand | Adds a command to PCAN-Explorer that is implemented by an Add-in.
AddCommandBarButton | Creates a toolbar and toolbar buttons for an Add-in.
AddDocumentType | Adds a new document type for an ActiveX control, which is implemented by an Add-in.
AddItem | Adds a sub-item to an object or collection.
AddKeybinding | Assigns a key combination to an Add-in command.
ApplyFilter | Filters the buffer contents of a Tracer. Creates a new Tracer containing the filtered buffer.
Arrange | Maximizes, minimizes or arranges all open windows separated horizontally or vertically
Backspace | Executes the function of the backspace key.
BeginUpdate | Acquires a lock on a object.
CalculateStatisticsFromTracer | Calculates statistical values for a signal from the recorded messages of a tracer.
CanAddItem | Checks, whether an item of a specific kind can be added to a ProjectItems collection.
Cancel | Removes a selection without deleting the selected text.
CharLeft | Moves the cursor position one character to the left.
CharRight | Moves the cursor position one character to the right.
ClaimAddress | Claims a J1939 address.
Clear | Removes all elements from the collection.
ClearItems | Clears the filter items collection.
Close | Closes a document and optionally saves it, or closes and destroys a window.
CloseAll | Closes all open windows or documents.
Connect | Establishes a CAN connection for a J1939 node object.
ConnectDialog | Shows a dialog box for establishing a connection to a PCAN net.
Copy | Copies the selected text into the clipboard.
Cut | Deletes the selected text and puts it into the clipboard.
Delete | Executes the function of the key DEL.
Disconnect | Closes the CAN connection of a J1939 node object.
Duplicate | Duplicates a message filter.
EndOfLine | Moves the cursor position to the end of the last row of a selection.
EndUpdate | Releases a lock and updates the object.
ExecuteCommand | Executes a PCAN-Explorer command.
FindID | Returns a collection of the same type, which contains CAN messages with the CAN ID searched for.
FindMultiplexer | Returns a collection of the same type, which contains CAN messages with the Multiplexer searched for.
FindOrdinal | Searches for an ordinal in an Enum.
FindString | Searches for a text in an Enum by its associated ordinal.
FindSymbol | Returns a collection of the same type, which contains CAN messages matching to the specified Symbol.
FindText | Starting with the end of the current selection FindText searches through the rest of the document for specific strings. If the string has been found, FindText moves the selection to this place.
GetErrorText | Evaluates the errors from an error code and returns them as text.
GetHardwareParam | Returns different parameters, which can be retrieved by the PCAN system for every managed CAN hardware.
GetLongErrorText | Returns a description of an error code.
GetNetParam | Returns different parameters, which can be retrieved by the PCAN system for all defined PCAN nets.
GetOrdinal | Retrieves an ordinal from an Enum by its index.
GetParam | Returns different parameters, which can be retrieved by the PCAN system for the client.
GetString | Retrieves a text from an Enum by its index.
GetSystemTime | Returns the number of milliseconds, that have passed since the start of Windows.
GoToLine | Moves the cursor position to a specific line in a document.
Item | Retreives a specific CAN message, a document, a window, a signal, a Symbol or a Multiplexer from a collection.
LineDown | Moves the cursor position one line downward.
LineUp | Moves the cursor position one line upward.
MessageToValue | Calculates a Variable's value from the data of a CAN message.
MoveTo | Moves the cursor position to the given line and column.
NewProject | Creates a new project.
Open | Opens a document having the indicated file name.
OutputString | Displays a text in the output window.
PageDown | Moves the cursor position one page downward.
PageUp | Moves the cursor position one page upward.
Paste | Replaces the selection with the clipboard's contents.
Pause | Pauses the recording of CAN messages.
PauseAll | Stops the periodic sending of all corresponding CAN messages of a Transmit List.
Play | Starts playback of CAN messages from a trace buffer or file.
PrintOut | Sends a document to the current printer.
PrintToOutputWindow | Routs the text output of a Macro to the Macro tab of the output window.
Quit | Quits PCAN-Explorer.
Read (Variation 1) | Reads a CAN message from the receive queue of the parent PCANClient object.
Read (Variation 2) | Reads a J1939 message from the receive queue of a J1939Node object.
Register | Registers a PCAN client at a PCAN device.
RegisterCallback (Variation 1) | Adds a callback handler for the signal value change event.
RegisterCallback (Variation 2) | Adds a callback handler for the message reception event.
RegisterCallback (Variation 3) | Adds a callback handler for message transmission events.
RegisterMsg | Opens the reception filter of the PCAN client for the reception of a range of CAN messages.
ReleaseAddress | Releases a previously claimed J1939 address.
Remove (Variation 1) | Removes an object from its parent collection.
Remove (Variation 2) | Removes PCAN client from a PCAN device.
RemoveItem | Removes a project item from an object or collection.
RenameItem | Renames a project item.
Reset (Variation 1) | Deletes the contents of a PCAN client's receive queue.
Reset (Variation 2) | Resets a J1939Node object. Resets the configured filter, deletes the contents of the Receive Queue, and resets the connected CAN Hardware.
ResetFilters | Closes the reception filter of the PCAN client so that no more CAN messages can pass the filter.
ResetHardware | Carries out a reset of a connected CAN hardware.
ResumeAll | Resumes the periodic sending of all messages in a Transmit List.
Save | Saves a document or project in a file.
SaveAll | Saves all open documents in the collection.
SaveAs | Saves a project under a new name.
SelectAll | Extends the selection so that the whole document is included.
SelectSignal | Shows a dialog box for selecting of a signal.
SelectSignals | Shows a dialog box for selecting one or multiple signals.
Send | Sends a CAN message on the selected bus/connection.
SetAddInInfo | Transfers information about an Add-in to PCAN-Explorer when the Add-in is loaded.
SetDriverParam | Sets a PCAN driver parameter.
SetFilter | Configures the receive filter of a connection.
SetHardwareParam | Configures different parameters of a CAN hardware.
SetNetParam | Configures different parameters of PCAN nets.
SetParam | Configures different parameters of the PCAN client.
ShowFilterDialog | Shows the Edit Filter dialog box for a message filter.
Start | Starts the recording of CAN messages.
StartOfLine | Moves the cursor position to the beginning of a line.
Stop | Ends the recording of CAN messages.
TimeToString | Formats a Date/Time value.
TranslateFileName | Translates a file name, which contains Argument Macros, into an actual file name.
UnregisterCallback (Variation 1) | Removes a callback handler for the signal value change event.
UnregisterCallback (Variation 2) | Removes a callback handler for the message reception event.
UnregisterCallback (Variation 3) | Removes a callback handler for message transmission events.
UpdateSymbols | Updates symbols definitions that are stored in a specific document.
Wait | Waits for the given number of milliseconds.
Write (Variation 1) | Sends a CAN message.
Write (Variation 2) | Writes a CAN message into the transmit message queue of a PCAN client.
Write (Variation 3) | Sends a J1939 message.


AbortOperation Method

Applies to: Tracer object

Aborts any prolonged operation of a tracer, like loading, saving, and filtering.

Syntax

object.AbortOperation

Parameters

object

An expression that evaluates to a Tracer object.


Activate Method

Applies to: OutputWindowPane object

Moves the focus to the current item.

Syntax

object.Activate

Parameters

object

An expression that evaluates to an OutputWindowPane object.

Example

The following activates the "Macro" pane in the Output window:

VBS Macro

Sub ActivateExample()

Dim win

Dim OutputWin

Dim pane

Set win = Windows(peWindowKindOutput)

win.IsVisible = True

Set OutputWin = win.Object

Set pane = OutputWin.OutputWindowPanes("Macro")

pane.Activate

End Sub

See also

OutputWindow Object


Add Method [Variation 1]

Applies to: Connections collection, Enums collection, MessageFilters collection, OutputWindowPanes collection, PCANClientConnections collection, Signals collection

Creates a new object in the collection.

Syntax

object.Add ( name )

or

object.Add ( NetName )

or

object.Add ( ConnectionString )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

name

A String representing the name of the new Signal object, Enum object, OutputWindowPane object, or MessageFilter object.

The name parameter is optional when calling the Add method of the Signals collection, Enums collection, or MessageFilters collection.

NetName

(PCANClientsConnections collection) A String representing the name of the PCAN-net, with which a connection is to be established.

ConnectionString

(Connections collection) A String in the form NetName@DeviceName, which represents the connection to be established.

Return values

The Add method returns the newly created Connection object, Enum object, MessageFilter object, OutputWindowPane object, or Signal object.

Example

The following example adds a new connection to the current project:

VBS Macro

Sub AddConnectionExample()

Dim conn

Set conn = Connections.Add("TestNet@pcan_usb")

conn.IsEnabled = True

End Sub


Add Method [Variation 2]

Applies to: Messages collection, PCANMessages collection, ReceiveMessages collection, TransmitMessages collection

Creates a new object in the collection.

Syntax

object.Add

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Return values

The Add method returns the newly created PCANMessage object, ReceiveMessage object, TraceMessage object, or TransmitMessage object.

Example

The following example adds a new message to the Transmit List:

VBS Macro

Sub AddMessageExample()

Dim msg

Set msg = TransmitMessages.Add

' Initialize the CAN message

With msg

.BeginUpdate

.ID = &H100

.DLC = 3

.Data(0) = &H11

.Data(1) = &H22

.Data(2) = &H33

If Connections.Count > 0 Then _

Set .Connection = Connections(1)

.EndUpdate

End With

End Sub


Add Method [Variation 3]

Applies to: Documents collection

Creates a new document.

Syntax

object.Add ( DocKind )

Parameters

object

An expression that evaluates to a Documents collection.

DocKind

(Optional) A String that defines the kind of the document to be created. The kind of the document is a GUID string, as it is returned by the Kind property.

Return values

The Add method returns the newly created Document object.

Example

The following example creates a new Symbols file and shows it in the editor:

VBS Macro

Sub AddDocumentExample()

Dim doc

Set doc = Documents.Add(peDocumentKindText)

doc.Language = peSymbols

End Sub


Add Method [Variation 4]

Applies to: Enum object

Adds a new Enum value.

Syntax

object.Add ( ordinal, value )

Parameters

object

An expression that evaluates to an Enum object.

ordinal

A Long representing the ordinal value to be added to an Enum. Each ordinal is associated with a string that represents the ordinal.

value

A String that is associated with the ordinal value.

Example

The following example adds a new value to the Enum "MyEnum":

VBS Macro

Sub AddEnumValueExample()

Dim objEnum

Set objEnum = SymbolsManager.Enums("MyEnum")

objEnum.Add 10, "MyValue"

End Sub


Add Method [Variation 5]

Applies to: J1939Filters collection

Creates a new filter object in the collection.

Syntax

object.Add ( FilterMask, PGN, Priority, Source, Destination )

Parameters

object

An expression that evaluates to a J1939Filters collection.

FilterMask

A combination of TFilterMask values that specify which fields of a J1939 message are taken into account by this filter. Can be one or a combination of the following values: tfmPGN (1), tfmPriority (2), tfmSource (4), or tfmDestination (8).

PGN

A Long representing the PGN.

Priority

A Byte representing the Priority (0-7).

Source

A Byte representing the Source Address (0-255).

Destination

A Byte representing the Destination Address (0-255).

Return values

The Add method returns the newly created J1939Filter object.


AddCommand Method

Applies to: Application object

Adds a command to PCAN-Explorer that is implemented by an Add-in.

Syntax
C++

HRESULT _stdcall AddCommand(

BSTR szCommandString,

BSTR szMethodName,

long nGraphicsOffset,

long dwCookie,

/* [out, retval] */ VARIANT_BOOL *res

);
C#

bool AddCommand(

string szCommandString,

string szMethodName,

int nGraphicsOffset,

int dwCookie

);
Delphi

function AddCommand(

szCommandString: WideString;

szMethodName: WideString;

nGraphicsOffset: Integer;

dwCookie: Integer;

out res: WordBool

): HResult; stdcall;
Parameters

szCommandString

A string containing further strings, separated by the pipe '|' character. The following strings are contained:

  • Name of the command

This is the command, which shall be added. If the command matches with an existing command, PCAN-Explorer returns False, keeps the already existing command and does not add the new one. To avoid conflicts with existing commands the Add-in should put its name at the beginning of the command name.

  • Text, which is displayed on the toolbar button for this command

If a toolbar button is created for executing this command, this text is displayed on the button.

  • Tooltip text

This is the text which is displayed as Tooltip, when the user places the mouse pointer over the toolbar button, which is assigned to the command.

  • Status bar text

This is the text, that is shown in the status bar or in the Customize dialog, when the user selects the command.

szMethodName

Represents the name of the method, which is published by the Add-in to execute the command.

nGraphicsOffset

The 0-based index for the image of this command in the commands bitmap. E.g.

dwCookie

Represents the unique ID of the Add-in. PCAN-Explorer submitted this value to the Add-in by the Add-in's OnConnection method.

Return values

The AddCommand method returns one of the following values:

  • True: The command has been added.

  • False: The command hasn't been added, because its name is in the conflict with an already existing command.

Remarks

Only Add-ins can invoke the AddCommand method. VBScript Macros are not capable of this.

Examples

The following code adds a command to PCAN-Explorer:

Visual C++

STDMETHODIMP CPEAddIn::OnConnection(IDispatch* pApp, VARIANT_BOOL bFirstTime,

long dwCookie, VARIANT_BOOL * res)

{

...

CComBSTR szCommandString("SampleCommand1|&Sample Command|Sample Command|This is a Sample Command");

CComBSTR szMethodName("SampleCommand1");

if (FAILED(pApplication->AddCommand(szCommandString, szMethodName, 1, dwCookie)))

{

// Handle the error, e.g.

*res = VARIANT_FALSE;

return S_OK;

}
C#

public bool OnConnection(object app, bool firstTime, int cookie)

{

...

string commandString = "SampleCommand1|&Sample Command|Sample Command|This is a Sample Command";

string methodName = "SampleCommand1";

try

{

if (!this.app.AddCommand(commandString, methodName, 1, cookie))

return false;

}

catch

{

// Handle the error, e.g.

return false;

}
Delphi

function TPEAddIn.OnConnection(const pApp: IPEApplication; bFirstTime: WordBool;

dwCookie: Integer; out res: WordBool): HResult;

var

commandString, methodName: String;

_res: WordBool;

begin

...

commandString := 'SampleCommand1|&Sample Command|Sample Command|This is a Sample Command';

methodName := 'SampleCommand1';

if Failed(pApplication.AddCommand(strCmdName, strMethodName, 1, dwCookie, _res))

or not _res then

begin

// Handle the error, e.g.

res := False;

Result := S_OK;

Exit;

end;


AddCommandBarButton Method

Applies to: Application object

Creates a toolbar and a toolbar button for an Add-in.

Syntax
C++

HRESULT _stdcall AddCommandBarButton(

BSTR szCmdName,

long dwCookie

);
C#

void AddCommandBarButton(

string szCmdName,

int dwCookie

);
Delphi

function AddCommandBarButton(

szCmdName: WideString;

dwCookie: Integer

): HResult; stdcall;
Parameters

szCmdName

A string containing the name of the command that you want to assign to the button. This name must match a command that has already been added by calling the AddCommand method.

dwCookie

Represents the unique ID of the Add-in. PCAN-Explorer submitted this value to the Add-in by the Add-in's OnConnection method.

Remarks

Only Add-ins can invoke the AddCommandBarButton method. VBScript Macros are not capable of this.

The AddCommandBarButton method is usually called in the implementation of the IPEExtensibility.OnConnection method.

Example
Visual C++

if (FAILED(pApp->AddCommandBarButton(szCommandName, m_dwCookie)))

{

// Handle the error, e.g.

*res = VARIANT_FALSE;

return S_OK;

}

C#

try

{

app.AddCommandBarButton(commandName, cookie);

}

catch

{

// Handle the error, e.g.

return false;

}

Delphi

if Failed(pApp.AddCommandBarButton(commandName, FCookie)) then

begin

// Handle the error, e.g.

res := VARIANT_FALSE;

Exit;

end;

See also

AddCommand Method

Adding Commands to PCAN-Explorer

AddKeybinding Method

SetAddInInfo Method


AddDocumentType Method

Applies to: Documents collection

Adds a new document type, which is implemented by an Add-in, to PCAN-Explorer. This document type serves for saving and loading data of an ActiveX control. The available document types appear in the dialog "New File".

Syntax

object.AddDocumentType ( DocString, DocumentCLSID, WindowCLSID, Binary )

Parameters

object

An expression that evaluates to a Documents collection.

DocString

A String containing further substrings, separated by LF characters (Line Feed, ASCII-Code 10). The following strings are contained:

  • ClassID of the object

This string must contain the ClassID of the ActiveX control, which is created for the display of the document and shown in the corresponding window.

  • Default name of the document

The default name of the document (e.g. "Sheet"). This name with a consecutive number as supplement is used as name for a new document, when the user selects the menu command File | New | New File (e.g. "Sheet1" or "Sheet2"). If this name is not indicated, "Untitled" is used as default name.

  • Name of the document type

This name appears in the New File dialog box for the new document type (e.g. "Worksheet"). If this name is not indicated, the new document type is not visible in the New File dialog box.

  • Name of Open filter

Description of the document type and the file filter for opening this document type. This string is shown in the drop-down list "Files of type" of the "Open" dialog box (e.g. "Worksheets (*.xls)"). If the filter is not indicated, the document type is not visible in the File New dialog box. The Open filter can contain more than one file types, which then must be separated by Pipe characters "|", e.g. "Excel files (*.xls)|XML files (*.xml)".

  • File name extensions for Opening

File name extensions for opening files of this type (e.g. ".xls"). If not indicated, the new document type is not visible in the New File dialog box. If more than one extension is indicated, they must be separated by Pipe characters "|", e.g. ".xls|.xml".

  • Name of Save filter

Description of the document type and the file filter for saving this document type. This string is shown in the drop-down list "Save as type" of the "Save as" dialog box (e.g. "Worksheets (*.xls)"). If the filter is not indicated, the file cannot be saved. More than one filter can be indicated, which then must be separated by Pipe characters "|", e.g. "Text file (*.txt)|Log file (*.log)".

  • File name extension for Saving

File name extension for saving files of this type (e.g. ".xls"). For every name of the Save filter the corresponding file name extension must be indicated here. If more than one extensions are indicated, they must be separated by Pipe characters "|", e.g. ".txt|.log".

  • Description for creating this document type

E.g. "Creates a text file." This description is shown in the New File dialog box if the document type is selected in the "Templates" field.

  • Identification of the document type in the registry

This string is for saving of the document type in the registry, which is managed by Windows (e.g. "ExcelWorksheet"). It is used for internal purposes only. If this string is not indicated, the document type cannot be registered at the Windows file manager.

  • Name of the document type in the registry

This string can be shown in dialog boxes of applications, which accesses the registry (e.g. "Microsoft Excel Worksheet").

  • Resource ID of the icon

The icon's resource ID in the module, that contains the implementation of the Add-in. This icon is used for representation of the document type in the File New dialog box.

  • Reserved

This string is reserved for internal purposes and must be empty.

DocumentCLSID

A String containing a ClassID of a COM object or ActiveX control that represents the document. This string must not be empty.

WindowCLSID

A String containing a ClassID of an Active X control, which will be created for the visual representation of the document. If this string is empty, the ClassID specified in the DocumentCLSID parameter is used to represent this document and the visual representation of the document. If both DocumentCLSID and WindowCLSID are specified and are different, individual COM/ActiveX objects are used for the document and its visual representation.

Binary

A Boolean value that indicates whether the document is saved binary or as ASCII text.

Remarks

Only Add-ins can invoke the AddDocumentType method. VBScript Macros are not capable of this.


AddItem Method

Applies to: MessageFilter object, Project object, ProjectItems collection

Adds a sub-item to an object or collection.

Syntax

object.AddItem

or

object.AddItem ( Name, Kind )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Name

A String representing the name of the new project item object.

Kind

A String that defines the kind of the project item to be created. The kind of the project item is a GUID string, as it is returned by the Kind property.

Return values

The AddItem method returns the newly created MessageFilterItem object or ProjectItem object.

Example

The following example adds a new message filter to the current project:

VBS Macro

Sub AddItemExample()

Dim item

Set item = ActiveProject.AddItem("MyFilter", _

peProjectItemKindMessageFilter);

End Sub


AddKeybinding Method

Applies to: Application object

Assigns a key combination to a command.

Syntax
C++

HRESULT _stdcall AddKeybinding(

BSTR szKey,

BSTR szCommandName

);
C#

void AddKeybinding(

string szKey,

string szCommandName

);
Delphi

function AddKeybinding(

szKey: WideString,

szCommandName: WideString

): HResult; stdcall;
Parameters

szKey

A String that specifies the key combination which is needed for executing the command. The string has the format "CTRL+ALT+SHIFT+A", where CTRL, ALT, and SHIFT must always be indicated in this order.

szCommandName

A String that defines the command, which is executed by the key combination.

Remarks

If the user removes (uninstalls) an Add-in, PCAN-Explorer does not automatically remove the key combination that was added when installing the Add-in, since the user could have changed the key combination in the meantime.

Attention: If key combinations are not absolutely necessary, they shouldn't be added since they can get into conflict with existing key combinations, what can have unforeseeable consequences for the user.

The AddKeyBinding method is usually called in the implementation of the IPEExtensibility.OnConnection method.

Examples

The following code binds a key combination to an Add-in command:

Visual C++

if (bFirstTime == VARIANT_TRUE)

{

CComBSTR bszKeystroke("CTRL+4");

if (FAILED(pApplication->AddKeybinding(bszKeystroke, bszCmdName)))

{

// Handle the error, e.g.

*res = VARIANT_FALSE;

return S_OK;

}

}
C#

if (bFirstTime)

{

try

{

this.app.AddKeybinding("CTRL+4", cmdName);

}

catch

{

// Handle the error, e.g.

return false;

}

}
Delphi

if bFirstTime then

begin

if Failed(pApplication.AddKeybinding('CTRL+4', cmdName)) then

begin

// Handle the error, e.g.

res := False;

Result := S_OK;

Exit;

end;

end;

See also

AddCommand Method | Adding Commands to PCAN-Explorer | AddCommandBarButton Method | SetAddInInfo Method


ApplyFilter Method

Applies to: Tracer object

Filters the buffer contents of a Tracer. Creates a new Tracer containing the filtered buffer.

Syntax

object.ApplyFilter ( )

Parameters

object

An expression that evaluates to a Tracer object.

Return value

If successful, the ApplyFilter method returns the newly created Tracer object.

Example

The following example filters the buffer contents of a Tracer:

VBS Macro

Sub ApplyFilterExample()

Dim tracer, FilteredTracer

' Get the tracer

Set tracer = Windows("MyTracer.trc").Object.Tracer

' Select a filter to be applied

Set tracer.Filter = MessageFilters("MyFilter")

' Now filter the buffer and show the resulting

' number of messages

Set FilteredTracer = tracer.ApplyFilter

If Not FilteredTracer Is Nothing Then _

MsgBox FilteredTracer.Messages.Count

End Sub

See also

Filter Property

MessageFilters Property


Arrange Method

Applies to: Windows collection

Arranges, maximises, or minimizes all open windows.

Syntax

object.Arrange state

Parameters

object

An expression that evaluates to a Windows collection.

state

An enum of the type PeArrangeStyle, which sets the state of the windows. In the following the possible values, which are of the type Long:

  • peCascade: Cascades windows.

  • peMinimize: Minimizes windows.

  • peTileHorizontal: Arranges the windows separated horizontally.

  • peTileVertical: Arranges the windows separated vertically.

Example

The following example arranges all open windows separated horizontally:

VBScript

Windows.Arrange peTileHorizontal


Backspace Method

Applies to: TextSelection object

Executes the function of the backspace key.

Syntax

object.Backspace [count]

Parameters

object

An expression that evaluates to a TextSelection object.

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

If no selection exists, the Backspace method deletes the character on the left of the cursor position.

Example

The following example moves the cursor two columns to the left and deletes the characters in these columns:

VBScript

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.Backspace 2

End If

See also

Cut Method


BeginUpdate Method

Applies to: Connection object, Project object, ProjectItem object, Signal object, TransmitMessage object

Acquires a lock on the object.

Syntax

object.BeginUpdate

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

See also

EndUpdate Method


CalculateStatisticsFromTracer Method

Applies to: Signal object

Calculates the statistical values accessible through the properties RunningMin, RunningMinTime, RunningMax, RunningMaxTime, and RunningMean from the recorded messages of a tracer.

Syntax

object.CalculateStatisticsFromTracer tracer

Parameters

object

An expression that evaluates to a Signal object.

tracer

An expression that evaluates to a Tracer object.

Remarks

Calling this method sets the StatisticsEnabled property to False, so that the statistical values are not altered by other currently received or transmitted messages.

Example

The following example calculates the statistical values of messages recorded by a tracer:

VB Script

Sub CalculateStatisticsFromTracerExample()

Dim doc, tracer, sig

' Open a Trace file

Set doc = Documents.Open("MyTrace.trc")

Set tracer = doc.ActiveWindow.Object.Tracer

Do While tracer.TraceState = peTraceLoading

Wait 10

Loop

' Calculate statistics and print the results

Set sig = Signals("Speed")

sig.CalculateStatisticsFromTracer(tracer)

PrintToOutputWindow "Min=" & sig.RunningMin

PrintToOutputWindow "Max=" & sig.RunningMax

PrintToOutputWindow "Mean value=" & sig.RunningMean

End Sub

See also

StatisticsEnabled Property

RunningMin Property

RunningMinTime Property

RunningMax Property

RunningMaxTime Property

RunningMean Property


CanAddItem Method

Applies to: ProjectItems collection

Checks, whether an item of a specific kind can be added to a ProjectItems collection.

Syntax

object.CanAddItem ( Name, Kind )

Parameters

object

An expression that evaluates to a ProjectItems collection.

Name

A String representing the name of the item to be added to the collection.

Kind

A String that defines the kind of the item to be added. The kind of the project item is a GUID string, as it is returned by the Kind property.

Return values

The CanAddItem method returns a Boolean value:

  • True: The specified item can be added to the collection.

  • False: The specified item cannot be added to the collection.


Cancel Method

Applies to: TextSelection object

Removes a selection without deleting the selected text.

Syntax

object.Cancel

Parameters

object

An expression that evaluates to a TextSelection object.

Example

The following example removes the current selection:

VBScript

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.Cancel

End If


CharLeft Method

Applies to: TextSelection object

Moves the cursor position one character to the left.

Syntax

object.CharLeft [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+LEFT ARROW).

  • peMove: The selection is not extended (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The CharLeft method has the same effect as pressing the key LEFT ARROW.

Example

The following example extends the selection 2 characters to the left:

VBS Macro

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.CharLeft peExtend, 2

End If


CharRight Method

Applies to: TextSelection object

Moves the cursor position one character to the right.

Syntax

object.CharRight [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+RIGHT ARROW).

  • peMove: Does not extend the selection (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The CharRight method has the same effect as pressing the key RIGHT ARROW.

Example

The following example extends the selection 2 characters to the right:

VBS Macro

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.CharRight peExtend, 2

End If


ClaimAddress Method

Applies to: J1939Node object

Claims a J1939 address.

Syntax

object.ClaimAddress

Parameters

object

An expression that evaluates to a J1939Node object.

Return values

The ClaimAddress method returns one of the following values:

  • True: Claiming the address was successful.

  • False: An error occurred while claiming the address. The LastError property of the J1939Node object provides information about the cause of the error.

Remarks

The ClaimAddress method tries to claim the address that was specified in the PreferredAddress property. After an address has been successfully claimed, the actual claimed address can be obtained from the ClaimedAddress property.

See also

ReleaseAddress Method


Clear Method

Applies to: J1939Filters collection, Messages collection, OutputWindowPane object, ReceiveMessages collection, Tracer object, TransmitMessages collection

Removes all elements from the collection or object.

Syntax

object.Clear

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Example

The following example deletes all CAN messages from the Receive List:

VBS Macro

Sub ClearExample()

ReceiveMessages.Clear

End Sub


ClearItems Method

Applies to: MessageFilter object

Clears the filter items collection.

Syntax

object.ClearItems

Parameters

object

An expression that evaluates to a MessageFilter object.


Close Method

Applies to: Document object, TextDocument object, Window object

Closes a document and optionally saves it, or closes and destroys a window.

Syntax

object.Close ( [SaveChanges] )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

SaveChanges

(Optional) An enum of type PeSaveChanges that specifies the save action for the document or window. Can be one of the following values, which are of the Long type:

  • peSaveChangesYes (1): Saves pending changes without prompting the user (default).

  • peSaveChangesNo (2): Does not save pending changes.

  • peSaveChangesPrompt (3): Prompts the user to save pending changes.

Return value

The Close method returns a PeSaveStatus enum value having one of the following values:

  • peSaveCanceled: The user has canceled the save operation.

  • peSaveSucceeded: The user has saved the pending changes of the document.

Remarks

The following table summarizes the results of the use of Close on the objects mentioned above:

Object | Results
Document TextDocument | Closes all windows that are related to the document. These windows are removed from the Windows collection, which can be accessed by using the Windows property of the Application object. Closes the document and removes it from the Documents collection.
Window | Closes the window and removes it from the Windows collection, which can be accessed by using the Windows property of the Application object. If the window is the only one displaying an open document, this document is also closed and removed from the Documents collection.
Example

The following example saves all changes of the active document and closes the associated window:

VBScript

ActiveDocument.Close


CloseAll Method

Applies to: Documents object, Windows object

Closes all windows or documents.

Syntax

object.CloseAll ( [SaveChanges] )

Parameters

object

An expression that evaluates to a Documents or a Windows collection.

SaveChanges

(Optional) An enum of the type PeSaveChanges, which determines, if the changes of one or several documents shall be saved before the document is closed. In the following the possible values (type Long):

  • peSaveChangesYes: Saves all changes (default).

  • peSaveChangesNo: Does not save changes; no confirmation from the user.

  • peSaveChangesPrompt: Prompts the user to confirm the saving. If the user choses not to save the changes, CloseAll returns the enum peSaveStatus with the value peSaveCanceled. Otherwise CloseAll returns peSaveSucceeded.

Return value

The method CloseAll returns an enum PeSaveStatus having one of the following values:

  • peSaveCanceled: Indicates, that the user has chosen not to save the changes of the document.

  • peSaveSucceeded: Indicates, that the user has saved the changes of the document.

Example

The following example saves the changes of all open documents and then closes them:

VBScript

Documents.CloseAll

See also

Open Method


Connect Method

Applies to: J1939Node object

Establishes a CAN connection for the object.

Syntax

object.Connect

Parameters

object

An expression that evaluates to a J1939Node object.

Return values

The Connect method returns a Boolean value:

  • True: Establishing the CAN connection was successful.

  • False: An error occurred while establishing the connection. The LastError property of the J1939Node object provides information about the cause of the error.

Remarks

The Connect method uses the Device, ClientName, and NetName properties initialize the connection.

See also

Disconnect Method


ConnectDialog Method

Applies to: PCANClientConnection object

Shows a dialog box for establishing a connection to a PCAN net.

Syntax

object.ConnectDialog

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Return values

The ConnectDialog method returns one of the following values:

  • True: A connection to the selected net has been established.

  • False: The user has closed the dialog box without selecting a net, or a connection to the net couldn't be established due to an error. In case of an error, the LastError property of the parent PCANClient object provides information about the cause of the error.

Example

The following example shows the dialog box for establishing a PCAN net connection:

VBS Macro

Sub ConnectDialogExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("")

If conn.ConnectDialog Then

' Connection successful

MsgBox "Connected to " & conn.NetName & "@" & client.Device

End If

End Sub


Copy Method

Applies to: TextSelection object

Copies the selected text into the clipboard.

Syntax

object.Copy

Parameters

object

An expression that evaluates to a TextSelection object.

Example

The following example copies the selected text into the clipboard:

VBS Macro

Sub CopyExample()

If ActiveDocument.Type = "Text" Then _

ActiveDocument.Selection.Copy

End Sub

See also

Cut Method

Paste Method


Cut Method

Applies to: TextSelection object

Deletes the selected text and puts it into the clipboard.

Syntax

object.Cut

Parameters

object

An expression that evaluates to a TextSelection object.

Example

The following example deletes the selected text and puts it into the clipboard:

VBS Macro

Sub CutExample()

If ActiveDocument.Type = "Text" Then _

ActiveDocument.Selection.Cut

End Sub

See also

Copy Method

Paste Method


Delete Method

Applies to: TextSelection object

Executes the function of the key DEL.

Syntax

object.Delete [count]

Parameters

object

An expression that evaluates to a TextSelection object.

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

If no selection exists, the Delete method deletes the character on the right of the cursor position.

Example

The following example deletes the selected text:

VBScript

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.Delete

End If

See also

Cut Method


Disconnect Method

Applies to: J1939Node object

Closes the CAN connection of the object.

Syntax

object.Disconnect

Parameters

object

An expression that evaluates to a J1939Node object.

See also

Connect Method


Duplicate Method

Applies to: MessageFilters collection

Duplicates a message filter.

Syntax

object.Duplicate ( Value )

Parameters

object

An expression that evaluates to a MessageFilters collection.

Value

The message filter that is to be duplicated.

Return values

The Duplicate method returns the newly created MessageFilter object.

Example

The following example creates a copy of a message filter:

VBS Macro

Sub DuplicateExample()

Dim filter, filterCopy

Set filter = MessageFilters.Item("MyFilter")

Set filterCopy = MessageFilters.Duplicate(filter)

End Sub


EndOfLine Method

Applies to: TextSelection object

Moves the cursor position to the end of the last row of a selection.

Syntax

object.EndOfLine [extend]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) A value of the PeMovementOptions enum that determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+END).

  • peMove: Does not extend the selection (default value).

Remarks

The EndOfLine method has the same effect as pressing the key END.

Example

The following example moves the cursor position to the end of the line:

VBS Macro

Sub EndOfLineExample()

If ActiveDocument.Kind = peDocumentKindText Then _

ActiveDocument.Selection.EndOfLine

End Sub


EndUpdate Method

Applies to: Connection object, Project object, ProjectItem object, Signal object, TransmitMessage object

Releases a lock and updates the object.

Syntax

object.EndUpdate

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

See also

BeginUpdate Method


ExecuteCommand Method

Applies to: Application object

Executes a specified command.

Syntax

object.ExecuteCommand command

Parameters

object

An expression that evaluates to an Application object.

command

A String that represents the command that shall be executed.

Remarks

Commands can also be executed by specifying command names in the command line, or by using toolbar buttons or key combinations that are linked to the commands.

Attention

Do not execute the ApplicationExit command from a VBS macro. Use the Application.Quit method instead.
Example

The following example starts a new tracer:

VBScript

ExecuteCommand "TraceStartNew"

See also

PCAN-Explorer Commands


FindID Method

Applies to: Messages collection, ReceiveMessages collection, TransmitMessages collection

Returns a Messages collection, which contains only CAN messages with the requested CAN ID.

Syntax

object.FindID ( id )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

id

A Long value indicating the requested CAN ID.

Return values

The FindID method returns a Messages collection.

Example

The following example searches through the reception list for CAN messages with the ID 200h:

VBS Macro

Sub FindIDExample()

Dim msgs

Set msgs = ReceiveMessages.FindID(&H200)

MsgBox msgs.Count & " message(s) found."

End Sub


FindMultiplexer Method

Applies to: Messages collection, ReceiveMessages collection, TransmitMessages collection

Returns a Messages collection, which contains only CAN messages that are compatible with the specified Multiplexer.

Syntax

object.FindMultiplexer ( mux )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

mux

The requested Multiplexer.

Return values

The FindMultiplexer method returns a Messages collection.

Example

The following example searches through the reception list for CAN messages that are compatible with the Multiplexer "RcvSymbol.Mux1":

VBS Macro

Sub FindMultiplexerExample()

Dim mux

Set mux = SymbolsManager("Sample").Item("RcvSymbol").Multiplexers("Mux1")

Dim msgs

Set msgs = ReceiveMessages.FindMultiplexer(mux)

MsgBox msgs.Count & " message(s) found."

End Sub


FindOrdinal Method

Applies to: Enum object

Searches for an ordinal in the Enum.

Syntax

object.FindOrdinal ( String )

Parameters

object

An expression that evaluates to an Enum object.

String

A String containing the text, for which an associated ordinal is searched.

Return values

The FindOrdinal method returns the one-based index of the found ordinal in the list. If no ordinal is associated with the specified text, the FindOrdinal method returns the value 0.

Example

The following example searches for an ordinal in the Enum "MyEnum" and displays it in a message box:

VBS Macro

Sub FindOrdinalExample()

Dim myEnum, index, ord

Set myEnum = SymbolsManager.Enums("MyEnum")

index = myEnum.FindOrdinal("Value1")

If index > 0 Then

ord = myEnum.GetOrdinal(index)

MsgBox ord

End If

End Sub

See also

FindString Method

GetOrdinal Method

GetString Method


FindString Method

Applies to: Enum object

Searches for a text in the Enum by its associated ordinal.

Syntax

object.FindString ( ordinal )

Parameters

object

An expression that evaluates to an Enum object.

ordinal

A Long representing the ordinal, for which an associated text is searched.

Return values

The FindString method returns a string that is associated with the specified ordinal. If no text is associated with the ordinal, the FindString method returns an empty string.

Example

The following example searches an ordinal in the Enum "MyEnum" and displays its associated text in a message box:

VBS Macro

Sub FindStringExample()

Dim myEnum, str

Set myEnum = SymbolsManager.Enums("MyEnum")

str = myEnum.FindString(43)

MsgBox str

End Sub

See also

FindOrdinal Method

GetOrdinal Method

GetString Method


FindSymbol Method

Applies to: Messages collection, ReceiveMessages collection, TransmitMessages collection

Returns a Messages collection, which contains only CAN messages that are compatible with the specified Symbol.

Syntax

object.FindSymbol ( sym )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

sym

The requested Symbol.

Return values

The FindSymbol method returns a Messages collection.

Example

The following example searches through the reception list for CAN messages that are compatible with the Symbol RcvSymbol:

VBS Macro

Sub FindSymbolExample()

Dim sym

Set sym = SymbolsManager("Sample").Item("RcvSymbol")

Dim msgs

Set msgs = ReceiveMessages.FindSymbol(sym)

MsgBox msgs.Count & " message(s) found."

End Sub


FindText Method

Applies to: TextSelection object

Starting with the end of the current selection FindText searches through the rest of the document for specific strings. If the string has been found, FindText moves the selection to this place.

Syntax

object.FindText ( string [,flags] )

Parameters

object

An expression that evaluates to a TextSelection object.

string

A String, which shall be searched for.

flags

(Optional) An enum of the type PeTextSearchOptions, which determines how the search shall be carried out. For complex search operations the values can be combined. The values, that can be combined, are:

  • peMatchForward: Searches forwards in the document. This is the standard value.

  • peMatchBackward: Searches backwards in the document.

  • peMatchFromStart: Searches from the beginning or from the end of the document. If a forward search is started (peMatchForward), it begins at the beginning of the document. If a backward search is started (peMatchBackward), it begins at the end of the document.

  • peMatchWord: Searches for whole words.

  • peMatchCase: The case sensitivity of the string searched for is considered.

Return values

The FindText method returns one of the following values:

  • True: The search has been successful.

  • False: The search hasn't been successful.

Remarks

The values of the flags parameter can be combined by using the or operator or the concatenation operator +. If, for example, a search shall be carried out, in which the case sensitivity is considered, specify either peMatchForward or peMatchCase or peMatchForward + peMatchCase.

Example

The following example carries out a search for the word "Receive":

VBS Macro

Sub FindTextExample()

ActiveDocument.Selection.FindText "receive", peMatchWord

End Sub


Get Method

Applies to: J1939Filters collection

Retrieves all parameters of a filter by its index.

Syntax

C++

HRESULT _stdcall Get(

int Index,

TFilterMask *Flags,

unsigned int *PGN,

unsigned char *Priority,

unsigned char *Source,

unsigned char *Destination,

/* [out, retval] */ VARIANT_BOOL *res

);

C#

bool Get(

int Index,

ref J1939Pcan.TFilterMask Flags,

ref uint PGN,

ref byte Priority,

ref byte Source,

ref byte Destination

);

Delphi

function Get(

Index: Integer;

out Flags: TFilterMask;

out PGN: LongWord;

out Priority: Byte;

out Source: Byte;

out Destination: Byte

): WordBool; stdcall;
Parameters

Index

The 1-based index of the filter in the collection.

Flags

Returns the contents of the Flags property of the object.

PGN

Returns the contents of the PGN property of the object.

Priority

Returns the contents of the Priority property of the object.

Source

Returns the contents of the SourceAddress property of the object.

Destination

Returns the contents of the DestinationAddress property of the object.

Return values

The Get method returns a Boolean value:

  • True: The parameters were retrieved successfully.

  • False: The specified index did not correspond to any item in the collection.

Remarks

Only Add-ins can invoke the Get method. VBScript Macros are not capable of this.


GetDriverParam Method

Applies to: PCANClient object

Retrieves the value of a PCAN driver parameter.

Syntax

object.GetDriverParam ( Param, pValue )

Parameters

object

An expression that evaluates to a PCANClient object.

Param

An enum of the type PCANParameter, which contains the type of the parameter to be retrieved. The GetDriverParam method supports the following parameters:

Parameter | Description
pcanParamDriverType | Returns the type of the device driver: 0 = Unknown, 1= Win9x, 2 = WinNT, 3 = WDM, 4 = WDF
pcanParamRcvQueueSize | Returns the size of Receive Queues (default = 32768)
pcanParamXmtQueueSize | Returns the size of Transmit Queues (default = 32768)
pcanParamAutoBusOn | This parameter indicates whether a CAN hardware is automatically set into a passive BUS-ON mode after its CAN controller reached the BUS-OFF state. 0 = Auto-BUS-ON disabled, 1 = Auto-BUS-ON enabled (default)

pValue

A pointer or reference to a Variant, which receives the parameter's value.

Return values

The GetDriverParam method returns one of the following values:

  • True: Getting the specified parameter was successful.

  • False: An error occurred while getting the specified parameter. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example queries the size of Receive Queues for the pcan_usb device:

VBS Macro

Sub GetDriverParamExample()

Dim client, value

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

If client.GetDriverParam(pcanParamRcvQueueSize, value) Then _

MsgBox "Receive Queue Size = " & value

End Sub

See also

SetDriverParam Method


GetErrorText Method

Applies to: PCANClient object

Transforms error codes to text.

Syntax

object.GetErrorText ( Error )

Parameters

object

An expression that evaluates to a PCANClient object.

Error

An enum of the type PCANError, which contains the error code to be analyzed and evaluated.

Return value

The GetErrorText method returns a String containing the error of the given error code, in text format. An error code is an enum of the type PCANError, which also can contain a combination of multiple errors.

Remarks

Error codes are returned directly by some methods of the PCANClient object. However, other methods return a Boolean value. If such a return value is False, this indicates an error and the cause of the error can be retrieved by the LastError property of the PCANClient object. Setting properties of the PCANClient object can also produce error codes.

Example

The following example analyses and evaluates an error code and displays the corresponding text:

VBS Macro

Sub GetErrorTextExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

If Not client.IsRegistered Then

' Error while registering client at PCAN system

MsgBox "Error: " & client.GetErrorText(client.LastError)

End If

End Sub

See also

GetLongErrorText Method

LastError Property

LastErrorText Property


GetHardwareParam Method

Applies to: PCANClient object

Retrieves the value of a CAN hardware parameter.

Syntax

object.GetHardwareParam ( HardwareHandle, Param, pValue )

Parameters

object

An expression that evaluates to a PCANClient object.

HardwareHandle

A Long value, which indicates the handle of the hardware, for which a parameter shall be retrieved.

Param

An enum of the type PCANParameter, which contains the type of the parameter to be retrieved. In the following the possible values and the meaning of the respective parameter:

Parameter | Description
pcanParamAccCode | The acceptance code of the message filter (Long value).
pcanParamAccMask | The acceptance mask of the message filter (Long value).
pcanParamActive | A Long value indicating if the CAN controller is in reset state or if it is actively working at the CAN bus.
pcanParamBitrate | The current bit rate of the CAN controller (Long value). The bit rate is a 16-bit value, which is a combination of the two 8-bit bus timing registers BTR0 and BTR1 of the SJA1000 CAN controller (only for non-FD bit rates).
pcanParamBitCnt | The total number of transmitted and received bits (Long value).
pcanParamHwDriverNo | A Long value indicating the kind of driver that manages the hardware (USB, PCI,...).
pcanParamHwInt | The interrupt used by the hardware (Long value).
pcanParamHwNet | A Long value, which indicates the handle of the net, the hardware is part of.
pcanParamHwPort | The I/O address used by the hardware (Long value).
pcanParamListenOnly | A Long value indicating whether the ListenOnly mode of the attached CAN hardware is enabled. 0 = disabled (default), 1 = enabled
pcanParamMsgCnt | The total number of transmitted and received messages (Long value).
pcanParamName | A String containing the name of the hardware.
pcanParamRcvBitCnt | The total number of received bits (Long value).
pcanParamRcvErrFrames | A Long value indicating whether the CAN hardware is configured for the reception of Error Frames. The value 1 indicates that Error Frames are received.
pcanParamRcvMsgCnt | The number of messages received in all (Long value).
pcanParamXmtBitCnt | The total number of transmitted bits (Long value).
pcanParamXmtMsgCnt | The total number of transmitted messages (Long value).
pcanParamXmtQueueFill | The number of messages in the transmit queue not being sent (Long value).

pValue

A pointer or reference to a Variant, which receives the parameter's value.

Return values

The GetHardwareParam method returns one of the following values:

  • True: Getting the specified parameter was successful.

  • False: An error occurred while getting the specified parameter. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example creates a new PCAN client, connects it to the PCAN net "TestNet" on the PCAN-USB device, and retrieves the value of the bus timing register of the CAN controller, if the net is connected to a PCAN-USB adaptor:

VBS Macro

Sub GetHardwareParamExample()

Dim client, conn, btr0btr1

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

If conn.HardwareHandle > 0 Then

client.GetHardwareParam conn.HardwareHandle, pcanParamBitrate, btr0btr1

MsgBox "Bus Timing Register = " & Hex(btr0btr1)

End If

End Sub

Note that the value of the bus timing register of the connected Hardware can also be retrieved by using the HardwareBitRate property of the PCANClientConnection object.

See also

SetHardwareParam Method


GetLongErrorText Method

Applies to: PCANClient object

Returns a description of an error code.

Syntax

object.GetLongErrorText ( Error )

Parameters

object

An expression that evaluates to a PCANClient object.

Error

An enum of the type PCANError, which contains the error code to be analyzed and evaluated.

Return value

The GetLongErrorText method returns a String containing the description of the error of the given error code. An error code is an enum of the type PCANError, which also can contain a combination of multiple errors. If the error code consists of multiple errors, the individual descriptions are separated by commas.

Remarks

Error codes are returned directly by some methods of the PCANClient object. However, other methods return a Boolean value. If such a return value is False, this indicates an error and the cause of the error can be retrieved by the LastError property of the PCANClient object. Setting properties of the PCANClient object can also produce error codes.

Example

The following example analyses and evaluates an error code and displays the corresponding text:

VBS Macro

Sub GetLongErrorTextExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

If Not client.IsRegistered Then

' Error while registering client at PCAN system

MsgBox "Error: " & client.GetLongErrorText(client.LastError)

End If

End Sub

See also

GetErrorText Method

LastError Property

LastErrorText Property


GetNetParam Method

Applies to: PCANClient object

Retrieves the value of a PCAN net parameter.

Syntax

object.GetNetParam ( NetHandle, Param, pValue )

Parameters

object

An expression that evaluates to a PCANClient object.

NetHandle

A Long value that specifies the handle of the net, for which a parameter shall be retrieved.

Param

A value of the PCANParameter enum that determines the type of the parameter to be retrieved. The following table shows all allowed parameters:

Parameter | Description
pcanParamName | A String containing the name of the net.
pcanParamBitrate | The nominal bit rate that was defined for this net (Long value). The bit rate is a 16-bit value that is used to configure the bus timing registers BTR0 and BTR1 of the SJA1000 CAN controller (only for non-FD nets).
pcanParamMsgCnt | The total number of messages that were received and sent on the net (Long value).
pcanParamBitCnt | The total number of bits that were received and sent on the net (Long value).
pcanParamNetHw | The hardware handle of the net (Long value). If the net is not connected to a hardware, the value 0 is returned.
pcanParamNetClients | A String, containing the character code 1 for any possible client handle if this is connected to the net (otherwise 0). The index of the characters in the string corresponds to the client handles.
pcanParamRcvErrFrames | A Long value that indicates whether the connected CAN hardware is configured for the reception of Error Frames. The value 1 indicates that Error Frames are received.

pValue

A pointer or reference to a Variant, which receives the parameter's value.

Return values

The GetNetParam method returns one of the following values:

  • True: Getting the specified parameter was successful.

  • False: An error occurred while getting the specified parameter. The LastError property provides information about the cause of the error.

Example

The following example retrieves the total number of messages that were received and sent on the currently connected net:

VBS Macro

Sub GetNetParamExample()

Dim client, conn, count

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

If conn.HardwareHandle > 0 Then

client.GetNetParam conn.NetHandle, pcanParamMsgCnt, count

MsgBox "Number of messages = " & count

End If

End Sub


GetOrdinal Method

Applies to: Enum object

Retrieves an ordinal from the Enum by its index.

Syntax

object.GetOrdinal ( index )

Parameters

object

An expression that evaluates to an Enum object.

index

A Long, that is the one-based index of the ordinal in the Enum.

Return values

The GetOrdinal method returns an ordinal from the Enum via its 1-based index.

Example

The following example retrieves all ordinals that are defined in the Enum "MyEnum" and shows them in the Output window:

VBS Macro

Sub GetOrdinalExample()

Dim myEnum, ord, i

Set myEnum = Enums("MyEnum")

For i = 1 To myEnum.Count

ord = myEnum.GetOrdinal(i)

PrintToOutputWindow ord

Next

End Sub

See also

FindOrdinal Method

FindString Method

GetString Method


GetParam Method

Applies to: PCANClient object

Retrieves the value of a PCAN client parameter.

Syntax

object.GetParam ( Param, pValue )

Parameters

object

An expression that evaluates to a PCANClient object.

Param

An enum of the type PCANParameter, which contains the type of the parameter to be retrieved. In the following the possible values and the meaning of the respective parameter:

Parameter | Description
pcanParamName | A String containing the name of the client.
pcanParamAccCode | The acceptance code of the message filter (Long value).
pcanParamAccMask | The acceptance mask of the message filter (Long value).
pcanParamXmtQueueFill | The number of unsent messages in the transmit queue (Long value).
pcanParamRcvQueueFill | The number of unprocessed messages in the receive queue (Long value).
pcanParamRcvMsgCnt | The total number of received messages (Long value).
pcanParamRcvBitCnt | The total number of received bits (Long value).
pcanParamXmtMsgCnt | The total number of sent messages (Long value).
pcanParamXmtBitCnt | The total number of transmitted bits (Long value).
pcanParamMsgCnt | The total number of sent and received messages (Long value).
pcanParamBitCnt | The total number of sent and received bits (Long value).
pcanParamHwnd | The window handle of the application that owns this client (Long value).
pcanParamClNets | A String, containing the character code 1 for any possible net handle if the net is connected to the client (otherwise 0). The index of the characters in the string correspond to the net handles.
pcanParamOnRcvEventHandle | Handle of the Receive event, which is triggered when a message is received (Long value).
pcanParamOnRcvEventPulse | A Long value that indicates whether the Receive event is operated in Set mode (0) or Pulse mode (1).
pcanParamSelfReceive | A Long value that indicates whether the client receives messages sent by itself.
pcanParamRcvErrFrames | A Long value that indicates whether the client is configured for the reception of Error Frames. The value 1 means that Error Frames are received.

pValue

A pointer or reference to a Variant, which receives the parameter's value.

Return values

The GetParam method returns a Boolean value:

  • True: Getting the specified parameter was successful.

  • False: An error occurred while getting the specified parameter. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example retrieves the number of messages received by the client that belongs to the first CAN connection in the project:

VBS Macro

Sub GetParamExample()

If Connections.Count > 0 Then

Dim conn, client, count

Set conn = Connections(1)

If conn.Protocol = peProtocolCAN Then

' Access the PCANClient object

Set client = conn.CommunicationObject.Parent

If client.GetParam(pcanParamRcvMsgCnt, count) Then _

MsgBox "Number of messages = " & count

End If

End If

End Sub


GetString Method

Applies to: Enum object

Retrieves a text from the Enum by its index.

Syntax

object.GetString ( index )

Parameters

object

An expression that evaluates to an Enum object.

index

A Long, that is the one-based index of the string in the Enum.

Return values

The GetString method returns a string from the Enum by its one-based index.

Example

The following example retrieves all strings that are defined in the Enum "MyEnum" and shows them in the Output window:

VBS Macro

Sub GetStringExample()

Dim myEnum, str, i

Set myEnum = Enums("MyEnum")

For i = 1 To myEnum.Count

str = myEnum.GetString(i)

PrintToOutputWindow str

Next

End Sub

See also

FindOrdinal Method

FindString Method

GetOrdinal Method


GetSystemTime Method

Applies to: J1939Node object, PCANClient object

Returns the number of Milliseconds that have elapsed since the start of Windows.

Syntax

object.GetSystemTime

Parameters

object

An expression that evaluates to a J1939Node object or a PCANClient object.

Remarks

The GetSystemTime method returns a Long value, containing the number of Milliseconds, that have passed since the start of Windows.

The value of this timer serves the PCAN system as basis for the calculation of the point of time, at which messages are sent. PCAN-Explorer provides received messages with a time stamp, which is retrieved from this timer.

Example

The following example retrieves the number of milliseconds since the start of Windows:

VBS Macro

Sub GetSystemTimeExample()

' Please make sure that the active project has at least one

' connection and that the first connection is enabled

If Connections.Count = 0 Then _

Exit Sub

Dim conn, millis

Set conn = Connections(1)

If Not conn.IsEnabled Then _

Exit Sub

If conn.Protocol = peProtocolCAN Then

' Access the PCANClient object

Dim client

Set client = conn.CommunicationObject.Parent

millis = client.GetSystemTime

ElseIf conn.Protocol = peProtocolJ1939 Then

' Access the J1939Node object

Dim node

Set node = conn.CommunicationObject

millis = node.GetSystemTime

End If

MsgBox "Elapsed time = " & millis & " ms"

End Sub


GoToLine Method

Applies to: TextSelection object

Moves the cursor position to a specific line in a document.

Syntax

object.GoToLine line [,select]

Parameters

object

An expression that evaluates to a TextSelection object.

line

A Long value, indicating the line number, to which the cursor position shall be moved. If the value peLastLine is indicated or if line is beyond the last line of the document, the last line of the document is selected.

select

(Optional) An enum of the type PeGoToLineOptions, which determines what to be done with the selection. Possible values are:

  • peSelect: Selects the whole line.

  • peMove: Moves the cursor position to the beginning of the line, but does not select any part of the line (default).

Example

The following example moves the cursor to the third line of a document and selects the whole line:

VBS Macro

Sub GoToLineExample()

' Put a text window in the foreground

' before running this macro

ActiveDocument.Selection.GoToLine 3, peSelect

End Sub


Item Method

Applies to: AddIns collection, Connections collection, Documents collection, Enums collection, OutputWindowPanes collection, MessageFilter object, MessageFilters collection, Multiplexers collection, PCANClientConnections collection, PCANMessages collection, ReceiveMessages collection, Signals collection, Symbols collection, SymbolsManager collection, TraceMessages collection, TransmitMessages collection, Variables collection, VBSMacroFiles collection, Windows collection

Retrieves a specific CAN message, connection, document, Enum, window, Signal, Symbol, Symbols collection, message filter, Multiplexer, Add-in, or VBS Macro file from a collection.

Syntax

object.Item ( index )

or

object ( index )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

index

A Variant that is a Long or String representing the appropriate object.

  • If you specify a Long, the Item method fetches the object by its 1-based index in the collection.

  • If you specify a String, it must be one of the strings described in the following table:

Returned Object String

AddIn

The Add-in's name (as defined in the Name property).

Connection

The connection' name (as defined in the Name property).

Document

The document's file name.

The file name can be given with its full path. If only the file name is indicated, PCAN-Explorer tries to find an open document with this name. If however more than one document with the same name are open, the Item method returns the document found first.

Enum

The Enum's name (as defined in the Name property).

MessageFilter

The message filter's name (as defined in the Name property).

Multiplexer

The Multiplexer's name (as defined in the Name property).

OutputWindowPane

The tab's name (as defined in the Name property).

PCANClientConnection

The name of the PCAN net, with which the object is connected (as defined in the NetName property).

Signal

The Signal's name (as defined in the Name property).

Symbol

The Symbol's name (as defined in the Name property).

Symbols

  • The Symbols file's title (as defined in the Title property).

  • The full file name of the Symbols file.

Variable

The Variable's name (as defined in the Name property).

VBSMacroFile

The VBS Macro file's display name (as defined in the DisplayName property) or the VBS Macro file's full file name (as defined in the FullName property)

Window

  • The window's title (as defined in the Caption property).

  • A GUID string, which defines the kind of the window, that shall be accessed (as defined in its property ObjectKind).
Remarks

If you specify numbers for index, do not store these for later use because the indices might change as objects are added or removed.

The Item method is the default method of a collection. Accordingly, you don't have to reference Item explicitly, as shown in the following example.

If the Item method of one of the collections PCANMessages, ReceiveMessages, TraceMessages, TransmitMessages, or of the MessageFilter object is used, the value of index must be specified as a number.

Examples

The following example prints all open documents:

VBS Macro

For num = 1 To Documents.Count

Documents(num).PrintOut

Next

The following example prints the document with the name "MyDocument":

VBS Macro

Documents("MyDocument").PrintOut

The following example sends the Multiplexer "Mux1" of the Symbol "MySymbol":

VBS Macro

Dim symbols

Set symbols = SymbolsManager("My Symbols")

symbols.Item("MySymbol").Multiplexers("Mux1").Send peSendOnce


LineDown Method

Applies to: TextSelection object

Moves the cursor position one line downward.

Syntax

object.LineDown [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+DOWN ARROW).

  • peMove: Does not extend the selection (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The LineDown method has the same effect as pressing the key DOWN ARROW.

Example

The following example extends the selection one line downward:

VBS Macro

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.LineDown peExtend

End If

See also

LineUp Method


LineUp Method

Applies to: TextSelection object

Moves the cursor position one line upward.

Syntax

object.LineUp [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+UP ARROW).

  • peMove: Does not extend the selection (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The LineDown method has the same effect as pressing the key UP ARROW.

Example

The following example extends the selection one line upward:

VBS Macro

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.LineUp peExtend

End If

See also

LineDown Method


MessageToValue Method

Applies to: Variable object

Calculates the variable's value from the data of a given CAN message.

Syntax

object.MessageToValue message

Parameters

object

An expression that evaluates to a Variable object.

message

A ReceiveMessage object, TransmitMessage object, or TraceMessage object. The object's data is used to calculate the variable value.

Return values

The MessageToValue method returns the calculated Double value.

Example

The following example shows the names and values of all Variables of the first message in the Receive List:

VBS Macro

Sub MessageToValueExample()

Dim msg, v, strMsg, val

Set msg = ReceiveMessages(1)

For Each v In msg.Multiplexer.Variables

val = v.MessageToValue(msg)

strMsg = strMsg & v.Name & " = " & val & " " & v.Unit & vbCrLf

Next

MsgBox strMsg,,msg.Symbol.Name

End Sub


MoveTo Method

Applies to: TextSelection object

Moves the cursor position to the given line and column.

Syntax

object.MoveTo line, column [,extend]

Parameters

object

An expression that evaluates to a TextSelection object.

line

A Long value, which defines the new line. Some possible values are:

  • 0: Does not move the cursor position. It stays on the current line.

  • 1: Moves the cursor position to the first line.

  • peLastLine: Moves the cursor position to the last line of the file.

column

A Long value, which defines the new column. Some possible values are:

  • 0: Does not move the cursor position. It stays on the current column.

  • 1: Moves the cursor position to the first column.

  • peEndOfLine: Moves the cursor position to the end of the line.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection.

  • peMove: Does not extend the selection (default value).

Example

The following example moves the cursor to the third column of the second line:

VBS Macro

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.MoveTo 2, 3

End If


NewProject Method

Applies to: Application object

Creates a new project.

Syntax

object.NewProject Name, Path

Parameters

object

An expression that evaluates to an Application object.

Name

A String representing the name of the new project. If the string is left blank, PCAN-Explorer automatically creates a name for the project.

Path

A String representing a path where the project shall be saved. If the specified path does not exist, the project will not be saved. The string can also be left blank if the project initially is not to be saved.

Remarks

If a project is already open, it is closed automatically. If the open project contains any unsaved elements, the project and all its elements are automatically saved before it is closed.

Example

The following creates a new project:

VBS Macro

Sub CreateProjectExample()

NewProject "MyProject", ""

End Sub


Open Method

Applies to: Documents collection

Opens a document having the indicated file name.

Syntax

object.Open ( PathName[, OpenAs] [,ReadOnly] )

Parameters

object

An expression that evaluates to a Documents collection.

PathName

A String containing the document's full file name.

The file name can contain Argument Macros.

OpenAs

(Optional) A Variant containing a String, which defines the document's type, when the document is opened. Possible values are:

  • "Text": Opens the document as text file.

  • "Auto": Opens the document in the appropriate editor (default).

ReadOnly

(Optional) A Variant containing a Boolean value, which defines, if the document shall be opened write-protected. Possible values are:

  • True: Opens the document write-protected.

  • False: Opens the document with read/write rights (default).

Return values

The method Open returns the opened Document object at successful execution.

Example

The following example opens the file C:\Users\<User Name>\Documents\PCAN-Explorer 6\Symbols\Sample.sym write-protected:

VBS Macro

Sub OpenExample()

Dim doc

Set doc = Documents.Open("$(MyDocsDir)\PCAN-Explorer 6\Symbols\Sample.sym",,True)

' Access the document here

' ...

End Sub

See also

Close Method

CloseAll Method


OpenThroughout Method

Applies to: J1939Filters collection

Opens the reception filter of a J1939Node object completely.

Syntax

object.OpenThroughout

Parameters

object

An expression that evaluates to a J1939Filters collection.

Example

The following example opens the filter of a J1939Node object so that all PGNs are received:

VBS Macro

Sub J1939_OpenThroughoutExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdPCI

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then

' Open the filter

node.Filters.OpenThroughout

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939RcvMsg")

While Not node.Read(msg)

Wait 100

Wend

' A message has been received

' ...

End If

End Sub

See also

IsOpenThroughout Property


OutputString Method

Applies to: OutputWindowPane object

Displays a text in the output window.

Syntax

object.OutputString Text

Parameters

object

An expression that evaluates to an OutputWindowPane object.

Text

A String containing the text to be displayed.

Example

The following example displays a text on a new pane in the output window:

VBS Macro

Sub OutputStringExample()

' Fetch a handle to the Output window tool

Dim win

Set win = Windows(peWindowKindOutput)

' Create handles to the Output window and its panes

Dim OW

Set OW = win.Object

' Add a new pane to the Output window

Dim OWp

Set OWp = OW.OutputWindowPanes.Add("A New Pane")

' Add a line of text to the new pane

OWp.OutputString("Some Text")

End Sub

See also

OutputWindowPane Object


PageDown Method

Applies to: TextSelection object

Moves the cursor position one page downward.

Syntax

object.PageDown [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+PGDN).

  • peMove: Does not extend the selection (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The PageDown method has the same effect as pressing the key PGDN.

Example

The following example extends the selection one page downward:

VBS Macro

Sub PageDownExample()

If ActiveDocument.Type = "Text" Then _

ActiveDocument.Selection.PageDown peExtend

End Sub

See also

PageUp Method


PageUp Method

Applies to: TextSelection object

Moves the cursor position one page upward.

Syntax

object.PageUp [extend] [, count]

Parameters

object

An expression that evaluates to a TextSelection object.

extend

(Optional) An enum of the type PeMovementOptions, which determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+PGUP).

  • peMove: Does not extend the selection (default value).

count

(Optional) A Long value indicating the number of repetitions, how many times the action shall be executed. The standard value is 1.

Remarks

The PageUp method has the same effect as pressing the key PGUP.

Example

The following example extends the selection one page upward:

VBS Macro

Sub PageUpExample()

If ActiveDocument.Type = "Text" Then _

ActiveDocument.Selection.PageUp peExtend

End Sub

See also

PageDown Method


Paste Method

Applies to: TextSelection object

Replaces the selection with the clipboard's contents.

Syntax

object.Paste

Parameters

object

An expression that evaluates to a TextSelection object.

Example

The following example replaces the selection with the clipboard's contents:

VBS Macro

Sub PasteExample()

If ActiveDocument.Type = "Text" Then _

ActiveDocument.Selection.Paste

End Sub

See also

Copy Method

Cut Method


Pause Method

Applies to: Tracer object

Pauses the recording of CAN messages.

Syntax

object.Pause

Parameters

object

An expression that evaluates to a Tracer object.

Remarks

The Pause method has only an effect if the tracer was previously started.

Example

The following example pauses the recording of CAN messages:

VBS Macro

Sub PauseExample()

If ActiveWindow.Kind = peDocumentKindTrace Then _

ActiveWindow.Object.Tracer.Pause

End Sub

See also

Start Method

Stop Method


PauseAll Method

Applies to: TransmitMessages collection

Stops the periodic sending of all corresponding CAN messages of a Transmit List.

Syntax

object.PauseAll

Parameters

object

An expression that evaluates to a TransmitMessages collection.

Example

The following example stops the periodic sending of CAN messages in the default transmit window:

VBS Macro

Sub PauseAllExample()

TransmitMessages.PauseAll

End Sub

See also

ResumeAll Method


Play Method

Applies to: Tracer object

Starts playback of CAN messages from a trace buffer or file.

Syntax

object.Start

Parameters

object

An expression that evaluates to a Tracer object.

Example

The following example loads a trace file and then starts playback of CAN messages:

VBS Macro

Sub PlayExample()

Dim doc, tracer

Set doc = Documents.Open("MyTrace.trc")

Set tracer = doc.ActiveWindow.Object.Tracer

While tracer.TraceState = peTraceLoading

Wait 50

Wend

tracer.Play

End Sub

See also

Pause Method

Stop Method


PrintOut Method

Applies to: Document object, TextDocument object

Sends a document to the current printer.

Syntax

object.PrintOut

Parameters

object

An expression that evaluates to a Document object or a TextDocument object.

Remarks

The PrintOut method does not work with documents, which are of the type Generic.

Example

The following example sends a document to the current printer:

VBS Macro

Sub PrintOutExample()

ActiveDocument.PrintOut

End Sub


PrintToOutputWindow Method

Applies to: Application object, ReceiveEvent object, TransmitEvent object

Prints text on the Macro tab of the output window.

Syntax

object.PrintToOutputWindow string

Parameters

object

An expression that evaluates to an Application object.

string

A String containing the text that shall appear on the Macro tab on the output window.

Remarks

The text processed by PrintToOutputWindow can be any text generated by the Macro. The output text typically contains data that is not shown in a message box, like debug output or information about received CAN messages.

Example

The following example iterates through the active Symbols and shows some of their details:

VBS Macro

Sub PrintToOutputWindowExample()

Dim symbols, objSymbol

Set symbols = SymbolsManager("Sample")

For Each objSymbol In symbols

PrintToOutputWindow(objSymbol.Name)

PrintToOutputWindow(objSymbol.CanId)

PrintToOutputWindow(objSymbol.Comment)

Next

End Sub


Quit Method

Applies to: Application object

Quits PCAN-Explorer.

Syntax

object.Quit

Parameters

object

An expression that evaluates to an Application object. When you use the Quit method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

Remarks

The Quit method asks the user, if changes on opened documents shall be saved before PCAN-Explorer is quit.

Example

The following example causes PCAN-Explorer to quit:

VBS Macro

Quit


Read Method [Variation 1]

Applies to: PCANMessage object

Reads a CAN message from the receive queue of the parent PCANClient object.

Syntax

object.Read ( )

Parameters

object

An expression that evaluates to a PCANMessage object.

Return values

The Read method returns a Boolean value:

  • True: A CAN message was read from the receive queue.

  • False: No CAN message was read from the receive queue, because either the queue was empty or an error occurred. The LastError property provides information about the cause of error.

Example

The following example reads a CAN message from the receive queue:

VBS Macro

Sub ReadExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

' Connect client to net TestNet

Set conn = client.Connections.Add("TestNet")

' Open the filter for message 100h

conn.RegisterMsg &H100, &H100, False, False

Dim msg

Set msg = client.Messages.Add

While msg.Read

' Insert code to evaluate the CAN messages here

Wend

End Sub

See also

Write Method


Read Method [Variation 2]

Applies to: J1939Node object

Reads a J1939 message from the receive queue of a J1939Node object.

Syntax

object.Read ( Msg )

Parameters

object

An expression that evaluates to a J1939Node object.

Msg

A J1939RcvMsg object in which the data of the received J1939 message will be stored.

Return values

The Read method returns a Boolean value:

  • True: A message was read from the receive queue.

  • False: No message was read from the receive queue, because either the queue was empty or an error occurred. The LastError property provides information about the cause of error.

Example

The following example reads a J1939 message:

VBS Macro

Sub ReadExample2()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdPCI

node.ClientName = "Macro"

' Connect node to net TestNet

node.NetName = "TestNet"

If node.Connect Then

node.Filters.OpenThroughout

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939RcvMsg")

While node.Read(msg)

' Insert code to evaluate the J1939 messages here

Wend

End If

End Sub


RegisterCallback Method [Variation 1]

Applies to: Signal object

Registers a SignalCallback object at a Signal object, which is then notified when the value of the Signal has changed. The Add-in registers a SignalCallback object by passing a pointer to its implemented COM interface IPESignalCallback to the RegisterCallback method.

If the Value property of the Signal object has changed, e.g. because a CAN message has been received, PCAN-Explorer invokes the OnChangeValue method of all the SignalCallback objects that were previously registered at the Signal object.

Syntax
C++

HRESULT _stdcall RegisterCallback(

IPESignalCallback *pCallback

);
C#

void RegisterCallback(

IPESignalCallback pCallback

);
Delphi

procedure RegisterCallback(

const pCallback: IPESignalCallback

); safecall;
Parameters

object

An expression that evaluates to a Signal object.

pCalback

A pointer to a IPESignalCallback interface whose methods are invoked to notify the SignalCallback object when conditions of the associated signal are being changed.

Remarks

The RegisterCallback method can only be invoked by Add-ins. VBScript Macros are not capable of this.

Example

The following example registers a callback interface of the signal "Speed":

Visual C++

COleVariant vSignal("RcvSymbol.Mux1.Speed");

IPESignal *pSignal = NULL;

if (SUCCEEDED(pSignals->Item(vSignal, &pSignal)))

{

pSignal->RegisterCallback(pMyCallback);

...

}

See also

Getting notified when a Signal value has changed

UnregisterCallback Method


RegisterCallback Method [Variation 2]

Applies to: ReceiveMessages collection

Registers a ReceiveCallback object at a ReceiveMessages collection, which is then notified when a CAN message is received. The Add-in registers a ReceiveCallback object by passing a pointer to the COM interface IPEReceiveCallback, which the ReceiveCallback object must implement.

When a CAN message has been received, PCAN-Explorer then invokes the OnReceive method of all ReceiveCallback objects that have been previously registered at the ReceiveMessages collection.

Syntax
C++

HRESULT _stdcall RegisterCallback(

IPEReceiveCallback *pCallback

);
C#

void RegisterCallback(

IPEReceiveCallback pCallback

);
Delphi

procedure RegisterCallback(

const pCallback: IPEReceiveCallback

); safecall;
Parameters

object

An expression that evaluates to a ReceiveMessages collection.

pCallback

A pointer to a IPEReceiveCallback interface whose OnReceive method is invoked when a CAN message has been received.

Remarks

The RegisterCallback method can only be invoked by Add-ins. VBScript Macros are not capable of this. RegisterCallback is a method of the IPEReceiveMessages interface.

Example

The following example registers a callback interface at the ReceiveMessages collection:

Visual C++

IPEConnections *pConns;

if (SUCCEEDED(m_pApp->get_Connections(&pConns)))

{

IPEReceiveMessages *pRcvMsgs;

if (SUCCEEDED(pConns->get_ReceiveMessages(&pRcvMsgs)))

{

pRcvMsgs->RegisterCallback(pMyCallback);

...

}

}

See also

UnregisterCallback Method


RegisterCallback Method [Variation 3]

Applies to: TransmitMessages collection

Registers a TransmitCallback object at a TransmitMessages collection, which is then notified when a CAN message are transmitted. The Add-in registers a TransmitCallback object by passing a pointer to the COM interface IPETransmitCallback, which the TransmitCallback object must implement.

When a CAN message is transmitted, PCAN-Explorer invokes the methods OnBeforeTransmit and OnAfterTransmit of all TransmitCallback objects that have been previously registered at the TransmitMessages collection.

Syntax
C++

HRESULT _stdcall RegisterCallback(

IPETransmitCallback *pCallback,

PeTransmitCallbackMask mask

);
C#

void RegisterCallback(

IPETransmitCallback pCallback,

PeTransmitCallbackMask mask

);
Delphi

procedure RegisterCallback(

const pCallback: IPETransmitCallback;

mask: PeTransmitCallbackMask

); safecall;
Parameters

object

An expression that evaluates to a ReceiveMessages collection.

pCallback

A pointer to a IPETransmitCallback interface, the methods of which are invoked when conditions of the associated CAN message are being changed.

mask

A combination of values from the PETransmitCallbackMask enum. The specified values determine which methods of the IPETransmitCallback interface are invoked when the corresponding event occurs. An Add-in typically does not need to handle all available events, and will configure the mask to only get those methods called that it requires to perform its special tasks.

The PETransmitCallbackMask enum has the following values:

  • peOnBeforeTransmit (1): The OnBeforeTransmit method is called before a message is transmitted.

  • peOnAfterTransmit (2): The OnAfterTransmit method is called after a message has been transmitted.

  • peOnResume (4): The OnResume method is called when a periodic transmit message is being resumed.

  • peOnPause (8): The OnPause method is called when a periodic transmit message is halted.

  • peOnReset (16): The OnReset method is called when the Reset command has been executed for a connection. The OnReset method is then called for all transmit messages associated with the connection for which the Reset command has been executed.

Remarks

The RegisterCallback method can only be invoked by Add-ins. VBScript Macros are not capable of this. RegisterCallback is a method of the IPETransmitMessagesEx interface.

Example

The following example registers a callback interface at the TransmitMessages collection and configures calling of the methods OnBeforeTransmit and OnReset.

Visual C++

IPETransmitMessages *pXmtMsgs;

if (SUCCEEDED(m_pApp->get_TransmitMessages(&pXmtMsgs)))

{

IPETransmitMessagesEx *pXmtMsgsEx;

if (SUCCEEDED(pXmtMsgs->QueryInterface(IID_IPETransmitMessagesEx, (void**) &pXmtMsgsEx)))

{

pXmtMsgsEx->RegisterCallback(

pMyCallback,

(PeTransmitCallbackMask)(peOnBeforeTransmit | peOnReset));

...

}

}
C#

public class TransmitCallbacks : IPETransmitCallback

{

...

public void Register(IPEApplication app)

{

(app.TransmitMessages as IPETransmitMessagesEx).RegisterCallback(

this as IPETransmitCallback,

PeTransmitCallbackMask.peOnBeforeTransmit | PeTransmitCallbackMask.peOnReset);

...

}

}

See also

UnregisterCallback Method


Register Method

Applies to: PCANClient object

Registers a PCAN client at a PCAN device.

Syntax

object.Register

Parameters

object

An expression that evaluates to a PCANClient object.

Return values

The Register method returns one of the following values:

  • True: The client has been successfully registered at the device.

  • False: The client couldn't be registered at the device. The LastError property of the PCANClient object provides information about the cause of the error.

Remarks

Before a PCANClient object can be registered at a PCAN device, the Device property must contain the name of a PCAN device that is installed and loaded. Furthermore, a client name must be assigned to its Name property.

Example

The following example creates a new PCAN client and registers it at the pcan_usb device:

VBS Macro

Sub RegisterExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.AutoRegister = False

client.Device = "pcan_usb"

client.Name = "Macro"

' Auto-register is diabled, the following line

' registers the client manually

If client.Register Then

' ...

MsgBox "Press OK to remove client"

End If

End Sub

See also

Remove Method


RegisterMsg Method

Applies to: PCANClientConnection object

Opens the reception filter of a PCAN client object and of a connected CAN hardware so far as the specified range of CAN messages can pass the filter.

Syntax

object.RegisterMsg ( ID1, ID2, Ext1, Ext2 )

Parameters

object

An expression that evaluates to a PCANClientConnection object.

ID2

A Long value indicating the lower CAN ID of the range.

ID2

A Long value indicating the upper CAN ID of the range.

Ext1

A Boolean value that determines if the lower CAN ID represents a 29-bit CAN ID.

Ext2

A Boolean value that determines if the upper CAN ID represents a 29-bit CAN ID.

Return values

The RegisterMsg method returns a Boolean value:

  • True: The reception filter has been successfully configured.

  • False: The reception filter could not be configured. The LastError property of the parent PCANClient object provides information about the cause of error.

Example

The following example configures the reception filter of a custom PCAN client to receive all messages in the range of 100h to 200h:

VBS Macro

Sub RegisterMsgExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

conn.RegisterMsg &H100, &H200, False, False

' ...

End Sub

See also

ResetFilters Method


ReleaseAddress Method

Applies to: J1939Node object

Releases a previously claimed J1939 address.

Syntax

object.ReleaseAddress

Parameters

object

An expression that evaluates to a J1939Node object.

Return values

The ReleaseAddress method returns one of the following values:

  • True: Releasing the address was successful.

  • False: An error occurred while releasing the address. The LastError property of the J1939Node object provides information about the cause of the error.

See also

ClaimAddress Method


Remove Method [Variation 1]

Applies to: Connections collection, J1939Filters collection, PCANClientConnections collection, Enums collection, MessageFilters collection, Messages collection, ReceiveMessages collection, Signals collection, TransmitMessages collection

Removes an object from its parent collection.

Syntax

object.Remove ( Value )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

Value

The object that shall be removed from the collection.

Example

The following example adds a new Signal object to the Signals collection and removes it again later:

VBS Macro

Dim mySignal

Set mySignal = Signals.Add("MySignal")

...

Signals.Remove mySignal


Remove Method [Variation 2]

Applies to: PCANClient object

Removes a PCAN client from a PCAN device.

Syntax

object.Remove

Parameters

object

An expression that evaluates to a PCANClient object.

Return values

The Remove method returns one of the following values:

  • True: The client has been removed from the PCAN device.

  • False: The client couldn't be removed from the PCAN device. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example creates a new PCAN client and disconnects it from the PCAN device after a short pause:

VBS Macro

Sub RemoveExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

' Auto-register is enabled, the following line

' registers the client

client.Name = "Macro"

If client.IsRegistered Then

MsgBox "Press OK to remove client"

If client.Remove Then

MsgBox "Client removed"

' ...

End If

End If

End Sub

See also

Register Method


RemoveItem Method

Applies to: MessageFilter object, Project object, ProjectItems collection

Removes a project item from an object or collection.

Syntax

object.RemoveItem ( item )

Parameters

object

An expression that evaluates to one of the objects in the Applies To list above.

item

The ProjectItem object to be removed.

Example

The following example adds and removes a message filter to and from the current project:

VBS Macro

Sub RemoveItemExample()

Dim item

Set item = ActiveProject.AddItem("MyFilter", _

peProjectItemKindMessageFilter);

MsgBox "Item added",,"Macro"

ActiveProject.RemoveItem(item);

MsgBox "Item removed",,"Macro"

End Sub


RenameItem Method

Applies to: ProjectItems collection

Renames a project item.

Syntax

object.RenameItem ( OldName, MewName )

Parameters

object

An expression that evaluates to a ProjectItems collection.

OldName

The old name of the project item to be renamed.

NewName

The new name for the project item.

Remarks

Renaming the item will fail if a project item with the same name already exists in the collection.

Example

The following example adds a message filter and then renames it:

VBS Macro

Sub RenameItemExample()

Dim item

Set item = ActiveProject.AddItem("Test", _

peProjectItemKindMessageFilter);

MsgBox "Item added",,"Macro"

ActiveProject.RenameItem("Test", "MyFilter");

MsgBox "Item renamed",,"Macro"

End Sub


Reset Method [Variation 1]

Applies to: PCANClient object

Deletes the contents of a PCAN client's receive queue.

Syntax

object.Reset

Parameters

object

An expression that evaluates to a PCANClient object.

Example

The following example clears the receive queue of a PCAN client:

VBS Macro

Sub ResetExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

' Open the filter

conn.RegisterMsg 0, &H7FF, False, False

' Messages are being received

' ...

client.Reset ' Receive queue is now empty

' ...

End Sub

See also

ResetFilters Method

ResetHardware Method


Reset Method [Variation 2]

Applies to: J1939Node object

Resets the object. Resets the configured filter, deletes the contents of the Receive Queue, and resets the connected CAN Hardware.

Syntax

object.Reset

Parameters

object

An expression that evaluates to a J1939Node object.

Example

The following example resets a J1939 node:

VBS Macro

Sub ResetExample2()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdPCI

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then

' Open the filter

node.Filters.OpenThroughout

' Messages are being received

' ...

node.Reset ' Filter is now closed, Receive queue is empty

' ...

End If

End Sub


ResetFilters Method

Applies to: PCANClient object

Closes the reception filter of the PCAN client so that no more CAN messages can pass the filter.

Syntax

object.ResetFilters

Parameters

object

An expression that evaluates to a PCANClient object.

Example

The following example closes the reception filter of a custom PCAN client:

VBS Macro

Sub ResetFiltersExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

conn.RegisterMsg &H100, &H200, False, False

' Now messages from 100h to 200h are received

' ...

client.ResetFilters

' Now no more messages are received

' ...

End Sub

See also

RegisterMsg Method


ResetHardware Method

Applies to: PCANClientConnection object

Carries out a reset of a connected CAN hardware.

Syntax

object.ResetHardware

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Example

The following example resets a CAN hardware:

VBS Macro

Sub ResetHardwareExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

' Use the connection here, e.g. send messages

' ...

conn.ResetHardware

' ...

End Sub


ResumeAll Method

Applies to: TransmitMessages collection

Resumes the periodic sending of all messages in a Transmit List.

Syntax

object.ResumeAll

Parameters

object

An expression that evaluates to a TransmitMessages collection.

Example

The following example resumes the periodic sending of CAN messages in the default transmit window:

VBS Macro

Sub ResumeAllExample()

TransmitMessages.ResumeAll

End Sub

See also

PauseAll Method


Save Method

Applies to: Document object, Project object, TextDocument object

Saves a document or project in a file.

Syntax

object.Save ( [FullName] [, PromptUser] )

Parameters

object

An expression that evaluates to a Document object, a Project object, or a TextDocument object.

FullName

(Optional) A Variant containing a String that specifies the file name including the path in which the document shall be saved. If the name is omitted, the name stored in the FullName property is used.

PromptUser

(Optional) A Variant containing a Boolean that specifies whether the user is prompted to save pending changes. Possible values are:

  • True: Prompts the user to save pending changes.

  • False: Does not prompt the user to save pending changes (default).

Return values

The Save method of the Document object or the TextDocument object returns a PeSaveStatus enum value having one of the following values:

  • peSaveSucceeded (1): The user has saved the pending changes of the document or has chosen to discard the changes.

  • peSaveCanceled (2): The user has canceled the save operation.

The Save method of the Project object returns a Boolean value:

  • True: The project has been saved successfully.

  • False: The user has canceled the save operation.

Example

The following example saves a document to "C:\Documents\MyDoc.txt":

VBScript

Dim result

result = ActiveDocument.Save("C:\Documents\MyDoc.txt")


SaveAll Method

Applies to: Documents collection

Saves all open documents.

Syntax

object.SaveAll ( [PromptUser] )

Parameters

object

An expression that evaluates to a Documents collection.

PromptUser

(Optional) A Variant containing a Boolean that specifies whether the user is prompted to save pending changes. Possible values are:

  • True: Prompts the user to save pending changes.

  • False: Does not prompt the user to save pending changes (default).

Return values

The method SaveAll returns a PeSaveStatus enum value having one of the following values:

  • peSaveSucceeded (1): The user has saved the pending changes on all open documents or has chosen to discard the changes.

  • peSaveCanceled (2): The user has canceled the save operation.

Example

The following example prompts the user, to confirm the saving of changes on all open documents:

VBScript

Documents.SaveAll (True)


SaveAs Method

Applies to: Project object

Saves a project under a new name.

Syntax

object.SaveAs ( FullName )

Parameters

object

An expression that evaluates to a Project object.

FullName

A String that specifies the file name including the path in which the project shall be saved.

Return values

The SaveAs method returns a Boolean value:

  • True: The project has been saved successfully.

  • False: The user has canceled the save operation.

Example

The following example saves a document to "C:\Documents\MyDoc.txt":

VBScript

Dim result

result = ActiveProject.SaveAs("C:\Projects\MyProject.peproj")


SelectAll Method

Applies to: TextSelection object

Extends the selection so that the whole document is included.

Syntax

object.SelectAll

Parameters

object

An expression that evaluates to a TextSelection object.

Example

The following example extends the selection to the whole document:

VBScript

If ActiveDocument.Type = "Text" Then

ActiveDocument.Selection.SelectAll

End If


SelectSignal Method

Applies to: Signals collection

Shows a dialog box for selecting of a signal.

Syntax

object.SelectSignal ( Signal )

Parameters

object

An expression that evaluates to a Signals collection.

Signal

(Optional) A Signal object, that is marked as selected in the selection dialog box, to indicate that it has been selected before.

Return values

The SelectSignal method returns a Signal object, if the user has selected a signal. If the user closes the dialog box without selecting a signal, in VBScript the SelectSignal method returns the value Nothing. In Visual C++ this corresponds to the value NULL, and in C# to the value null.

Example

The following example gives the user the possibility to select a signal from the existing ones:

VBS Macro

Sub SelectSignalExample()

Dim mySignal

Set mySignal = Signals.SelectSignal()

If Not mySignal Is Nothing Then

' Code to evaluate the signal

MsgBox mySignal.Name,,"Selected Signal"

End If

End Sub


SelectSignals Method

Applies to: Signals collection

Shows a dialog box for selecting one or multiple signals.

Syntax

object.SelectSignals

Parameters

object

An expression that evaluates to a Signals collection.

Return values

The SelectSignals method returns a Variant that contains an array of Signal objects.

Example

The following example gives the user the possibility to select some signals from the existing ones. The names of the selected signals are shown in the Output window.

VBS Macro

Sub SelectSignalsExample()

Dim result, signal

result = Signals.SelectSignals

For Each signal In result

PrintToOutputWindow signal.Name

Next

End Sub


Send Method

Applies to: Multiplexer object

Sends a CAN message on the selected bus/connection.

Syntax

object.Send ( bus, [options] [, CycleTime] )

Parameters

object

An expression that evaluates to a Multiplexer object.

bus

The number of the bus (1-16) in the project, on which the message shall be sent.

If bus is set to 0, the message is sent on all the buses, which include the multiplexer.

If a bus is specified that does not include the multiplexer, no message is sent.

options

(Optional) A PeSendOptions constant indicating how the message shall be sent. Possible values are:

  • peSendOnce (0): Sends the message only once (default).

  • peSendPeriodic (1): Sends the message periodically.

  • peSendWait (2): Only creates an entry in the Transmit List, but does not actually send the message.

CycleTime

(Optional) A Long that defines the sending period of the message. If this parameter is omitted and the options parameter is set to peSendPeriodic, the value of the CycleTime property of the Multiplexer object is used as sending period.

Return value

If successful, the Send method returns a TransmitMessage object.

Examples

The following example creates a transmit message for the Symbol "MySymbol" in the Transmit List, sets some variable values, and sends the message once:

VBS Macro

Sub SendSymbolExample()

Dim sym, msg

Set sym = SymbolsManager("MySymbols").Item("MySymbol")

Set msg = sym.DefaultMultiplexer.Send(1, peSendWait)

msg.VariableValue("MyVariable") = 123

msg.VariableValue("MyOtherVar") = 4.56

msg.Write 0

End Sub

The following example sends the multiplexer "Mux1" of the symbol "MySymbol" periodically every 100 ms on bus 1:

VBS Macro

Sub SendMultiplexerExample()

Dim sym

Set sym = SymbolsManager("MySymbols").Item("MySymbol")

sym.Multiplexers("Mux1").Send 1, peSendPeriodic, 100

End Sub

The following example sends the multiplexer "Mux1" of the symbol "MySymbol" periodically as Remote Transmission Request on bus 1:

VBS Macro

Sub SendRTRExample()

Dim sym, msg

Set sym = SymbolsManager("MySymbols").Item("MySymbol")

Set msg = sym.Multiplexers("Mux1").Send(1, peSendWait)

msg.MsgType = msg.MsgType Or pcanMsgTypeRTR

msg.CycleTime = 100

msg.IsPaused = False

End Sub

See also

Write Method


SetAddInInfo Method

Applies to: Application object

Transfers information about an Add-in to PCAN-Explorer when the Add-in is loaded. The Add-in calls SetAddInInfo.

Syntax
C++

HRESULT _stdcall SetAddInInfo(

long nInstanceHandle,

IDispatch *bCmdDispatch,

long nGraphicsResourceID,

long nGraphicsOffset,

long dwCookie

);
C#

void SetAddInInfo(

int nInstanceHandle,

object pCmdDispatch,

int nGraphicsResourceID,

int nGraphicsOffset,

int dwCookie

);
Delphi

procedure SetAddInInfo(

nInstanceHandle: Integer;

const pCmdDispatch: IDispatch;

nGraphicsResourceID: Integer;

nGraphicsOffset: Integer;

dwCookie: Integer

); stdcall;
Parameters

nInstanceHandle

The HINSTANCE handle of the Add-in DLL.

pCmdDispatch

The pointer to the dispatch interface (dispinterface), which is implemented by the Commands object of the Add-in. If the user selects one of the Add-in commands, PCAN-Explorer executes the command by using this pointer for communication with the Add-in.

nGraphicsResourceID

The bitmap resource ID containing all bitmaps of the toolbar buttons and menu commands, which are added by the Add-in. If the Add-in does not provide toolbar and command images, -1 must be submitted.

nGraphicsOffset

The offset or index of the image in the bitmap resource that represents the Add-in itself. If an Add-in adds more than one command, PCAN-Explorer creates a submenu in the Tools menu that groups the commands. The image that is displayed for the submenu item is determined by this value.

cookie

A value that specifies the Add-in's unique ID. PCAN-Explorer submits this value to the Add-in by the OnConnection method of the Add-in.

Remarks

Only Add-ins can invoke the method SetAddInInfo, VBScript Macros are not able to do this.

Examples

The following code examples invoke the SetAddInInfo method:

Visual C++

STDMETHODIMP CPEAddIn::OnConnection(IDispatch* pApp, VARIANT_BOOL bFirstTime,

long dwCookie, VARIANT_BOOL * res)

{

...

if (FAILED(pApplication->SetAddInInfo(

(long) AfxGetInstanceHandle(),

(LPDISPATCH) m_pCommands,

IDB_TOOLBAR,

0,

dwCookie))

{

*OnConnection = VARIANT_FALSE;

return;

}

...

}
C#

public bool OnConnection(object app, bool firstTime, int cookie)

{

...

try

{

IntPtr instanceHandle = Marshal.GetHINSTANCE(this.GetType().Module);

this.app.SetAddInInfo(

instanceHandle.ToInt32(),

commandsObject,

toolbarBitmapID,

0,

cookie);

}

catch

{

return false;

}

...

}
Delphi

function TPEAddIn.OnConnection(const pApp: IDispatch; bFirstTime: WordBool;

dwCookie: Integer; out res: WordBool): HResult;

begin

...

if Failed(pApp.SetAddInInfo(

HInstance,

FCommands,

IDB_TOOLBAR,

0,

dwCookie) Then

begin

res := False;

Result := S_OK;

end;

...

end;

See also

OnConnection Method


SetDriverParam Method

Applies to: PCANClient object

Sets a PCAN driver parameter.

Syntax

object.SetDriverParam ( Param, Value )

Parameters

object

An expression that evaluates to a PCANClient object.

Param

An enum of the type PCANParameter, which contains the type of the parameter to be set. The SetDriverParam method supports the following parameters:

Parameter | Description
pcanParamRcvQueueSize | Specifies the size of Receive Queues (default = 32768)
pcanParamXmtQueueSize | Specifies the size of Transmit Queues (default = 32768)
pcanParamAutoBusOn | Sets whether a CAN hardware is automatically set into a passive BUS-ON mode after its CAN controller reached the BUS-OFF state. 0 = Auto-BUS-ON disabled, 1 = Auto-BUS-ON enabled (default)

Value

A Long value that contains the parameter value.

Return values

The SetDriverParam method returns one of the following values:

  • True: Setting the specified parameter was successful.

  • False: An error occurred while setting the specified parameter. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example disables the Auto-BUS-ON feature of the pcan_usb device:

VBS Macro

Sub SetDriverParamExample()

Dim client, value

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.SetDriverParam pcanParamAutoBusOn, 0

End Sub

See also

GetDriverParam Method


SetFilter Method

Applies to: PCANClientConnection object

Configures the receive filter of the connection.

Syntax

object.SetFilter ( Extended, AccCode, AccMask )

Parameters

object

An expression that evaluates to a PCANClientConnection object.

Extended

Specifies whether the AccCode/AccMask values have a size of 11-bit (Extended = 0), or 29-bits (Extended = 1).

AccCode

The acceptance code is part of the acceptance filter of the SJA1000. See also Philips Data Sheet "SJA1000 Stand-alone CAN controller".

AccMask

The acceptance mask is part of the acceptance filter of the SJA1000. See also Philips Data Sheet "SJA1000 Stand-alone CAN controller".

Return values

The SetFilter method returns a Boolean value:

  • True: The filter has been successfully configured.

  • False: An error occurred while configuring the filter. The LastError property of the parent PCANClient object provides information about the cause of the error.

Remarks

The SetFilter method is particularly adapted to the SJA1000 CAN controller. The reception filter can also be configured with the RegisterMsg method.

See also

RegisterMsg Method


SetHardwareParam Method

Applies to: PCANClient object

Configures different parameters of a CAN hardware.

Syntax

object.SetHardwareParam ( HardwareHandle, Param, Value )

Parameters

object

An expression that evaluates to a PCANClient object.

HardwareHandle

A Long value that indicates the handle of the hardware, for which a parameter shall be configured.

Param

An enum of the type PCANParameter, which contains the type of the parameter to be configured. The following parameters are allowed:

Parameter | Description
pcanParamBitrate | A Long value, which sets the bit rate of the CAN controller. The bit rate is a 16-bit value that is used to configure the bus timing registers BTR0 and BTR1 of an SJA1000 CAN controller (only for non-FD bit rates).
pcanParamListenOnly | A Long value, which enables or disables the Listen-only mode of an attached CAN hardware. 1 = Listen-only enabled, 0 = Listen-only disabled.

Value

A Long value that contains the parameter value.

Return values

The SetHardwareParam method returns one of the following values:

  • True: The specified parameter has been successfully configured.

  • False: The specified parameter could not be configured. The LastError property of the PCANClient object provides information about the cause of the error.

Example

The following example creates a new PCAN client, connects it to the PCAN net "TestNet" on the PCAN-USB device, and sets the bit rate of the attached CAN hardware to 500 kbit/s:

VBS Macro

Sub SetHardwareParamExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

If conn.HardwareHandle > 0 Then _

client.SetHardwareParam conn.HardwareHandle, pcanParamBitrate, &H001C

' ...

End Sub

See also

GetHardwareParam Method


SetNetParam Method

Applies to: PCANClient object

Configures different parameters of PCAN nets.

Syntax

object.SetNetParam ( NetHandle, Param, Value )

Parameters

object

An expression that evaluates to a PCANClient object.

NetHandle

A Long value that specifies the handle of the net, for which a parameter shall be configured.

Param

A value of the PCANParameter enum that determines the type of the parameter to be set. In the following the possible values and the meaning of the respective parameter:

Parameter | Description
pcanParamBitrate | A Long value, which sets the bit rate for this net (Long value). The bit rate is a 16-bit value that is used to configure the bus timing registers BTR0 and BTR1 of an SJA1000 CAN controller (only for non-FD nets).
pcanParamDelayedMessageDistribution | A Long value, which determines whether a transmitted CAN message is sent to other clients on the same net only when the message has actually been sent by the CAN controller on the physical CAN bus.

Value

A Long value, which holds the parameter's value.

Return values

The SetNetParam method returns a Boolean value:

  • True: The specified parameter has been set successfully.

  • False: The specified parameter could not be set. The LastError property provides information about the cause of error.

Example

The following example configures a parameter of the net "TestNet":

VBS Macro

Sub SetNetParamExample()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

Set conn = client.Connections.Add("TestNet")

If conn.HardwareHandle > 0 Then

client.SetNetParam conn.NetHandle, _

pcanParamDelayedMessageDistribution, 1

End If

End Sub


SetParam Method

Applies to: PCANClient object

Configures different parameters of the PCAN client.

Syntax

object.SetParam ( Param, Value )

Parameters

object

An expression that evaluates to a PCANClient object.

Param

A value of the PCANParameter enum that determines type of the parameter to be set. The following table shows all allowed parameters:

Parameter | Description
pcanParamOnRcvEventHandle | A Long value that specifies the handle of an event synchronization object. The event is set to signalled when a message is received.
pcanParamOnRcvEventPulse | A Long value that specifies the trigger mode of the reception event. 0 = Set, 1 = Pulse.
pcanParamSelfReceive | A Long value that specifies whether the client receives CAN messages it has sent itself. 0 = The client does not receive messages it has sent itself 1 = The client receives messages it has sent itself
pcanParamRcvErrFrames | A Long value that specifies whether the reception of Error Frames is activated. 0 = Error Frames deactivated 1 = Error Frames activated

Value

A Variant, which holds the parameter's value.

Return values

The SetParam method returns a Boolean value:

  • True: The specified parameter has been set successfully.

  • False: The specified parameter could not be set. The LastError property provides information about the cause of error.

Example

The following example configures the client to receive messages it has sent itself:

VBS Macro

Sub SetParamExample()

Dim client

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

client.SetParam pcanParamSelfReceive, 1

' ...

End Sub


ShowFilterDialog Method

Applies to: MessageFilter object

Shows the Edit Filter dialog box for a message filter.

Syntax

object.ShowFilterDialog

Parameters

object

An expression that evaluates to a MessageFilter object.

Return values

The ShowFilterDialog method returns a Boolean value:

  • True: The dialog box has been closed with OK.

  • False: The user has canceled the dialog box, no filter settings have been changed.

Example

The following example shows the filter settings of the first message filter in the project:

VBS Macro

Sub ShowFilterDialogExample()

Dim result

result = MessageFilters.ShowFilterDialog

If result Then

MsgBox "User pressed OK",,"Macro"

Else

MsgBox "User pressed Cancel",,"Macro"

End If

End Sub


Start Method

Applies to: Tracer object

Starts the recording of CAN messages.

Syntax

object.Start

Parameters

object

An expression that evaluates to a Tracer object.

Example

The following example starts the recording of CAN messages:

VBS Macro

Sub StartExample()

If ActiveWindow.Kind = peDocumentKindTrace Then _

ActiveWindow.Object.Tracer.Start

End Sub

See also

Pause Method

Stop Method


StartOfLine Method

Applies to: TextSelection object

Moves the cursor position to the beginning of a line.

Syntax

object.StartOfLine [moveto][,extend]

Parameters

object

An expression that evaluates to a TextSelection object.

moveto

(Optional) A value of the PeStartOfLineOptions enum that determines what to be done with the selection. Possible values are:

  • peFirstColumn: Moves the cursor to the first column of the line (default).

  • peFirstText: Moves the cursor to the first character in the line.

extend

(Optional) A value of the PeMovementOptions enum that determines what to be done with the selection. Possible values are:

  • peExtend: Extends the selection (this corresponds to the key combination SHIFT+HOME).

  • peMove: Does not extend the selection (default value).

Example

The following example moves the cursor position to the beginning of the line and extends the selection:

VBS Macro

Sub StartOfLineExample()

If ActiveDocument.Kind = peDocumentKindText Then _

ActiveDocument.Selection.StartOfLine ,peExtend

End Sub


Stop Method

Applies to: Tracer object

Ends the recording of CAN messages.

Syntax

object.Stop

Parameters

object

An expression that evaluates to a Tracer object.

Remarks

The Stop method has only an effect if the tracer was previously started.

Example

The following example ends the recording of CAN messages:

VBS Macro

Sub StoptExample()

If ActiveWindow.Kind = peDocumentKindTrace Then _

ActiveWindow.Object.Tracer.Stop

End Sub

See also

Start Method

Pause Method


TimeToString Method

Applies to: Application object

Formats a Date/Time value.

Syntax

object.TimeToString( DateTime, Format )

Parameters

object

An expression that evaluates to an Application object. When you access the TimeToString method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

DateTime

A DATE value containing a valid Date/Time.

Format

(Optional) A Variant containing a String that determines the format of the returned Date/Time.

If this parameter is omitted, the format of the returned Date/Time string is determined by the TimeFormat property.

For a list of possible format specifiers, see TimeFormat property.

Return value

A String containing the formatted Date/Time value.

Example

The following example displays the current PCAN-Explorer time:

VBScript

MsgBox TimeToString(CurrentTime, "ddd dd, hh:nn:ss am/pm"),,"Current Time"


TranslateFileName Method

Applies to: Documents collection

Translates a file name, which contains Argument Macros, into an actual file name.

Syntax

object.TranslateFileName ( FileName )

Parameters

object

An expression that evaluates to a Documents collection.

FileName

A String containing the file name that shall be translated.

Return values

The method TranslateFileName returns a String with a file name, in which all known Argument Macros were translated against actual directory names.

Example

The following example displays the actual file name of the example Symbol file "Sample.sym", which is located in a subdirectory of the "Documents" directory of the current user:

VBS Macro

Sub TranslateFileNameExample()

Dim path

path = Documents.TranslateFileName("$(MyDocsDir)\PCAN-Explorer 6\Symbols\Sample.sym")

MsgBox path

End Sub


UnregisterCallback Method [Variation 1]

Applies to: Signal object

Removes the registration of a SignalCallback object from a Signal object. After the registration has been removed, the SignalCallback object is no longer notified when the value of the signal changes.

Syntax
C++

HRESULT _stdcall UnregisterCallback(

IPESignalCallback *pCallback

);
C#

void UnregisterCallback(

IPESignalCallback pCallback

);
Delphi

procedure UnregisterCallback(

const pCallback: IPESignalCallback

); safecall;
Parameters

object

An expression that evaluates to a Signal object.

pCallback

The same pointer to a IPESignalCallback interface that was previously provided when calling the RegisterCallback method.

Remarks

The Add-in must undo the registration of the SignalCallback object in any case by invoking the UnregisterCallback method, at latest when the Add-in is disconnected from PCAN-Explorer or if the Symbols are closed that were responsible for creating the Signal.

The method UnregisterCallback can only be invoked by Add-ins. VBScript Macros are not capable of this.

Example

The following example removes the registration of the callback interface from the signal "Speed":

Visual C++

COleVariant vSignal("RcvSymbol.Mux1.Speed");

IPESignal *pSignal = NULL;

if (SUCCEEDED(pSignals->Item(vSignal, &pSignal)))

{

pSignal->UnrgisterCallback(m_pCallback);

...

}

See also

Removing a Notification about a Signal value change

RegisterCallback Method


UnregisterCallback Method [Variation 2]

Applies to: ReceiveMessages collection

Removes the registration of a ReceiveCallback object from a ReceiveMessages collection. After the registration has been removed, the ReceiveCallback object is no longer notified when a CAN message is received.

Syntax
C++

HRESULT _stdcall UnregisterCallback(

IPEReceiveCallback *pCallback

);
C#

void UnregisterCallback(

IPEReceiveCallback pCallback

);
Delphi

procedure UnregisterCallback(

const pCallback: IPEReceiveCallback

); safecall;
Parameters

object

An expression that evaluates to a ReceiveMessages collection.

pCallback

The same pointer to a IPEReceiveCallback interface that was previously provided when calling the RegisterCallback method.

Remarks

The Add-in must undo the registration of the ReceiveCallback object in any case by invoking the UnregisterCallback method, at latest when the Add-in is disconnected from PCAN-Explorer.

The UnregisterCallback method can only be invoked by Add-ins. VBScript Macros are not capable of this.

Example

The following example removes the registration of the callback interface from the ReceiveMessages collection:

Visual C++

IPEConnections *pConns;

if (SUCCEEDED(m_pApp->get_Connections(&Conns)))

{

IPEReceiveMessages *pRcvMsgs;

if (SUCCEEDED(pConns->get_ReceiveMessages(&pRcvMsgs)))

{

pRcvMsgs->UnregisterCallback(m_pCallback);

...

}

}

See also

RegisterCallback Method


UnregisterCallback Method [Variation 3]

Applies to: TransmitMessages collection

Removes the registration of a TransmitCallback object from a TransmitMessages collection. After the registration has been removed, the TransmitCallback object is no longer notified when a CAN messages are transmitted.

Syntax
C++

HRESULT _stdcall UnregisterCallback(

IPETransmitCallback *pCallback

);
C#

void UnregisterCallback(

IPETransmitCallback pCallback

);
Delphi

procedure UnregisterCallback(

const pCallback: IPETransmitCallback

); safecall;
Parameters

object

An expression that evaluates to a ReceiveMessages collection.

pCallback

The same pointer to a IPETransmitCallback interface that was previously provided when calling the RegisterCallback method.

Remarks

The Add-in must undo the registration of the TransmitCallback object in any case by invoking the UnregisterCallback method, at latest when the Add-in is disconnected from PCAN-Explorer.

The UnregisterCallback method can only be invoked by Add-ins. VBScript Macros are not capable of this. UnregisterCallback is a method of the IPETransmitMessagesEx interface.

Example

The following example removes the registration of the callback interface from the TransmitMessages collection:

Visual C++

IPETransmitMessages *pXmtMsgs;

if (SUCCEEDED(m_pApp->get_TransmitMessages(&pXmtMsgs)))

{

IPETransmitMessagesEx *pXmtMsgsEx;

if (SUCCEEDED(pXmtMsgs->QueryInterface(IID_IPETransmitMessagesEx, (void**) &pXmtMsgsEx)))

{

pXmtMsgsEx->UnregisterCallback(m_pCallback);

...

}

}

See also

RegisterCallback Method


UpdateSymbols Method

Applies to: SymbolsManager collection

Updates symbols definitions that are stored in a specific document.

Syntax

object.UpdateSymbols ( doc )

Parameters

object

An expression that evaluates to a SymbolsManager collection.

doc

A Document object that contains new symbols definitions.

Remarks

Usually, the document is a text document that has the ".sym" file extension.

PCAN-Explorer uses this method internally to update the symbols definitions when you execute the Apply command for a symbols file.


Wait Method

Applies to: Application object

Waits for the given number of milliseconds.

Syntax

object.Wait ( Time )

Parameters

object

An expression that evaluates to an Application object. When you use the Wait method of the Application object, you can omit object because the name of the Application object is implied when you access its properties and methods.

Time

A Long value, indicating the number of milliseconds, which to wait for.

Remarks

The Wait method serves VBScript Macros for waiting a defined time. VBScript does not have a predefined function for this task.

Example

The following example waits until the transmit message queue of a PCAN client is empty.

VBS Macro

While Not myClient.XmtQueueEmpty

Wait 500

Wend


Write Method [Variation 1]

Applies to: TransmitMessage object

Sends a message.

Syntax

object.Write ( Time )

Parameters

object

An expression that evaluates to a TransmitMessage object.

Time

The point of time at which the message shall be sent. For CAN messages, the current time can be retrieved with the method GetSystemTime of the PCANClient object.

If Time is smaller than or equal to the current time, the message is sent immediately.

If Time is higher than the current time, the message will be put into the transmit message queue.

Attention: This parameter has no effect if the message is a J1939 message. J1939 messages are always sent immediately.

Return values

The Write method returns a Boolean value:

  • True: The message was written into the transmit message queue, or sent immediately.

  • False: An error occurred while sending the message. The properties LastError and LastErrorType provide information about the cause of the error.

Example

The following example creates a new CAN message 100h in the transmit list and sends it:

VBS Macro

Sub WriteExample()

Dim msg

Set msg = TransmitMessages.Add

With msg

.BeginUpdate

Set .Connection = Connections(1)

.ID = &H100

.DLC = 3

.Data(0) = &H11

.Data(1) = &H22

.Data(2) = &H33

.EndUpdate

.Write 0

End With

End Sub


Write Method [Variation 2]

Applies to: PCANMessage object

Writes a CAN message into the transmit message queue of a PCAN client.

Syntax

object.Write ( Connection, Time )

Parameters

object

An expression that evaluates to a PCANMessage object.

Connection

A PCANClientConnection object that determines the CAN bus to which the message is written.

Time

The point of time at which the message shall be sent. The current time can be retrieved with the GetSystemTime method of the PCANClient object.

If Time is smaller than or equal to the current time, the message is sent immediately.

If Time is higher than the current time, the message will be put into the transmit message queue.

Return values

The Write method returns a Boolean value:

  • True: The CAN message was put into the transmit message queue or sent immediately.

  • False: An error occurred while sending the CAN message. The LastError property provides information about the cause of the error.

Example

The following example sends a CAN message with a CAN ID of 100h and two data bytes:

VBS Macro

Sub WriteExample2()

Dim client, conn

Set client = CreateObject("PCAN4.PCANClient")

client.Device = "pcan_usb"

client.Name = "Macro"

' Connect client to net TestNet

Set conn = client.Connections.Add("TestNet")

If conn.IsConnected Then

Dim msg

Set msg = client.Messages.Add

With msg

.ID = &H100

.DLC = 2

.Data(0) = &H11

.Data(1) = &H22

.Write conn, 0

End With

End If

End Sub

See also

Read Method


Write Method [Variation 3]

Applies to: J1939Node object

Sends a J1939 message.

Syntax

object.Write ( Message )

Parameters

object

An expression that evaluates to a J1939Node object.

Message

A J1939Msg object that contains the data to be sent.

Return values

The Write method returns a Boolean value:

  • True: The J1939 message has been successfully written into the transmit message queue.

  • False: An error occurred while sending the J1939 message. The LastError property of the J1939Node object provides information about the cause of the error.

Example

The following example sends a J1939 message:

VBS Macro

Sub J1939_WriteExample()

Dim node

Set node = CreateObject("J1939Pcan6.PCANJ1939Node")

node.Device = tcdUSB ' = 5

node.ClientName = "Macro"

node.NetName = "TestNet"

If node.Connect Then

Dim msg

Set msg = CreateObject("J1939Pcan6.PCANJ1939Msg")

With msg

.PGN = 65132 ' TCO1, Tachograph

.Priority = 3

.Length = 8

.Originator = 1

End With

node.Write msg

End If

End Sub


Events

An event is an action or occurrence, often generated by the user, to which a VBScript event handler, PCAN-Explorer Add-in, or other Automation controller can respond. For example, if a user clicks on a window, PCAN-Explorer fires the OnWindowActivate event of the Application object.

The following events are available:

Event | Description
OnAddressClaiming | Occurs during the address claiming process of J1939Node objects.
OnAddressLost | Occurs after a J1939Node object lost its claimed address.
OnApplicationShutDown | Occurs before PCAN-Explorer shuts down.
OnClientConnect | Occurs after a PCANClient object has been connected to a PCAN net.
OnClientDisconnect | Occurs after a PCANClient object has been disconnected from a PCAN net.
OnClientRegister | Occurs after a PCANClient object has been registered at a PCAN device.
OnClientRemove | Occurs before a PCANClient object is removed from PCAN device.
OnConnectionAdd | Occurs when a connection is added to the project.
OnConnectionChanged | Occurs after properties of a connection have been changed.
OnConnectionConnect | Occurs after a connection has been enabled.
OnConnectionDisconnect | Occurs after a connection has been disabled.
OnConnectionRemove | Occurs before a connection is removed from the project.
OnDocumentClose | Occurs before a document is closed.
OnDocumentOpen | Occurs after a document has been opened.
OnDocumentSave | Occurs after a document has been saved.
OnFilterChanged | Occurs after the reception filter of PCANClient object has been changed.
OnHardwareReset | Occurs after a hardware reset has been performed for a CAN hardware.
OnMessageFilterAdd | Occurs when a message filter is added to the project.
OnMessageFilterChanged | Occurs after properties of a message filter have been changed.
OnMessageFilterRemove | Occurs before a message filter is removed from the project.
OnNewDocument | Occurs after a new document has been created.
OnOptionsChanged | Occurs after PCAN-Explorer options have been changed.
OnProjectClose | Occurs before a project is closed.
OnProjectOpen | Occurs after a project has been opened.
OnPropertyValueChanged | Occurs after a property of a J1939Node object has changed.
OnSymbolsActivate | Occurs after a symbols collection has been activated.
OnSymbolsDeactivate | Occurs before a symbols collection is deactivated.
OnSymbolsDeactivated | Occurs after a symbols collection has been deactivated.
OnTracerActivate | Occurs after a tracer has been activated.
OnTracerDeactivate | Occurs after a tracer has been deactivated.
OnTracerFull | Occurs after the filling level of a specified tracer has reached 100%.
OnTracerPause | Occurs after a specified tracer has been paused.
OnTracerStart | Occurs after a specified tracer has been started.
OnTracerStop | Occurs after a specified tracer has been stopped.
OnWindowActivate | Occurs after a window has been activated.
OnWindowDeactivate | Occurs after a window has been deactivated.

In a VBScript event handler you can respond to an event by taking some action. For instance, you could change the size of a window by setting the Height and Width properties of the Window object.

To respond to an event, add the appropriate event handler to any loaded VBScript Macro file. You can add this event handler to multiple VBScript Macro files. For example, if you add an event handler for the OnWindowActivate event to two loaded VBScript Macro files, when the user activates a window, both of these event handlers will be called - one at a time.

To add the event handler, find the appropriate event by using the previous table, copy the sample event handler from the example, paste the handler into your Macro file, insert the appropriate code into the handler, and then reload the Macro file.

For example, you could take some action just before PCAN-Explorer quits by using the OnApplicationShutDown event. To use this event, go to the description of the event and copy the sample event handler:

VBS Macro

Sub Application_OnApplicationShutDown()

' Insert code to handle the event here

End Sub

Then, paste this code into your Macro file, insert the code for handling the event, and then reload the Macro file.

Tip: To reload the Macro file, open the file in the text editor, click the right mouse button, and then click Reload Macro File.


OnAddressClaiming Event

Applies to: J1939Node object

Occurs during the address claiming process.

Syntax

object_OnAddressClaiming ( node, status )

Parameters

object

An expression that evaluates to a J1939Node object.

node

The J1939Node object that triggers this event.

status

A TClaimedStatus enum value that specifies the current address claiming status.

Remarks

The OnAddressClaiming event is triggered only if the NotificationOnAddressClaiming property is set to True. For the J1939Node objects that PCAN-Explorer creates for its J1939 CommunicationObject objects, this property is automatically set to True.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnAddressClaiming event. Copy this into your Macro file, and then insert the appropriate code:

VBS Macro

Sub J1939Node_OnAddressClaiming(node, status)

Dim str

Select Case status

Case tcsClaiming:

str = "Claiming address..."

Case tcsClaimed:

str = "Address claimed"

Case tcsCannotClaim:

str = "Cannot claim address"

Case tcsReleased:

str = "Address released"

End Select

PrintToOutputWindow "OnAddressClaiming, Status=" & str

End Sub

See also

AddressClaimStatus Property


OnAddressLost Event

Applies to: J1939Node object

Occurs after a J1939 node lost its claimed address.

Syntax

object_OnAddressLost ( node, address )

Parameters

object

An expression that evaluates to a J1939Node object.

node

The J1939Node object that triggers this event.

address

A Byte representing the address that was lost.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnAddressLost event. Copy this into your Macro file, and then insert the appropriate code:

VBS Macro

Sub J1939Node_OnAddressLost(node, address)

' Insert code to handle the event here

End Sub


OnApplicationShutDown Event

Applies to: Application object

Occurs before PCAN-Explorer shuts down.

Syntax

object_OnApplicationShutDown

Parameters

object

An expression that evaluates to an Application object.

Remarks

PCAN-Explorer fires this event before PCAN-Explorer ends.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnApplicationShutDown event. Copy this into your Macro file, and then insert the appropriate code:

VBS Macro

Sub Application_OnApplicationShutDown()

' Insert code to handle the event here

End Sub


OnClientConnect Event

Applies to: PCANClient object

Occurs after a PCANClient object has been connected to a PCAN net.

Syntax

object_OnClientConnect ( connection )

Parameters

object

An expression that evaluates to a PCANClient object.

connection

The PCANClientConnection object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnClientConnect event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnClientConnect(connection)

' Insert code to handle the event here

End Sub

See also

OnClientDisconnect Event


OnClientDisconnect Event

Applies to: PCANClient object

Occurs after a PCANClient object has been disconnected from PCAN net.

Syntax

object_OnClientDisconnect ( connection )

Parameters

object

An expression that evaluates to a PCANClient object.

connection

The PCANClientConnection object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnClientDisconnect event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnClientDisconnect(connection)

' Insert code to handle the event here

End Sub

See also

OnClientConnect Event


OnClientRegister Event

Applies to: PCANClient object

Occurs after a PCANClient object has been registered at a PCAN device.

Syntax

object_OnClientRegister ( client )

Parameters

object

An expression that evaluates to a PCANClient object.

client

The PCANClient object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnClientRegister event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnClientRegister(client)

' Insert code to handle the event here

End Sub

See also

Register Method

OnClientRemove Event


OnClientRemove Event

Applies to: PCANClient object

Occurs before a PCANClient object is removed from PCAN device.

Syntax

object_OnClientRemove ( client )

Parameters

object

An expression that evaluates to a PCANClient object.

client

The PCANClient object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnClientRemove event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnClientRemove(client)

' Insert code to handle the event here

End Sub

See also

Remove Method [Variation 2]

OnClientRegister Event


OnConnectionAdd Event

Applies to: Application object

Occurs when a connection is added to the project.

Syntax

object_OnConnectionAdd ( connection )

Parameters

object

An expression that evaluates to an Application object.

connection

The Connection object that triggers this event.

Remarks

PCAN-Explorer fires this event before the connection is added to the project.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnConnectionAdd event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnConnectionAdd(theConnection)

' Insert code to handle the event here

End Sub

See also

OnConnectionRemove Event


OnConnectionChanged Event

Applies to: Application object

Occurs after properties of a connection have been changed.

Syntax

object_OnConnectionChanged ( connection )

Parameters

object

An expression that evaluates to an Application object.

connection

The Connection object that triggers this event.

Remarks

PCAN-Explorer fires this event after properties of a connection have been changed.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnConnectionChanged event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnConnectionChanged(theConnection)

' Insert code to handle the event here

End Sub


OnConnectionConnect Event

Applies to: Application object

Occurs after a connection has been enabled.

Syntax

object_OnConnectionConnect ( connection )

Parameters

object

An expression that evaluates to an Application object.

connection

The Connection object that triggers this event.

Remarks

PCAN-Explorer fires this event after the connection has been successfully enabled.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnConnectionConnect event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnConnectionConnect(theConnection)

' Insert code to handle the event here

End Sub

See also

OnConnectionDisconnect Event


OnConnectionDisconnect Event

Applies to: Application object

Occurs after a connection has been disabled.

Syntax

object_OnConnectionDisconnect ( connection )

Parameters

object

An expression that evaluates to an Application object.

connection

The Connection object that triggers this event.

Remarks

PCAN-Explorer fires this event after the connection has been disabled.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnConnectionDisconnect event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnConnectionDisconnect(theConnection)

' Insert code to handle the event here

End Sub

See also

OnConnectionConnect Event


OnConnectionRemove Event

Applies to: Application object

Occurs before a connection is removed from the project.

Syntax

object_OnConnectionRemove ( connection )

Parameters

object

An expression that evaluates to an Application object.

connection

The Connection object that triggers this event.

Remarks

PCAN-Explorer fires this event before the connection is removed from the project.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnConnectionRemove event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnConnectionRemove(theConnection)

' Insert code to handle the event here

End Sub

See also

OnConnectionAdd Event


OnDocumentClose Event

Applies to: Application object

Occurs before a document is closed.

Syntax

object_OnDocumentClose ( document )

Parameters

object

An expression that evaluates to an Application object.

document

The Document object that triggers this event.

Remarks

PCAN-Explorer fires this event before the document closes.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnDocumentClose event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnDocumentClose(theDocument)

' Insert code to handle the event here

End Sub

See also

OnDocumentOpen Event

OnDocumentSave Event


OnDocumentOpen Event

Applies to: Application object

Occurs after a document has been opened.

Syntax

object_OnDocumentOpen ( document )

Parameters

object

An expression that evaluates to an Application object.

document

The Document object that triggers this event.

Remarks

PCAN-Explorer fires this event after the document has been opened.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnDocumentOpen event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnDocumentOpen(theDocument)

' Insert code to handle the event here

End Sub

See also

OnDocumentClose Event

OnDocumentSave Event


OnDocumentSave Event

Applies to: Application object

Occurs after a specified document is saved.

Syntax

object_OnDocumentSave ( document )

Parameters

object

An expression that evaluates to an Application object.

document

The Document object that triggers this event.

Remarks

PCAN-Explorer fires this event after the document is saved.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnDocumentSave event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnDocumentSave(theDocument)

' Insert code to handle the event here

End Sub

See also

OnDocumentOpen Event

OnDocumentClose Event


OnFilterChanged Event

Applies to: PCANClient object

Occurs after the reception filter of PCANClient object has been changed.

Syntax

object_OnFilterChanged ( client )

Parameters

object

An expression that evaluates to a PCANClient object.

client

The PCANClient object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnFilterChanged event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnFilterChanged(client)

' Insert code to handle the event here

End Sub

See also

RegisterMsg Method

ResetFilters Method

SetFilter Method


OnHardwareReset Event

Applies to: PCANClient object

Occurs after a hardware reset has been performed for a connected CAN hardware.

Syntax

object_OnHardwareReset ( connection )

Parameters

object

An expression that evaluates to a PCANClient object.

connection

The PCANClientConnection object that triggers this event.

Remarks

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnHardwareReset event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub PCANClient_OnHardwareReset(connection)

' Insert code to handle the event here

End Sub

See also

ResetHardware Method


OnMessageFilterAdd Event

Applies to: Application object

Occurs when a message filter is added to the project.

Syntax

object_OnMessageFilterAdd ( filter )

Parameters

object

An expression that evaluates to an Application object.

filter

The MessageFilter object that triggers this event.

Remarks

PCAN-Explorer fires this event before the message filter is added to the project.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnMessageFilterAdd event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnMessageFilterAdd(theFilter)

' Insert code to handle the event here

End Sub

See also

OnMessageFilterRemove Event


OnMessageFilterChanged Event

Applies to: Application object

Occurs after properties of a message filter have been changed.

Syntax

object_OnMessageFilterChanged ( filter )

Parameters

object

An expression that evaluates to an Application object.

filter

The MessageFilter object that triggers this event.

Remarks

PCAN-Explorer fires this event after properties of a message filter have been changed.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnMessageFilterChanged event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnMessageFilterChanged(theFilter)

' Insert code to handle the event here

End Sub


OnMessageFilterRemove Event

Applies to: Application object

Occurs before a message filter is removed from the project.

Syntax

object_OnMessageFilterRemove ( filter )

Parameters

object

An expression that evaluates to an Application object.

filter

The MessageFilter object that triggers this event.

Remarks

PCAN-Explorer fires this event before the message filter is removed from the project.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnMessageFilterRemove event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnMessageFilterRemove(theFilter)

' Insert code to handle the event here

End Sub

See also

OnMessageFilterAdd Event


OnNewDocument Event

Applies to: Application object

Occurs after a specified document is created.

Syntax

object_OnNewDocument ( document )

Parameters

object

An expression that evaluates to an Application object.

document

The Document object that triggers this event.

Remarks

PCAN-Explorer fires this event after the document is created.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnNewDocument event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnNewDocument(theDocument)

' Insert code to handle the event here

End Sub


OnOptionsChanged Event

Applies to: Application object

Occurs after PCAN-Explorer options have been changed.

Syntax

object_OnOptionsChanged

Parameters

object

An expression that evaluates to an Application object.

Remarks

PCAN-Explorer fires this event after the Options Dialog box was closed by pressing the OK button.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnOptionsChanged event. Copy this into your Macro file, and then insert the appropriate code:

VBS Macro

Sub Application_OnOptionsChanged()

' Insert code to handle the event here

End Sub


OnProjectClose Event

Applies to: Application object

Occurs before a project is closed.

Syntax

object_OnProjectClose ( project )

Parameters

object

An expression that evaluates to an Application object.

document

The Project object that triggers this event.

Remarks

PCAN-Explorer fires this event before a project is closed.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnProjectClose event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnProjectClose(theProject)

' Insert code to handle the event here

End Sub

See also

OnProjectOpen Event


OnProjectOpen Event

Applies to: Application object

Occurs after a project has been opened.

Syntax

object_OnProjectOpen ( project )

Parameters

object

An expression that evaluates to an Application object.

document

The Project object that triggers this event.

Remarks

PCAN-Explorer fires this event after a project has been opened.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnProjectOpen event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnProjectOpen(theProject)

' Insert code to handle the event here

End Sub

See also

OnProjectClose Event


OnPropertyValueChanged Event

Applies to: J1939Node object

Occurs after a property of the object has changed.

Syntax

object_OnPropertyValueChanged ( node, property )

Parameters

object

An expression that evaluates to a J1939Node object.

node

The J1939Node object that triggers this event.

property

A TJ1939Property enum value that specifies which property has changed.

The following enum values are possible:

  • propClaimStatus (1): The AddressClaimStatus property has changed.

  • propClientName (2): The ClientName property has changed.

  • propWindowHandle (3): The WindowHandle property has changed.

  • propDevice (4): The Device property has changed.

  • propNetName (5): The NetName property has changed.

  • propResetOnBusOff (6): The ResetOnBusOff property has changed.

  • propIncludeEchoes (7): The IncludeEchoes property has changed.

  • propReceiving (8): The Receiving property has changed.

  • propAddressName (9): A value of the object under the AddressName property has changed.

  • propPreferredAddress (10): The PreferredAddress property has changed.

  • propUseAddressingProtocol (11): The UseAddressingProtocol property has changed.

  • propMonitoring (12): The Monitoring property has changed.

  • propConnected (13): The Connected property has changed.

  • propClaimedAddress (14): The ClaimedAddress property has changed.

  • propFilter (15): A value of one of the filter objects under the Filters property has changed.

  • propNotifyPropertyChanges (16): The NotificationOnPropertyChange property has changed.

  • propNotifyAddressClaiming (17): The NotificationOnAddressClaiming property has changed.

  • propNotifyAddressLost (18): The NotificationOnAddressLost property has changed.

  • propNotifyMessageReceived (20): The NotificationOnMessageReceived property has changed.

  • propPacksCountOnReadSessions (21): The PacksCountOnReadSessions property has changed.

  • propPacksCountOnWriteSessions (22): The PacksCountOnWriteSessions property has changed.

  • propRetriesCountOnWriteSessions (23): The RetriesCountOnWriteSessions property has changed.

  • propReCTSCountOnReadSessions (24): The ReCTSsCountOnReadSessions property has changed.

  • propRcvEventHandle (25): The RcvEventHandle property has changed.

Remarks

The OnPropertyValueChanged event is triggered only if the NotificationOnPropertyChange property is set to True. For the J1939Node objects that PCAN-Explorer creates for its J1939 CommunicationObject objects, this property is automatically set to True.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnPropertyValueChanged event. Copy this into your Macro file, and then insert the appropriate code:

VBS Macro

Sub J1939Node_OnPropertyValueChanged(node, property)

' Insert code to handle the event here

End Sub


OnSymbolsActivate Event

Applies to: Application object

Occurs after a new collection Symbols has been activated.

Syntax

object_OnSymbolsActivate ( Symbols )

Parameters

object

An expression that evaluates to an Application object.

Symbols

The Symbols object that triggers this event.

Remarks

PCAN-Explorer fires this event after the Symbols collection has been activated.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnSymbolsActivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnSymbolsActivate(theSymbols)

' Insert code to handle the event here

End Sub

See also

OnSymbolsDeactivate Event


OnSymbolsDeactivate Event

Applies to: Application object

Occurs before a symbols collection is deactivated.

Syntax

object_OnSymbolsDeactivate ( Symbols )

Parameters

object

An expression that evaluates to an Application object.

Symbols

The Symbols object that triggers this event.

Remarks

PCAN-Explorer fires this event before a symbols collection is deactivated.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnSymbolsDeactivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnSymbolsDeactivate(theSymbols)

' Insert code to handle the event here

End Sub

See also

OnSymbolsDeactivated Event

OnSymbolsActivate Event


OnSymbolsDeactivated Event

Applies to: Application object

Occurs after a symbols collection has been deactivated.

Syntax

object_OnSymbolsDeactivated ( Symbols )

Parameters

object

An expression that evaluates to an Application object.

Symbols

The Symbols object that triggers this event.

Remarks

PCAN-Explorer fires this event after a symbols collection has been deactivated.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnSymbolsDeactivated event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnSymbolsDeactivated(theSymbols)

' Insert code to handle the event here

End Sub

See also

OnSymbolsDeactivate Event

OnSymbolsActivate Event


OnTracerActivate Event

Applies to: Application object

Occurs after a specified tracer becomes active.

Syntax

object_OnTracerActivate ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the tracer becomes active.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerActivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerActivate(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerDeactivate Event


OnTracerDeactivate Event

Applies to: Application object

Occurs after a specified tracer becomes inactive.

Syntax

object_OnTracerDeactivate ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the tracer becomes inactive.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerDeactivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerDeactivate(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerActivate Event


OnTracerFull Event

Applies to: Application object

Occurs after the filling level of a specified tracer has reached 100%.

Syntax

object_OnTracerFull ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the filling level of a tracer has reached 100%. This event is fired only for tracers that use a linear buffer. The event is fired after the OnTracerStop event has been fired.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerFull event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerFull(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerStop Event


OnTracerPause Event

Applies to: Application object

Occurs after a specified tracer is paused.

Syntax

object_OnTracerPause ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the tracer is paused.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerPause event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerPause(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerStart Event

OnTracerStop Event


OnTracerStart Event

Applies to: Application object

Occurs after a specified tracer is started.

Syntax

object_OnTracerStart ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the tracer is started.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerStart event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerStart(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerPause Event

OnTracerStop Event


OnTracerStop Event

Applies to: Application object

Occurs after a specified tracer is stopped.

Syntax

object_OnTracerStop ( tracer )

Parameters

object

An expression that evaluates to an Application object.

tracer

The Tracer object that triggers this event.

Remarks

PCAN-Explorer fires this event after the tracer is stopped.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnTracerStop event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnTracerStop(theTracer)

' Insert code to handle the event here

End Sub

See also

OnTracerStart Event

OnTracerPause Event


OnWindowActivate Event

Applies to: Application object

Occurs after a specified window becomes active.

Syntax

object_OnWindowActivate ( window )

Parameters

object

An expression that evaluates to an Application object.

window

The Window object that triggers this event.

Remarks

PCAN-Explorer fires this event after the window becomes active.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnWindowActivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnWindowActivate(theWindow)

' Insert code to handle the event here

End Sub

See also

OnWindowDeactivate Event


OnWindowDeactivate Event

Applies to: Application object

Occurs after a specified window becomes inactive.

Syntax

object_OnWindowDeactivate ( window )

Parameters

object

An expression that evaluates to an Application object.

window

The Window object that triggers this event.

Remarks

PCAN-Explorer fires this event after a window has been deactivated.

For an overview about using event code, see the introduction to events.

Example

Following is a sample event handler for the OnWindowDeactivate event. Copy this into your Macro file and insert the appropriate code:

VBS Macro

Sub Application_OnWindowDeactivate(theTracer)

' Insert code to handle the event here

End Sub

See also

OnWindowActivate Event


Home Page: VBScript Macros

You can use VBScript Macros to simplify your work in PCAN-Explorer.

In This Section

Overview

Contains general information about VBScript Macros.

"How do I ...?" Themes

Describes the procedures for working with VBScript Macros.

Reference

Contains the reference to VBScript Macros.

Related Sections

PCAN-Explorer Objects

Documentation of the PCAN-Explorer Object Model.

Add-ins for PCAN-Explorer

Contains topics about the creation of PCAN-Explorer Add-ins.

Callback Libraries

Contains topics about how to create and use Callback Libraries in projects.

Customizing PCAN-Explorer

Information about how to personalize the PCAN-Explorer environment for your convenience and productivity.


Overview: VBScript Macros

VBScript Macros (Home) | How do I ...? | Reference

With VBScript Macros or PCAN-Explorer Add-ins, you can automate routine tasks.

A VBScript Macro is a procedure that contains VBScript instructions and takes no parameters. A VBScript Macro begins with a Sub statement, continues with VBScript commands that represents tasks you want to accomplish, and ends with an End Sub statement. VBScript Macros are stored in text files known as Macro files.

To use a VBScript Macro, you run it. If you expect to run it regularly, assign it to a Shortcut Key combination. Then, you can run the Macro simply by pressing the keys.

What do you want to know more about?

  • Differences between VBScript Macros and PCAN-Explorer Add-ins

  • Macro files

  • The VBScript language

  • Automation

  • PCAN-Explorer Objects

What do you want to do?

  • Write a Macro

  • Edit a Macro

  • Install a Macro

  • Assign a Macro to a Shortcut Key

  • Run a Macro

  • Debug a Macro

  • Delete a Macro

  • Rename a Macro


Differences between Add-ins and VBScript Macros

PCAN-Explorer: Automation

VBScript Macros

Differences between VBScript Macros and PCAN-Explorer Add-ins

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

VBScript Macros differ from PCAN-Explorer Add-ins. The primary difference is that Macros are procedures being written in the programming language Visual Basic Scripting Edition (VBScript), whereas Add-ins are In-Process COM components (DLLs), that are written in an arbitrary programming language such as Microsoft Visual C++, C#, Embarcadero Delphi or C++ Builder.

You can create VBScript Macros more quickly and easily than an Add-in. To create a Macro, you must only write little source code within the PCAN-Explorer environment and then run the Macro. To create an Add-in, however, you must write it in a programming language such as Visual C++, compile it into a DLL, connect it to PCAN-Explorer, and then run its commands.

VBScript Macros are not as versatile as Add-ins. Macros can use only the VBScript language and can only access the PCAN-Explorer object model. In Add-ins, however, you can use a language of your choice, and you can access not only the object model but the resources of the entire computer system.

The following table summarizes the differences between Macros and Add-ins.

VBScript Macros | PCAN-Explorer Add-ins
Are interpreted | Are compiled
Are easy to create | Are more difficult to create
Can only be written in VBScript | Can be written in different programming languages, e.g. Microsoft Visual C++, C#, Visual Basic, Embarcadero Delphi, C++ Builder
Can only access the PCAN-Explorer object model | Can access local computer resources as well as the PCAN-Explorer object model
Can only use dialog boxes created by the VBScript functions InputBox and MsgBox commands | Can use arbitrary modal dialog boxes
Cannot access the Win32 API | Can access the Win32 API
Cannot use "early binding" | Can use "early binding" for better run-time performance


Macro Files

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

PCAN-Explorer stores Macros into text files called Macro files. A Macro file has a .pem file extension and can contain one or more Macros. The number of Macros is up to you.

You install Macro Files in the VBS Macro Manager dialog box (menu Tools, VBS Macro Manager command). Once installed, they are loaded automatically whenever you start PCAN-Explorer.

At the beginning of each Macro file is a description of the file. You provide this description when you create the file. Following this description are the Macro definitions.

Before you start writing a Macro, PCAN-Explorer appends a Macro stub to the file. This stub begins with a Sub statement containing the Macro's name, followed by a description that you provide, and ends with an End Sub statement.

The VBScript commands must be inserted between the Sub and the End Sub statements.

VBS Macro

Sub MacroName()

'DESCRIPTION: The Macro description goes here

'TODO: The VBScript commands go here

End Sub


"How do I ...?" Topics: VBScript Macros

Home Page (VBScript Macros) | Overview | Reference

You can automate your work in PCAN-Explorer by creating VBScript Macros that perform routine tasks.

What do you want to do?

  • Write a Macro

  • Edit a Macro

  • Install a Macro

  • Assign a Shortcut Key to a Macro

  • Run a Macro

  • End a running Macro

  • Debug a Macro

  • Delete a Macro

  • Rename a Macro


Writing VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

You can write a VBScript Macro by adding the code for the Macro to a new or existing Macro file.

To write a Macro:

  1. On the Macro menu, click Macro.

  2. To insert the Macro in a new Macro file, push the New File button, then enter the name and the description of the file.

- or -

To add a Macro to an existing Macro file, the select file name from the Macro File drop-down list. If the name is not in the list, install the file first.

  3. In the Macro Name list, enter the name of the Macro.

  4. Click the Edit button.

  5. In the Add Macro dialog box enter the description of the Macro and click OK.

PCAN-Explorer opens the Macro file and creates a Sub block for this new Macro at the end of the file. If the Macro name were for example MyMacro, the Sub block would look like this:

VBScript Macro

Sub MyMacro()
'DESCRIPTION: Here is the Macro description

'TODO: Insert the Macro code here
End Sub
Tip

It is good practice to declare variables used in a Macro. You declare variables by using the VBScript Dim statement. If you want to be sure that variables are declared before they are used, you can insert the line "Option Explicit" at the beginning of a Macro file.


Editing VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

With the Macro editor you can edit an existing Macro or add a new Macro.

To edit a Macro:

  1. On the Macro menu, click Macro.

  2. In the Macro File drop-down list, select the Macro file containing the Macro you want to edit. If this file is not in the list, first install the file, then select it in the Macro File drop-down list.

  3. In the Macro Name box, select the Macro you want to edit.

  4. Click the Edit button.

  5. Make the appropriate changes.

  6. Save the Macro.

See also

Macro Dialog Box


Installing VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

A Macro file contains one or more Macros. To make these Macros available in PCAN-Explorer, you must install the Macro file.

To install a Macro file:

  1. On the Macro menu, select the VBS Macro Manager command.

  2. The name of the Macro file should appear in the Macro files list.

  3. If the name of the Macro file does not appear in the list, select the Add button and locate the file.

Tip: To avoid browsing, the Macro file should reside in the directory Documents\PCAN-Explorer 6\Macros. PCAN-Explorer always searches for Macro files in this directory first.

  4. Load the appropriate Macro file by clicking into the check box in front of its name.

PCAN-Explorer adds a check mark, indicating that the file is loaded. This check mark also directs PCAN-Explorer to automatically load the file when you start PCAN-Explorer again.

Note

If you remove the check mark from a Macro file, you unload it. When you unload it, all of the macros in the file lose their Shortcut Key assignments. Additionally, PCAN-Explorer will not automatically load the Macro file when you start PCAN-Explorer again.


Assigning Shortcut Keys to VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

If you assign a Shortcut Key sequence to a Macro, you can run the macro by pressing the assigned keys.

To assign a Shortcut Key to a Macro:

  1. On the Tools menu click Options.

  2. Select the Keyboard page.

  3. In the Category drop-down list, click Macro.

  4. In the Commands list, select the Macro to which you want to assign a shortcut key.

  5. Click into the Press new shortcut key(s) box.

  6. Press the key combination that you want to use for the Macro.

PCAN-Explorer displays the current assignment of the key combination below the field. If the desired key combination is not assigned yet, the text "[unassigned]" appears.

  7. Click the Assign button.

PCAN-Explorer assigns that key combination to the Macro.

Note

The same key combination can theoretically be assigned to several commands at the same time. This, however, is not recommendable since only the assignment defined first is executed in the end.


Running VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

After you have installed a Macro file, you can execute the Macros contained in it. The easiest way is the use of key combinations, which you have assigned to the Macros before.

You can also execute Macros from the Macro dialog box (Macro menu, Macro command) or from the command line.

To execute a Macro from the Macros dialog box:

  1. In the Macro menu, click Macro.

  2. In the Macro File drop-down list, select the Macro file containing the Macro you want to run. If this file is not in the list, first install the file, then select it in the Macro File drop-down list.

  3. In the Macro Name box, double-click on the name of the Macro you want to run.

- or -

Select the Macro's name and click the Run button.

To run a Macro from the command line:

  • Type pcanexpl -ex Command

where Command is the name of the Macro. This syntax starts PCAN-Explorer, and after the PCAN-Explorer main window appears, the Macro starts running.

After the Macro completes, PCAN-Explorer continues running. If you want PCAN-Explorer to end, then the Macro must call the Application object's Quit method when it completes.

See also

Macro Dialog box


Quitting VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

While a VBScript Macro runs, an icon representing the macro appears in Windows' taskbar. If the Macro runs quickly, the icon appears only briefly. If the Macro runs for a while, the icon remains until the macro quits.

You can force a running Macro to quit before it normally does.

To quit a VBScript Macro:

  • Double-click on the Macro icon [image] in the Windows task bar.

Attention

If the Macro does not quit for any reason, it might cause PCAN-Explorer to stop responding. If this happens, press [Ctrl+Alt+Del], and then end the PCAN-Explorer task.


Debugging VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

PCAN-Explorer includes some tools that can help you debug a VBScript Macro.

To debug a Macro:

  • Use the PrintToOutputWindow method to print diagnostic messages or values of variables at various points in the Macro to the Output window.

  • Use the VBScript MsgBox function to halt the Macro so that you can inspect the messages printed with PrintToOutputWindow or MsgBox. When you are ready to continue the Macro, dismiss the message box.


Deleting VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

When you no longer need a Macro, you can delete it.

To delete a Macro:

  1. On the Macro menu, select Macro.

  2. In the Macro File drop-down list, select the Macro file containing the Macro you want to delete.

  3. In the Macro Name box, select the Macro you want to delete.

  4. Click the Edit button.

  5. Delete the Sub block containing the Macro's code.

  6. Save the Macro.


Renaming VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...? | Reference

If necessary, you can rename a Macro by a corresponding modification in the source code.

To rename a Macro:

  1. On the Macro menu, select Macro.

  2. In the Macro File box, select the Macro file containing the Macro you want to rename. If this file is not in the list, first install the file, then select it in the Macro File box.

  3. In the Macro Name box, select the Macro you want to rename.

  4. Click Edit button.

  5. Go to the Sub block containing the Macro's code.

  6. On the line containing the Macro's name, change the name of the Macro.

  7. Save the Macro.

See also

Macro Dialog box


Reference: VBScript Macros

Home Page (VBScript Macros) | Overview | How do I ...?

In the PCAN-Explorer user interface you can write, save, and edit Macros in the Visual Basic Scripting Edition language (VBScript).

See also

VBScript User's Guide

VBScript Language Reference


Home Page: Add-ins for PCAN-Explorer

PCAN-Explorer Add-ins are in-process COM components (DLLs) that you write for example in Microsoft Visual C++, C#, Visual Basic, Embarcadero Delphi or C++ Builder. With Add-ins you can automate tasks in PCAN-Explorer

  • by adding commands to perform these tasks

  • by adding toolbar buttons to carry out these commands

  • by responding to PCAN-Explorer events.

In This Section

Overview

Information about the operation of Add-ins and the communication of PCAN-Explorer with Add-ins.

How do I ...?

Procedures for the creation of Add-ins.

Reference

Contains the reference for all objects, methods, and interfaces that are needed when creating and using Add-ins.

Related Sections

VBScript Macros

Documentation about VBScript Macros as well as their creation and use.

Callback Libraries

Contains topics about how to create and use Callback Libraries in projects.

PCAN-Explorer Objects

Documentation of the PCAN-Explorer object model.

Customizing PCAN-Explorer

Information about possibilities of customizing PCAN-Explorer to own needs.


Overview: Add-ins for PCAN-Explorer

Home Page (Add-ins) | How do I ...? | Reference

With Add-ins or VBScript Macros, you can automate routine tasks in the PCAN-Explorer environment. For example, you can open certain files (Symbols, Macros, Transmit Lists) automatically and then start a PCAN-Explorer Macro.

You automate tasks by using Automation (formerly OLE Automation). With Automation, the PCAN-Explorer environment and its components become objects you can control programmatically. For example, windows become objects you can activate and size programmatically. Similarly, documents become objects you can open, edit, and close programmatically.

With Add-ins you automate tasks by adding commands to the PCAN-Explorer environment. Each Add-in can add one or more commands, and each command can perform one or more tasks. The number of commands and tasks is up to you.

Optionally, Add-ins can provide toolbar buttons and key sequences to carry out their commands. Without buttons or key sequences, however, you must carry out the commands from the command line.

Creating an Add-in is a three-step process. First, you write the code for the Add-in. Second, you write the code for adding commands, toolbar buttons, and key sequences. And third, you build and test the DLL for the Add-in.

After creating an Add-in, you connect it to the environment. As it connects, the Add-in adds its commands, toolbar buttons and key sequences to the environment. Later, if the Add-in is not needed, you can remove its commands, buttons, and key sequences by disconnecting the Add-in.

To use an Add-in, you carry out its commands by running them from the command line or by using the toolbar buttons or key sequences assigned to the commands.

Related topics

  • Differences Between Add-ins and VBScript Macros

  • Designing Add-ins

  • The Process for Creating Add-ins

  • How Add-ins Connect and Disconnect

  • How Add-ins add Commands, toolbar buttons and Shortcut Keys

  • How Add-in Commands are Executed

  • Controlling PCAN-Explorer Objects with Dual Interfaces

  • Defining new Document Types with Add-ins

  • How ActiveX Controls are Connected and Disconnected

  • How Add-in Document Data is Loaded and Saved

  • How Add-ins are notified of a changed Signal value

  • How Add-ins are notified of a received Message

  • How Add-ins are notified when sending Messages


Designing Add-ins

Home Page (Add-ins) | Overview | How do I ...? | Reference

Before you create Add-ins, you should consider the following design issues:

  • Which tasks will the Add-in perform?

  • Could you use a VBScript Macro to perform these tasks?

You can write a VBScript Macro more quickly and easily than you can write an Add-in. Before you begin, carefully consider the differences between Macros and Add-ins.

  • What commands will the Add-in use to perform its tasks?

  • Which PCAN-Explorer objects will you reference in the Add-in's commands?

  • Which PCAN-Explorer methods and properties will you use in the Add-in's commands?

  • How many Add-ins will you need?

If you need several, you can combine them in the same DLL.

  • Will the Add-in display an ActiveX control?

An Add-in can add new document types to PCAN-Explorer, which displays an ActiveX control in a window for the visual representation of the document.

  • Will the Add-in handle events?

An Add-in can handle events fired by PCAN-Explorer objects. Additionally, an Add-in can display a window containing an ActiveX control that fire events in the Add-in. The Add-in can handle the events.

  • Will the Add-in control another application?

An Add-in can control another executable file (.exe) by serving as an out-of-process controller for the other application.

  • Will the Add-in have more than one thread?

If you create a multi-threaded Add-in, the effects are unpredictable. An Add-in can have multiple threads if none of them has a message pump and only one thread accesses the PCAN-Explorer object model.

  • Will the Add-in execute another Add-in's commands?

  • Will the Add-in have a Help File?

If the Add-in displays a window containing an ActiveX control, PCAN-Explorer queries the ActiveX control for a Help File and default Help Topic, so the standard Help command [F1] can display the Help for the window. Otherwise, the Add-in must expose a dedicated command to display a Help File.


The Process for Creating Add-ins

Home Page (Add-ins) | Overview | How do I ...? | Reference

A summary of the Design Process for an Add-in is listed in the following. For a step by step instruction see "How do I ...?" Topics: Add-ins for PCAN-Explorer.

  1. Decide, which programming language to use.

  2. Create a project for the Add-in with a 32-bit build configuration.

  3. Write the code for the Add-in.

  4. Build the DLL from the source files.

Remember that you can combine several Add-ins into one DLL.

  5. Connect the Add-in to the PCAN-Explorer environment.

When you connect the Add-in, it adds its commands to the PCAN-Explorer environment. For details see Connecting Add-ins to PCAN-Explorer.

  6. Execute the commands added to PCAN-Explorer.

You can run these commands from the command line, or you can execute them out by clicking toolbar buttons or pressing keys associated with the commands. For details, see Executing Add-in Commands.


How Add-ins Connect and Disconnect

Home Page (Add-ins) | Overview | How do I ...? | Reference

When PCAN-Explorer starts, it automatically loads all Add-ins checked on the Add-in Manager dialog box. (Tools menu, Add-in Manager command). PCAN-Explorer loads each Add-in by calling the OnConnection method exposed by the Add-in's PEAddIn object. This method also makes the commands exposed by the Add-in available for the user to carry them out, and it connects the Add-in to PCAN-Explorer events if the Add-in contains event handlers.

When PCAN-Explorer quits, it unloads each Add-in by calling the OnDisconnection method exposed by the Add-in's PEAddIn object.

PEAddIn Object

Each Add-in exposes a PEAddIn object and a Commands object. PCAN-Explorer uses the PEAddIn object to connect to or to disconnect from an Add-in, and to check the availabilty of commands. PCAN-Explorer uses the Commands object to carry out a command added by the AddCommand method.

An Add-in exposes the PEAddIn object by implementing the COM IPEExtensibility interface.

Commands Object

Each Add-in exposes a PEAddIn object and a Commands object. PCAN-Explorer uses the PEAddIn object, to connect to or to disconnect from the Add-in, and it uses the Commands object to carry out a command added by the AddCommand method.

The Commands object exposes a method for each command added by AddCommand. The implementation of this method specifies what the command does. You must write code for the method.

See also

IPEExtensibility Interface


How Add-ins add Commands, Toolbar buttons, and Shortcut Keys

Home Page (Add-ins) | Overview | How do I ...? | Reference

While connecting to the PCAN-Explorer environment, an Add-in adds its commands to the environment. Optionally, the Add-in can add toolbar buttons and key sequences for carrying out these commands.

The following table summarizes how an Add-in adds Commands, toolbar buttons, and shortcut keys.

To add | An Add-in calls
A command | The AddCommand method
A toolbar button | The AddCommandBarButton method
A key sequence | The AddKeybinding method

Caution: Unless key sequences are necessary, do not add them by code because they might replace existing ones. For example, if a keystroke is assigned to a command and you assign the same keystroke to another command, your new assignment replaces the original. For best results, let the user assign key sequences to the commands added by an Add-in.


How Add-in Commands are Executed

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a user carries out a command provided by an Add-in, PCAN-Explorer calls a method associated with the command. This method specifies what the command is supposed to do and is exposed by the Commmands object associated with the Add-in.

PCAN-Explorer finds the method's name in the Add-in's call to the AddCommand method, which added the command to PCAN-Explorer. Then, PCAN-Explorer calls the method by communicating with the Add-in through the dispatch interface, implemented by the Commands object.

See also

Executing Add-in Commands


Controlling PCAN-Explorer Objects with Dual Interfaces

PCAN-Explorer: Automation

Add-ins for PCAN-Explorer

Controlling PCAN-Explorer Objects through Dual Interfaces

Home Page (Add-ins) | Overview | How do I ...? | Reference

Each PCAN-Explorer object implements a Dual Interface through which you can control the object. Each object implements an IDispatch interface for Automation and a COM interface for direct access to object members (properties, methods, and events).

The following table shows the Dual Interface used by each PCAN-Explorer object.

Object | Dual Interface
AddIn | IPEAddIn
AddIns | IPEAddIns
Application | IPEApplication
Connection | IPEConnection
Connections | IPEConnections
Document | IPEDocument
Documents | IPEDocuments
Enum | IPEEnum
Enums | IPEEnums
MessageFilter | IPEMessageFilter
MessageFilterItem | IPEMessageFilterItem
MessageFilters | IPEMessageFilters
Messages | IPEMessages
Multiplexer | IPEMultiplexer
Multiplexers | IPEMultiplexers
OutputWindow | IPEOutputWindow
OutputWindowPane | IPEOutputWindowPane
OutputWindowPanes | IPEOutputWindowPanes
PCANClient | IPCANClient
PCANClientConnection | IPCANClientConnection
PCANClientConnections | IPCANClientConnections
PCANMessage | IPCANMessage
PCANMessages | IPCANMessages
ReceiveMessage | IPEReceiveMessage
ReceiveMessages | IPEReceiveMessages
Signal | IPESignal
Signals | IPESignals
Symbol | IPESymbol
Symbols | IPESymbols
SymbolsManager | IPESymbolsManager
TextDocument | IPETextDocument
TextEditor | IPETextEditor
TextSelection | IPETextSelection
TextWindow | IPETextWindow
Tracer | IPETracer
TraceMessage | IPETraceMessage
TraceWindow | IPETraceWindow
TransmitMessage | IPETransmitMessage
TransmitMessages | IPETransmitMessages
TransmitWindow | IPETransmitWindow
Variable | IPEVariable
Variables | IPEVariables
VBSMacroFile | IPEVBSMacroFile
VBSMacroFiles | IPEVBSMacroFiles
Window | IPEWindow
Windows | IPEWindows

Most compilers can employ early binding by using the COM interface. Early binding makes all calls into interface members faster at run time.

Alternating Between Dual Interfaces

You can switch from one Dual Interface to another by calling QueryInterface. For example, to switch from the COM IPEDocument interface on a TextDocument object to the COM IPETextDocument interface, use the following code:

Visual C++

IPEDocument* pDoc;

pApplication->Get_ActiveDocument(&pDoc);

BSTR bstrType;

pDoc->Get_Type(&bstrType)

if (!wcscmp(bstrType, L"Text"))

{

// It's a text document,

// ..therefore QI for the right interface

IPETextDocument* pTextDoc;

pDoc->QueryInterface(IID_IPETextDocument, &pTextDoc)

// Now text-specific members

// of pTextDoc can be invoked

pTextDoc->Release();

}

SysFreeString(bstrType)

pDoc->Release();
Delphi

var

pDoc: IPEDocument;

pTextDoc: IPETextDocument;

strType: WideString;

begin

pDoc := pApplication.ActiveDocument;

if AnsiCompareText(pDoc.Type_, "Text") = 0 then

begin

// It's a text document,

// change interface

pTextDoc := pDoc as IPETextDocument;

// Now we can invoke text-specific

// members of pTextDoc

end;

end;

Using Return Values from Dual Interfaces in C++

If a property or method of a PCAN-Explorer object returns a value of type T, then the corresponding Dual Interface method returns a HRESULT value but accepts an additional argument of type "pointer to T" (or T*). This argument is at the end of the argument list. For example, if a property returns a value of type Long, then the corresponding Dual Interface method accepts an additional argument of type "pointer to Long" (or Long*).

When the method returns, PCAN-Explorer stores the return value where the last parameter points. For example, the Close method of the IPETextWindow interface returns a PeSaveStatus value. The Dual Interface version of this method is declared as

HRESULT Close (VARIANT vSaveChanges, PeSaveStatus* pSaved)

The last parameter, which is declared as PeSaveStatus*, is where PCAN-Explorer stores the return value.

The Visual C++ code to do this look like the following:

Visual C++

PeSaveStatus saveStatus;

if (myTxtWindow->Close(VARIANT_TRUE, &saveStatus) == S_OK)

{

// The code here could check the value of saveStatus

// returned by Close

}

If the function succeeds, the HRESULT returned by the Dual Interface method is a success code like S_OK. If the function fails, however, the function returns an error code instead. This error code has the same value as one thrown in a dispatch exception when you call the method through the dispatch interface.

Manipulating Properties of Objects through Dual Interfaces in C++

To get a property of an object, prepend "get_" to the property name. Alternatively, to set the property of an object, prepend "put_" to the property name.

For example, to get the height of a window, prepend "get_" to the Height property of a Window object, as shown in the following code:

C++

long nHeight;

if (pWnd->get_Height(&nHeight) == S_OK)

{

// code here references the Height property

// through nHeight

}

Alternatively, to set the value of the Height property to 150, you would use the following code:

C++

pWnd->put_Height(150);

Calling Methods of Dual Interfaces

Some Dual Interface methods use parameters called "Reserved" of type VARIANT, and other methods use parameters that are optional. In VBScript Macros or Add-ins authored in Visual Basic, you can omit such parameters. However, with Add-ins authored in Visual C++, you must use these parameters, you must pass a VT_ERROR VARIANT for each parameter, and you must specify the scode of the VARIANT as DISP_E_PARAMNOTFOUND.

For example, with MFC you can call the Close method of the Window object by using the following code:

Visual C++

COleVariant var(0L, VT_ERROR);

var.scode = DISP_E_PARAMNOTFOUND;

pWindow->Close(var);

In Embarcadero Delphi it looks like this:

Delphi

pWindow.Close(EmptyParam);


Defining new Document Types with Add-ins

Home Page (Add-ins) | Overview | How do I ...? | Reference

Add-ins cannot only add new commands to PCAN-Explorer, but also implement completely new document types, which just behave the same like the already available document types. Such new document types use ActiveX controls for their visualization.

A new document type can be added by calling the AddDocumentType method.

See also

How ActiveX Controls are Connected and Disconnected

How Add-in Document Data is Loaded and Saved


How ActiveX Controls are connected and disconnected

Home Page (Add-ins) | Overview | How do I ...? | Reference

To enable PCAN-Explorer to manage an ActiveX control as the document's visual repesentation, the ActiveX control must implement the COM interface IPEToolWindow. This interface defines the methods OnWindowCreate and OnWindowDestroy.

When PCAN-Explorer creates a document of a type that was added by an Add-in, a new window for the document is also created. Embedded into this window is the ActiveX control. PCAN-Explorer initializes the ActiveX control by calling the OnWindowCreate method, which must be implemented by the ActiveX control.

When closing the document or the window, PCAN-Explorer unlocks the embedded ActiveX control. To do this, the OnWindowDestroy method of the ActiveX control is called.

See also

IPEToolWindow Interface


How Add-in Document Data is Loaded and Saved

Home Page (Add-ins) | Overview | How do I ...? | Reference

PCAN-Explorer can inform the ActiveX control, which serves for the visual representation of the document data, about loading and saving of the document data. The ActiveX control must implement the COM interface IPEToolDocument, which defines the methods OnLoad and OnSave.

When loading a document from a file of a type that was added through an Add-in to the PCAN-Explorer environment, PCAN-Explorer creates the window and the ActiveX control, and then calls the OnLoad method, which must be implemented by the ActiveX control.

Accordingly, when saving the document, the OnSave method is called.

See also

IPEToolDocument Interface


How Add-ins are notified of a changed Signal value

Home Page (Add-ins) | Overview | How do I ...? | Reference

If an Add-in wants to be notified when the value of Signal has changed, it must expose one or more SignalCallback objects and register a pointer to its COM interface at a Signal object.

SignalCallback Object

An Add-in must expose one or more SignalCallback objects, if it wants to be notified when values of one or more Signals have changed. PCAN-Explorer uses a SignalCallback object to inform the Add-in when a value has changed, by calling the corresponding SignalCallback object's OnChangeValue method.

An Add-in exposes a SignalCallback object by implementing the COM interface IPESignalCallback.


How Add-ins are notified of a received Message

Home Page (Add-ins) | Overview | How do I ...? | Reference

If an Add-in wants to be notified of a received message, it must expose a ReceiveCallback object and register a pointer to its COM interface at the ReceiveMessages collection.

ReceiveCallback Object

An Add-in must expose a ReceiveCallback object, if it wants to be notified of received message. PCAN-Explorer uses the ReceiveCallback object to notify the Add-in when it has received a message by calling the OnReceive method.

An Add-in exposes a ReceiveCallback object by implementing the COM interface IPEReceiveCallback, and by calling the RegisterCallback method to register the object for the corresponding notifications.


"How do I ...?" Topics: Add-ins for PCAN-Explorer

Home Page (Add-ins) | Overview | Reference

With Add-ins, you automate tasks by adding commands to perform these tasks. You can also add toolbar buttons and key sequences to carry out the commands - giving them the same ease of use as other commands in the PCAN-Explorer environment.

What do you want to know more about?

  • Designing Add-ins

  • The Process for Creating Add-ins

What would you like to do?

  • Connect an Add-in to PCAN-Explorer

  • Execute Add-in commands

  • Assign Shortcut Keys to Add-in commands

  • Disconnect an Add-in from PCAN-Explorer

  • Getting notified when a Signal value has changed

  • Remove a Notification about a Signal value change


Adding Commands to PCAN-Explorer

Home Page (Add-ins) | Overview | How do I ...? | Reference

To add a command:

  1. To the ICommands interface adds a method declaration, which shall execute the command.

  2. Write the implementation of the method.

  3. Add a call of AddCommand in the Add-in's implementation of the OnConnection method and specify the parameters.

  4. Optionally, create a Toolbar button, with which users can execute this command. See Adding Toolbar Buttons for Add-in Commands.

  5. Optionally, assign a Shortcut Key to the command. See Assigning Shortcut Keys to Add-in Commands.


Adding Toolbar buttons for Add-in commands

Home Page (Add-ins) | Overview | How do I ...? | Reference

The user can execute Add-in commands by selecting the Toolbar button which is assigned to the command.

To add a Toolbar button for a command:

  1. Go to the implementation of the OnConnection method in the code.

  2. Search for the code which adds the command. This code calls the AddCommand method.

  3. After this AddCommand call add a call of AddCommandBarButton.

  4. Check the availability of the command in the method OnEnableCommand of the PEAddIn object and return the corresponding value to PCAN-Explorer.

If the user separates the Add-in of PCAN-Explorer, the Add-in does not need to remove the buttons added by it, since this happens automatically.


Assigning Shortcut Keys to Add-in commands programmatically

Home Page (Add-ins) | Overview | How do I ...? | Reference

You can execute an Add-in command by using a Shortcut Keys, which is assigned to the command. A Shortcut Keys can be added by means of the user interface or by program.

To assign a Shortcut Keys programmatically:

  1. Go to the implementation of the OnConnection method of the Add-in project.

  2. Search for the code which adds a command. This code invokes the AddCommand method.

  3. After the call of AddCommand insert a call to the AddKeybinding method.

Attention: If Shortcut Keys are not absolutely necessary, they shouldn't be added. New Shortcut Keys could come into conflict with existing ones, which has unpredictable results for the user.


Connecting Add-ins to PCAN-Explorer

Home Page (Add-ins) | Overview | How do I ...? | Reference

To execute commands of an Add-in the Add-in must be connected with PCAN-Explorer first.

To connect an Add-in to the PCAN-Explorer environment:

  1. In the Tools menu select the Add-in Manager command.

  2. Push the Add button and select the location of the Add-in DLL.

  3. The RegAddIn.exe utility is executed that performs the necessary steps to register the Add-in in the system. Note that registering an Add-in requires Administrator privileges. Most likely a User Access Control prompt must be confirmed to execute the utility (depending on your system's security settings).

  4. Load the appropriate Add-in by activating the check box next to the Add-in's name.
    A check mark indicates that an Add-in is loaded. This check mark also directs PCAN-Explorer to load the Add-in at the next program start automatically.

  5. Push OK or Apply.

See also

Disconnecting Add-ins from PCAN-Explorer

How Add-ins Connect and Disconnect


Disconnecting Add-ins from PCAN-Explorer

Home Page (Add-ins) | Overview | How do I ...? | Reference

If an Add-in is not needed any longer, you can disconnect it from PCAN-Explorer.

To disconnect an Add-in from the PCAN-Explorer environment:

  1. In the Tools menu select the Add-in Manager command.

  2. Deactivate the check boxes next to Add-ins that are supposed to be disconnected.

  3. Push OK or Apply.

The selected Add-ins now are no longer available, and are no longer loaded automatically when PCAN-Explorer is started the next time.

See also

Connecting Add-ins with PCAN-Explorer

How Add-ins Connect and Disconnect


Executing Add-in Commands

Home Page (Add-ins) | Overview | How do I ...? | Reference

After an Add-in has been connected with PCAN-Explorer the commands of the Add-in can be executed by operating the corresponding toolbar buttons or Shortcut Key combinations.

In addition, commands can be executed from the command line.

To run a command from the command line:

  • Type pcanexpl -ex Command

    where Command is the name of the Add-in command. This syntax starts PCAN-Explorer, and after the PCAN-Explorer main window appears the command syntax starts running.

After the Add-in command completes, PCAN-Explorer continues running. If you want PCAN-Explorer to end, then the Add-in command must call the Application object's Quit method when it completes.

See also

How Add-in Commands are Executed


Getting notified when a Signal value has changed

Home Page (Add-ins) | Overview | How do I ...? | Reference

To get notified when a Signal value has changed, the Add-in must register a SignalCallback object at the Signal object. Follow these steps to register a SignalCallback object:

  1. In the implementation of the OnConnection method, save an Application* pointer for later use.

  2. Create an event handler for the OnSymbolsActivate event.

  3. In the implementation of the OnSymbolsActivate event handler, use the Application* pointer to access the Signals collection to find the Signal object for which you want to register a callback handler.

  4. Call the RegisterCallback method of the Signal object to register a SignalCallback object.

  5. In the implementation of the OnRemove method of the SignalCallback object, call the UnregisterCallback method to remove your callback object. Alternatively, create an event handler for the OnSymbolsDeactivate event, in which you can remove all your callback objects in one step.

Attention: The callback objects must be removed also when the Add-in is disconnected from PCAN-Explorer. See OnDisconnection method.

See also

Removing a Notification about a Signal value change


Removing a Notification about a Signal value change

Home Page (Add-ins) | Overview | How do I ...? | Reference

If the notification is not needed any longer, or if the active Symbols are deactivated and therefore the used Signal object is no longer valid, the Add-in must remove its SignalCallback object from the corresponding Signal object.

To remove the notification, the Add-in must call the UnregisterCallback method of the Signal object.

See also

Getting notified when a Signal value has changed


Reference: Add-ins for PCAN-Explorer

Home Page (Add-ins) | Overview | How do I ...?

With Add-ins you can automate tasks in PCAN-Explorer by adding commands to perform these tasks.

Methods

Listed in the following are all methods that PCAN-Explorer calls in connection with Add-ins. For this the Add-in must implement the corresponding interface, in which the respective method is defined.

Method | Description
OnAfterTransmit | Is called after a message has been transmitted (CAN, CAN FD, J1939).
OnBeforeTransmit | Is called before a message is transmitted (CAN, CAN FD, J1939).
OnChangeValue | Is called when a signal's value has changed.
OnConnection | Is called when an Add-in is connected.
OnDisconnection | Is called when an Add-in is disconnected.
OnDocumentCreate | Is called when a document, which is managed by an Add-in, is created.
OnDocumentDestroy | Is called when a document, which is managed by an Add-in, is closed.
OnLoad | Is called when a document, which is managed by an Add-in, is loaded from a file.
OnPause | Is called when the periodic transmission of a message is halted.
OnReceive | Is called when a message has been received (CAN, CAN FD, J1939).
OnRemove | Is called when a Signal has been removed.
OnReset | Is called for transmit messages when the Reset command has been executed for a connection.
OnResume | Is called when the periodic transmission of a message is being resumed.
OnSave | Is called when a document, which is managed by an Add-in, is saved.
OnWindowCreate | Is called when an ActiveX control is created for visualizing an Add-in document type.
OnWindowDestroy | Is called when an ActiveX Control is closed, which has served for visualizing an Add-in document type.
QueryCommandStatus | Is called when PCAN-Explorer wants to determine the availability state of Add-in commands.
QueryHelpContext | Is called when PCAN-Explorer wants to query information about the online help that can be displayed for the window.
QueryHelpFile | Is called when PCAN-Explorer wants to query information about the online help that can be displayed for the window.
Interfaces

In the following all interfaces are listed that can be implemented by Add-ins in order to make the desired functionality available.

Interface | Description
IPEExtensibility | Every PCAN-Explorer Add-in must implement this interface.
IPEReceiveCallback | Must be implemented, if an Add-in should be notified when a CAN message has been received.
IPESignalCallback | Must be implemented, if an Add-in should be notified when a signal value has changed.
IPEToolDocument | Must be implemented, if an Add-in manages data that it saves into files.
IPEToolWindow | Must be implemented, if an Add-in provides an ActiveX control for visualization of an own document type.
IPETransmitCallback | Must be implemented, if an Add-in should be notified when CAN messages are transmitted.

See also

Reference: PCAN-Explorer Objects


IPEExtensibility Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be implemented to create an Add-in. It provides the necessary events, a program must make available in order to be an Add-in.

The IPEExtensibility interface defines the following methods:

Method | Description
OnConnection | Is called when an Add-in is connected.
OnDisconnection | Is called when an Add-in is disconnected.
QueryCommandStatus | Is called when PCAN-Explorer wants to determine the availability state of Add-in commands.
Note

The IPEExtensibility interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To load an Add-in, PCAN-Explorer calls the Add-in's OnConnection method. When PCAN-Explorer shuts down, it unloads each Add-in by calling the OnDisconnection method. When PCAN-Explorer wants to determine the availability state of a command added by an Add-in, it calls the QueryCommandStatus method.

To implement the COM interface, Add-ins must use the following predefined interface ID (IID): E6885F19-17F6-45D0-950B-16E75BEFEC2B.

See also

How Add-ins Connect and Disconnect


IPEReceiveCallback Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be implemented by an object of an Add-in, if the Add-in wants to be notified when PCAN-Explorer receives a CAN message.

The IPEReceiveCallback interface defines following methods:

Method | Description
OnReceive | Is called when a message has been received (CAN, CAN FD, J1939).
Note

The IPEReceiveCallback interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To implement the COM interface, objects must use the following predefined interface ID (IID): 9C3F48A5-E9BA-4898-91C2-941612E9F343.

See also

How Add-ins are notified of a received Message


IPESignalCallback Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be implemented by an object of an Add-in, if the Add-in wants to be notified when a signal value has changed.

The IPESignalCallback interface defines the following methods:

Method | Description
OnChange | Is called when a signal's definition has been changed.
OnChangeValue | Is called when a signal's value has changed.
OnRemove | Is called when a signal has been removed.
Note

The IPESignalCallback interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To implement the COM interface, objects must use the following predefined interface ID (IID): 3C14E50F-47CC-407A-89EE-9F93E01C50A5.

See also

How Add-ins are notified of a changed Signal Value


IPEStream Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be used to read data from a document or write data into a document. A pointer to this interface is provided by PCAN-Explorer when the OnLoad or OnSave methods are called when loading or saving a document.

The IPEStream interface defines methods and properties, of which only the following 2 methods must be used:

Method | Description
Read | Reads data from the stream.
Write | Writes data into the stream.
Note

The IPEStream interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

The IPEStream COM interface has the following predefined interface ID (IID): 7038EC3B-848A-4882-A5D2-A371CEEB3FBE.

See also

How Add-in Document Data is Loaded and Saved


IPEToolDocument Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be implemented by an ActiveX control, if the ActiveX control manages data that shall be loaded and saved by the PCAN-Explorer file commands.

The IPEToolDocument interface defines the following methods:

Method | Description
OnDocumentCreate | Is called when a document, which is managed by an ActiveX control, is created.
OnDocumentDestroy | Is called when a document, which is managed by an ActiveX control, is closed.
OnLoad | Is called when a document, which is managed by an ActiveX control, is loaded from a file.
OnSave | Is called when a document, which is managed by an ActiveX control is saved.
Note

This IPEToolDocument interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To implement the COM interface, ActiveX controls must use the following predefined interface ID (IID): CB1C0AF0-8877-4CC1-AAD3-D912CC869A8A.

See also

How Add-in Document Data is Loaded and Saved


IPEToolWindow Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

The interface must be implemented by an ActiveX control that you want to use for the visual representation of an Add-in defined document in a PCAN-Explorer window.

The IPEToolWindow interface defines the following methods:

Method | Description
OnWindowCreate | Is called when an ActiveX control is created for the visualization of an Add-in document type.
OnWindowDestroy | Is called when an ActiveX control, that has served for the visualization of an Add-in document type, is about to be closed.
QueryHelpFile | Is called when PCAN-Explorer wants to query the name of the help file for the online help that can be displayed for the window.
QueryHelpContext | Is called when PCAN-Explorer wants to query the help context of the online help that can be displayed for the window.
Note

This IPEToolWindow interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To implement the COM interface, ActiveX controls must use the following predefined interface ID (IID): 37D11F8F-1798-4BA5-8228-CFA2092E844D.

See also

How ActiveX Controls are Connected and Disconnected


IPETransmitCallback Interface

Home Page (Add-ins) | Overview | How do I ...? | Reference

This interface must be implemented by an object of an Add-in, if the Add-in wants to be notified when PCAN-Explorer transmits messages.

The IPETransmitCallback interface defines following methods:

Method | Description
OnBeforeTransmit | Is called before a message is transmitted (CAN, CAN FD, J1939).
OnAfterTransmit | Is called after a message has been transmitted (CAN, CAN FD, J1939).
OnResume | Is called when the periodic transmission of a message is being resumed.
OnPause | Is called when the periodic transmission of a message is halted.
OnReset | Is called when the Reset command has been executed for a connection. The OnReset method is then called for all transmit messages associated with the connection for which the Reset command has been executed.
Note

The IPETransmitCallback interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

To implement the COM interface, objects must use the following predefined interface ID (IID): CAFCC024-B365-4083-BE61-D95597FFF33F.

See also

How Add-ins are notified when sending Messages


OnAfterTransmit Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

After a message has been transmitted, PCAN-Explorer calls the OnAfterTransmit methods of each TransmitCallback object registered at the TransmitMessages collection.

The OnAfterTransmit method is defined in the COM interface IPETransmitCallback.

Syntax
C++

HRESULT _stdcall OnAfterTransmit(

IPETransmitEvent *pEvent

);
C#

void OnAfterTransmit(

IPETransmitEvent pEvent

);
Delphi

function OnAfterTransmit(

const pEvent: IPETransmitEvent

): HResult; stdcall;
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM Interface of the TransmitEvent object, which represents the message that has been transmitted.

See also

OnBeforeTransmit Method


OnBeforeTransmit Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

Before a message is transmitted, PCAN-Explorer calls the OnBeforeTransmit methods of each TransmitCallback object registered at the TransmitMessages collection.

The OnBeforeTransmit method is defined in the COM interface IPETransmitCallback.

Syntax
C++

HRESULT _stdcall OnBeforeTransmit(

IPETransmitEvent *pEvent

);
C#

void OnBeforeTransmit(

IPETransmitEvent pEvent

);
Delphi

function OnBeforeTransmit(

const pEvent: IPETransmitEvent

): HResult; stdcall;
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM Interface of the TransmitEvent object, which represents the message being transmitted.

Example

The following example creates a rolling counter in data byte 0 of a message with ID 100h and a data length of 8, which is increased by one before each transmission:

C#

private byte counter = 0;

public void OnBeoreTransmit(IPETransmitEvent event)

{

if (event.ID == 0x100 && event.DataLength == 8)

{

event.Data[0] = counter++;

}

}

See also

OnAfterTransmit Method


OnChange Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a value of any of the signal's properties has changed, for example the name or the data type, PCAN-Explorer calls the OnChange methods of all SignalCallback objects registered at the signal.

The OnChange method is defined in the COM interface IPESignalCallback.

Syntax
C++

HRESULT _stdcall OnChange(

IPESignal * pSignal

);
C#

void OnChange(

IPESignal pSignal

);
Delphi

function OnChange(

const pSignal: IPESignal

): HResult; stdcall;
Parameters

pSignal

A pointer (IPESignal*) to the Dual Interface of the PCAN-Explorer Signal object, of which a property has been changed.


OnChangeValue Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a signal's value changes, for example when a CAN message with new data has been received, PCAN-Explorer calls the OnChangeValue methods of all SignalCallback objects registered at the signal.

The OnChangeValue method is defined in the COM interface IPESignalCallback.

Syntax
C++

HRESULT _stdcall OnChangeValue(

IPESignal *pSignal

);
C#

void OnChangeValue(

IPESignal pSignal

);
Delphi

function OnChangeValue(

const pSignal: IPESignal

): HResult; stdcall;
Parameters

pSignal

A pointer (IPESignal*) to the Dual Interface of the PCAN-Explorer Signal object, whose value has changed.

See also

Adding a Notification at Modification of a Signal Value


OnConnection Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

To load an Add-in, PCAN-Explorer calles the OnConnection method of the Add-in.

The OnConnection method is defined in the COM interface IPEExtensibility.

Syntax
C++

HRESULT _stdcall OnConnection(

IDispatch *pApp,

VARIANT_BOOL bFirstTime,

long dwCookie,

/* [out, retval] */ VARIANT_BOOL * res

);
C#

bool OnConnection(

object pApp,

bool bFirstTime,

int dwCookie

);
Delphi

function OnConnection(

const pApp: IDispatch;

bFirstTime: WordBool;

dwCookie: Integer;

out res: WordBool

): HResult; stdcall;
Parameters

pApp

A pointer (IDispatch*) to the Dual Interface of the PCAN-Explorer Application object. This pointer to can be transformed into an IPEApplication interface pointer with a QueryInterface call.

bFirstTime

Indicates, if this is the first time that the Add-in has been loaded into the environment. Possible values are:

  • VARIANT_TRUE (C++), true (C#, Delphi),
    It is the first time, that the Add-in has been loaded, or the Add-in has been disconnected and reloaded again by the user.

  • VARIANT_FALSE (C++), false (C#, Delphi),
    The Add-in has been loaded in another session before.

dwCookie

The Add-in must use this value to identify itself in subsequent calls to PCAN-Explorer. For example, the Add-in uses this cookie to call the AddCommand method.

res

Returns the result.

Possible values are:

  • VARIANT_FALSE / false: The Add-in is not loaded.

  • VARIANT_TRUE / true: The Add-in is loaded successfully.

Return values

(C#)

  • false: The Add-in is not loaded.

  • true: The Add-in is loaded successfully.

Usage

To connect, the Add-in takes the following steps:

  1. Uses the pApp parameter to ensure that required objects in the PCAN-Explorer object model are installed. If required objects are not available, the Add-in returns VARIANT_FALSE (C++) or false (C#, Delphi) or indicating that it should not be loaded.

  2. Uses the bFirstTime parameter to determine if this is the first time the Add-in has been loaded into the environment. If it is the first time, bFirstTime is VARIANT_TRUE (C++) or true (C#, Delphi) or and the Add-in can carry out initializations that are necessary only the first time.

Tip: You only need to add key bindings the first time an Add-in is loaded because the environment keeps track of them in subsequent loads.

  3. Provides information about itself by calling the SetAddInInfo method. If the Add-in fails to provide the required information, the environment unloads the Add-in by calling the Add-in's OnDisconnection method. Then, the environment displays a message box describing what the Add-in failed to do.

  4. Connects to events. The Add-in locates the appropriate PCAN-Explorer objects and then connects to their events.

  5. Adds commands by calling the AddCommand method.

  6. Stores the cookie and the pointer (Application*) to the Application object for future use. If the used compiler does not support automatic referencing for interface pointers, the Add-in must explicitly call the interface's AddRef function. Storing the pointer is recommended because PCAN-Explorer will not pass the pointer to the Add-in again.

  7. Returns VARIANT_TRUE (C++) or true (C#, Delphi) indicating that the Add-in loaded successfully.

See also

OnDisconnection Method


OnDisconnection Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When PCAN-Explorer shuts down, the environment unloads each Add-in by calling the OnDisconnection method.

The OnDisconnection method is defined in the COM interface IPEExtensibility.

Syntax
C++

HRESULT _stdcall OnDisconnection(

VARIANT_BOOL bLastTime

);
C#

void OnDisconnection(

bool bLastTime

);
Delphi

function OnDisconnection(

bLastTime: WordBool

): HResult; stdcall;
Parameters

bLastTime

Indicates, why the Add-in is unloaded. Possible values are:

  • VARIANT_TRUE (C++), true (C#, Delphi)
    The user removes (uninstalls) the Add-in.

  • VARIANT_FALSE (C++), false (C#, Delphi)
    PCAN-Explorer is exiting.

Usage

To disconnect, the Add-in takes the following steps:

  1. Examines the bLastTime parameter to determine why it is unloading.

  2. Disconnects from events.

  3. Releases the pointer to the Dual Interface on the PCAN-Explorer Application object - if it stored the pointer while connecting to the environment.

  4. Performs cleanup tasks such as deallocating memory, freeing resources, and so on.

See also

OnConnection Method


OnDocumentCreate Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is created, whose type is defined by an Add-in, PCAN-Explorer calls the OnDocumentCreate method of the ActiveX Control.

The OnDocumentCreate method is defined in the COM interface IPEToolDocument.

Syntax
C++

HRESULT _stdcall OnDocumentCreate(

IPEDocument *pDoc

);
C#

void OnDocumentCreate(

IPEDocument pDoc

);
Delphi

function OnDocumentCreate(

const pDoc: IPEDocument

): HResult; stdcall;
Parameters

pDoc

A pointer (IPEDocument*) to the Dual Interface of the newly created Document object.

See also

OnDocumentDestroy Method


OnDocumentDestroy Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is closed, whose type is defined by an Add-in, PCAN-Explorer calls the OnDocumentDestroy method of the ActiveX Control.

The OnDocumentDestroy method is defined in the COM interface IPEToolDocument.

Syntax
C++

HRESULT _stdcall OnDocumentDestroy( void );
C#

void OnDocumentDestroy( void );
Delphi

function OnDocumentDestroy: HResult; stdcall;

See also

OnDocumentCreate Method


OnLoad Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is loaded from a file, whose type is defined by an Add-in, PCAN-Explorer calls the OnLoad method of the ActiveX Control, so that the ActiveX Control can read data from the file.

The OnLoad method is defined in the COM interface IPEToolDocument.

Syntax
C++

HRESULT _stdcall OnLoad(

IPEStream *pStream,

/* [out, retval] */ VARIANT_BOOL * res

);
C#

bool OnLoad(

IPEStream pStream

);
Delphi

function OnLoad(

const pStream: IPEStream;

out res: WordBool

): HResult; stdcall;
Parameters

pStream

A pointer (IPEStream*) to the Stream object that can be used to read data.

res

Returns the result.

Possible values are:

  • VARIANT_FALSE: An error occurred while reading data from the stream.

  • VARIANT_TRUE: The data has been read successfully from the stream.

Return values

(C#)

  • false: An error occurred while reading data from the stream.

  • true: The data has been read successfully from the stream.

See also

OnSave Method


OnPause Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When the periodic transmission of a message is halted, PCAN-Explorer calls the OnPause methods of each TransmitCallback object registered at the TransmitMessages collection.

The OnPause method is defined in the COM interface IPETransmitCallback.

Syntax
C++

HRESULT _stdcall OnPause(

IPETransmitEvent *pEvent

);
C#

void OnPause(

IPETransmitEvent pEvent

);
Delphi

function OnPause(

const pEvent: IPETransmitEvent

): HResult; stdcall;
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM Interface of the TransmitEvent object, which represents the message for which the periodic transmission is halted.

See also

OnResume Method


OnReceive Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a message has been received, PCAN-Explorer calls the OnReceive methods of each ReceiveCallback object registered at the ReceiveMessages collection.

The OnReceive method is defined in the COM interface IPEReceiveCallback.

Syntax
C++

HRESULT _stdcall OnReceive(

IPEReceiveMessage *pMessage

);
C#

void OnReceive(

IPEReceiveMessage pMessage

);
Delphi

function OnReceive(

const pMessage: IPEReceiveMessage

): HResult; stdcall;
Parameters

pMessage

A pointer (IPEReceiveMessage*) to the Dual Interface of the PCAN-Explorer ReceiveMessage object, which represents the received message.


OnRemove Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a signal is removed from the Signals collection of the Application object, for example because the Symbols file inserting the signal into the Signals collection was removed from the project by the user, PCAN-Explorer calls the OnRemove methods of each SignalCallback object registered at the signal.

The OnRemove method is defined in the COM interface IPESignalCallback.

Syntax
C++

HRESULT _stdcall OnRemove(

IPESignal *pSignal

);
C#

void OnRemove(

IPESignal pSignal

);
Delphi

function OnRemove(

const pSignal: IPESignal

): HResult; stdcall;
Parameters

pSignal

A pointer (IPESignal*) to the Dual Interface of the PCAN-Explorer Signal object that has been removed.

Remarks

A signal is deactivated, if either the Symbols file, which inserted the signal into the Signals collection is removed from the project, or if a VBScript Macro or an Add-in manually removes the signal from the Signals collection, by calling its Remove method.

PCAN-Explorer passes a pointer (IPESignal*) to the Dual Interface of the PCAN-Explorer Signal object that has been removed.


OnReset Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When the Reset command has been executed for a connection, PCAN-Explorer calls the OnReset methods of each TransmitCallback object registered at the TransmitMessages collection. The call is made one after the other for all messages in the collection that are associated with the connection for which the Reset command has been executed.

The OnReset method is defined in the COM interface IPETransmitCallback.

Syntax
C++

HRESULT _stdcall OnReset(

IPETransmitEvent *pEvent

);
C#

void OnReset(

IPETransmitEvent pEvent

);
Delphi

function OnReset(

const pEvent: IPETransmitEvent

): HResult; stdcall;
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM Interface of the TransmitEvent object, which represents the transmit message that is affected by the Reset command.


OnResume Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When the periodic transmission of a message is being resumed, PCAN-Explorer calls the OnResume methods of each TransmitCallback object registered at the TransmitMessages collection.

The OnResume method is defined in the COM interface IPETransmitCallback.

Syntax
C++

HRESULT _stdcall OnResume(

IPETransmitEvent *pEvent

);
C#

void OnResume(

IPETransmitEvent pEvent

);
Delphi

function OnResume(

const pEvent: IPETransmitEvent

): HResult; stdcall;
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM Interface of the TransmitEvent object, which represents the message for which the periodic transmission is resumed.

See also

OnPause Method


OnSave Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is saved into a file, whose type is defined by an Add-in, PCAN-Explorer calls the OnSave method of the ActiveX Control, so that the ActiveX Control can save data into the file.

The OnSave method is defined in the COM interface IPEToolDocument.

Syntax
C++

HRESULT _stdcall OnSave(

IPEStream *pStream

);
C#

bool OnSave(

IPEStream pStream

);
Delphi

function OnSave(

const pStream: IPEStream

): HResult; stdcall;
Parameters

pStream

A pointer (IPEStream*) to the Stream object that can be used to save data.

See also

OnLoad Method


OnWindowCreate Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is created, whose type is defined by an Add-in, a new window which contains an ActiveX control for the document's visual representation is also created. PCAN-Explorer calls the OnWindowCreate method of the ActiveX control, to inform it about the creation of the window.

The OnWindowCreate method is defined in the COM interface IPEToolWindow.

Syntax
C++

HRESULT _stdcall OnWindowCreate(

IPEWindow *pWnd,

/* [out, retval] */ VARIANT_BOOL *res

);
C#

bool OnWindowCreate(

IPEWindow pWnd

);
Delphi

function OnWindowCreate(

const pWnd: IPEWindow;

out res: WordBool

): HResult; stdcall;
Parameters

pWnd

A pointer (IPEWindow*) to the Dual Interface of the PCAN-Explorer Window object, which contains the ActiveX control.

res

Returns the result.

Possible values are:

  • VARIANT_FALSE: The window that contains the ActiveX control is not displayed.

  • VARIANT_TRUE: The window that contains the ActiveX control is displayed.

Return values

(C#)

  • false: The window that contains the Active X control is not displayed.

  • true: The window that contains the Active X control is displayed.

Usage

PCAN-Explorer passes a pointer (IPEWindow*) to the Dual Interface of the PCAN-Explorer Window object.

To connect, the ActiveX control takes the following steps:

  1. Uses the Application property of the pWnd Pointer to get a pointer to the Application object of PCAN-Explorer.

  2. Uses the Application object to ensure that required objects in the PCAN-Explorer object model are installed. If required objects are not available, the ActiveX control returns VARIANT_FALSE (C++, Delphi) or false (C#) indicating that the window cannot be displayed.

  2. Connects to events. The Active X control locates the appropriate PCAN-Explorer objects and then connects to their events.

  3. Stores the pointer (IPEWindow*) to the Window object for future use. If the used compiler does not support automatic referencing for interface pointers, the Add-in must explicitly call the interface's AddRef function. Storing the pointer is recommended because PCAN-Explorer will not pass the pointer to the ActiveX control again.

See also

OnWindowDestroy Method


OnWindowDestroy Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a document is closed, whose type is defined by an Add-in, the window which contains the ActiveX control for the document's visual representation is also closed. PCAN-Explorer calls the OnWindowDestroy method of the ActiveX control.

The OnWindowDestroy method is defined in the COM interface IPEToolWindow.

Syntax
C++

HRESULT _stdcall OnWindowDestroy( void );
C#

void OnWindowDestroy( void );
Delphi

function OnWindowDestroy: HResult; stdcall;
Usage

To disconnect, the ActiveX control takes the following steps:

  1. Disconnects from events.

  2. Releases the pointer (IPEWindow*) to the Dual Interface on the PCAN-Explorer Window object - if it had stored the pointer while connecting.

  3. Performs cleanup tasks such as deallocating memory, freeing resources, and so on.

See also

OnWindowCreate Method


QueryCommandStatus Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

PCAN-Explorer must query regularly the availability state of the various Add-in's commands. An Add-in can control the availability of its commands by returning a corresponding value, when PCAN-Explorer calls the method QueryCommandStatus.

The QueryCommandStatus method is defined in the COM interface IPEExtensibility.

Syntax
C++

HRESULT __stdcall QueryCommandStatus(

int nBitmapOffset,

PeCommandStatus *Status

);
C#

void QueryCommandStatus(

int nBitmapOffset,

ref PeCommandStatus Status

);
Delphi

function QueryCommandStatus(

nBitmapOffset: Integer;

var Status: PeCommandStatus

): HResult; stdcall;
Parameters

nBitmapOffset

Indicates the command which is queried for its status. The parameter corresponds to the same value nBitmapOffset, that was submitted to PCAN-Explorer during the call of the AddCommand method, in order to add the command.

Status

A value of the type PeCommandStatus that defines the desired state of the command.

  • peCommandStatusDisabled: The command in not available for the user.

  • peCommandStatusEnabled: The command is available for the user.

  • peCommandStatusLatched: The button of the command is shown in the pushed state. The menu entry for the command in the Tools menu shows a check mark. This value can be combined with the value peCommandStatusEnabled.

Usage

To define the state of a command, the Add-in takes the following steps:

  1. Using the nBitmapOffset parameter it determines the command whose state is queried.

  2. Returns the desired state in the parameter Status.


QueryHelpContext Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a window is opened, that contains an ActiveX control for its visualization, PCAN-Explorer queries the ActiveX control for information about its online help. If the ActiveX control implements the IPEToolWindow interface, PCAN-Explorer calls the QueryHelpContext method and the QueryHelpFile method so that the ActiveX control can inform PCAN-Explorer of the help file and the help context. When the user presses the [F1] key while the ActiveX control has the input focus, PCAN-Explorer displays this help file and help topic.

The QueryHelpContext method is defined in the COM interface IPEToolWindow.

Syntax
C++

HRESULT _stdcall QueryHelpContext(

/* [out, retval] */ int *nContext

);
C#

int QueryHelpContext( void );
Delphi

function QueryHelpContext(

out nContext: Integer

): HResult; stdcall;
Parameters

nContext

(out) Here, the context number of the help topic to be displayed must be returned. If the value 0 is returned, PCAN-Explorer does not display help for this window.

Return value

(C#) The context number of the help topic to be displayed. If the value 0 is returned, PCAN-Explorer does not display help for this window.

Remarks

The QueryHelpContext method is called only once, after the ActiveX control has been created. This is done directly after the call to the OnWindowCreate and QueryHelpFile methods.

See also

QueryHelpFile Method

How ActiveX Controls are Connected and Disconnected


QueryHelpFile Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

When a window is opened, that contains an ActiveX control for its visualization, PCAN-Explorer queries the ActiveX control for information about its online help. If the ActiveX control implements the IPEToolWindow interface, PCAN-Explorer calls the QueryHelpFile method and the QueryHelpContext method so that the ActiveX control can inform PCAN-Explorer of the help file and the help context. When the user presses the [F1] key while the ActiveX control has the input focus, PCAN-Explorer displays this help file and help topic.

The QueryHelpFile method is defined in the COM interface IPEToolWindow.

Syntax
C++

HRESULT _stdcall QueryHelpFile(

/* [out, retval] */ BSTR *szHelpFile

);
C#

string QueryHelpFile( void );
Delphi

function QueryHelpFile(

out szHelpFile: WideString

): HResult; stdcall;
Parameters

szHelpFile

(out) Here, the name of the help file to be displayed must be returned. If an empty string is returned, PCAN-Explorer does not display help for this window.

Return value

(C#) The name of the help file to be displayed. If an empty string is returned, PCAN-Explorer does not display help for this window.

Remarks

The QueryHelpFile method is called only once, after the ActiveX control has been created. This is done directly after the call to the OnWindowCreate method.

See also

QueryHelpContext Method

How ActiveX Controls are Connected and Disconnected


Read Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

This method can be called by an ActiveX control to read data from a document, when PCAN-Explorer opens the document.

The Read method is defined in the COM interface IPEStream.

Syntax
C++

HRESULT _stdcall Read(

unsigned char *pByte,

int cb,

/* [out, retval] */ int *pcbRead

);
C#

int Read(

ref byte pByte,

int cb

);
Delphi

function Read(

var pByte: Byte;

cb: Integer;

out pcbRead: Integer

): HResult; stdcall;
Parameters

pByte

A pointer to the buffer into which the stream data is read.

cb

The number of data bytes to attempt to read from the stream object.

pcbRead

A pointer to a long variable that receives the actual number of bytes read from the stream object.

Return value

(C++, Delphi) If the method succeeds, the return value is S_OK.

(C#) Actual number of bytes read from the stream object.

See also

Write Method


Write Method

Home Page (Add-ins) | Overview | How do I ...? | Reference

This method can be called by an ActiveX control to store data into a document, when PCAN-Explorer saves the document.

The Write method is defined in the COM interface IPEStream.

Syntax
C++

HRESULT _stdcall Write(

unsigned char *pByte,

int cb,

/* [out, retval] */ int *pcbWritten

);
C#

int Write(

ref byte pByte,

int cb

);
Delphi

function Write(

var pByte: Byte;

cb: Integer;

out pcbWritten: Integer

): HResult; stdcall;
Parameters

pByte

A pointer to the memory buffer, which contains the data to write.

cb

The number of bytes of data to write into the stream object.

pcbWritten

A pointer to a long variable that receives the actual number of bytes written into the stream object.

Return value

(C++, Delphi) If the method succeeds, the return value is S_OK.

(C#) The actual number of bytes written into the stream object.

See also

Read Method


Home Page: Callback Libraries

Callback Libraries are Dynamic Link Libraries (DLLs) that you write for example in Microsoft Visual C++ and include in a PCAN-Explorer project. With Callback Libraries you can do the following:

  • evaluate, process, or modify data of CAN messages before or after they have been transmitted

  • evaluate, process, or modify data of received CAN messages before they are processed by PCAN-Explorer

  • perform other message-related tasks when sending and receiving.

In This Section

Overview

Information about the operation of Callback Libraries and the communication of PCAN-Explorer with Callback Libraries.

Reference

Contains the reference for all objects, methods, and interfaces that are needed when creating and using Callback Libraries.

Related Sections

Add-ins

Contains topics about how to create, install, and use Add-ins.

VBScript Macros

Documentation about VBScript Macros as well as their creation and use.

PCAN-Explorer Objects

Documentation of the PCAN-Explorer object model.

Customizing PCAN-Explorer

Information about possibilities of customizing PCAN-Explorer to own needs.


Overview: Callback Libraries

Home Page (Callback Libraries) | Reference

With Callback Libraries you can evaluate, process, or modify data of received or transmitted CAN messages in your own way.

Callback Libraries are Dynamic Link Libraries (DLLs) that you can create yourself with suitable compilers and program them according to your needs. Once it is created, you include a Callback Library in a PCAN-Explorer project, so that you can assign the individual programmed functions to different events, which PCAN-Explorer triggers when it receives or sends CAN messages, and then calls the functions assigned to these events.

PCAN-Explorer passes special objects to the DLL functions as function parameters, which allow the respective function to access the data of the transmitted or received message. The function of the Callback Library can use the different properties and methods of these objects to process or modify the data bytes of the message according to its needs, or to perform other tasks. For example, a function could calculate a running counter or a checksum for the message and insert it into the data bytes at the correct location before it is transmitted, to ensure the integrity of the message and that it can be acknowledged by the recipient as a valid message.

Related topics

  • The process for creating Callback Libraries

  • How Callback Library functions are executed


The Process for Creating Callback Libraries

Home Page (Callback Libraries) | Overview | Reference

A summary of the design process for a Callback Library is listed in the following.

  1. Decide, which programming language to use.

  2. Create a project for the Callback Library (Windows Desktop Dynamic-Link Library) with a 32-bit build configuration.

  3. Write the functions you would like to export from the DLL.

  4. Build the DLL from the source files.

  5. Include the DLL in a PCAN-Explorer project.

  6. From the Project Manager, open the DLL to show the Callback Library window, and assign your exported DLL functions to the available events.


How Callback Library Functions are Executed

Home Page (Callback Libraries) | Overview | Reference

Whenever an event occurs to which an exported DLL function has been assigned, PCAN-Explorer calls the function and waits until it returns before resuming its operation. Depending on the kind of event, it passes different parameters to the DLL function that enables the function to access the object for which the event has been triggered.

Depending on the event, there are currently three different parameter types:

Event | Parameter Type | Description
OnDisable OnEnable | IPECallbackLibraryEvent * | Pointer to an IPECallbackLibraryEvent interface that allows access to a CallbackLibraryEvent object.
OnReceive OnTimingError | IPEReceiveEvent * | Pointer to an IPEReceiveEvent interface that allows access to a ReceiveEvent object.
OnAfterTransmit OnBeforeTransmit OnPause OnReset OnResume | IPETransmitEvent * | Pointer to an IPETransmitEvent interface that allows access to a TransmitEvent object.

The objects ReceiveEvent and TransmitEvent that you can access via the provided interfaces have a slightly reduced set of properties and methods compared to the full-featured counterparts ReceiveMessage and TransmitMessage, and allow only write access to those attributes of the message objects that can be manipulated when the events are triggered. For example, the ID property of the TransmitMessage object has read and write access, but the ID property of the TransmitEvent object is read-only.

Attention

Callback Library functions are executed in the main thread of PCAN-Explorer. Therefore, do no lengthy operations in your DLL functions, since this interrupts all tasks PCAN-Explorer performs. Even background worker threads are often synchronized with the main thread, so consuming too much time in the DLL function could cause window painting problems, an unresponsive user interface, or, in the worst case, the loss of CAN messages.

When you write callback functions to handle received or transmitted messages, it is strictly recommended to use only the methods and properties of the provided interfaces to evaluate or manipulate the immediate objects ReceiveEvent and TransmitEvent, and not to access any other object in the PCAN-Explorer object model. The latter is theoretically possible, for example in a handler of the OnEnable event, where the IPECallbackLibraryEvent interface and its Application property allows the access to any other object in the object model. It is not recommended to store object references there for later use in other callback functions. It is not guaranteed that accessing properties and methods of other objects will succeed in future releases of PCAN-Explorer when a receive- or transmit-related Callback Library function is called.

You can disable the execution of Callback Library functions for a specific DLL by unchecking the Enable Callback Functions option in the configuration window of the corresponding DLL.

When an error is detected in a called DLL function, PCAN-Explorer disables further processing of the DLL functions by automatically turning off the Enable Callback Functions option for the DLL while the OnDisable event is still triggered.


Reference: Callback Libraries

Home Page (Callback Libraries) | Overview

With Callback Libraries you can evaluate, process, or modify data of received and transmitted CAN messages in your own way.

Methods

Listed in the following are all events that PCAN-Explorer triggers in connection with Callback Libraries. For this the Callback Library must export functions which are then assigned to these events in the loaded PCAN-Explorer project.

Event | Description
OnAfterTransmit | Occurs after a message has been transmitted.
OnBeforeTransmit | Occurs before a message is transmitted.
OnDisable | Occurs when a Callback Library is being disabled.
OnEnable | Occurs when a Callback Library is being enabled.
OnPause | Occurs when the periodic transmission of a message is halted.
OnReceive | Occurs after a message has been received.
OnReset | Occurs when the Reset command has been executed for a connection.
OnResume | Occurs when the periodic transmission of a message is being resumed.
OnTimingError | Occurs when a timing error has been detected for a received message.
Interfaces

In the following all interfaces are listed that PCAN-Explorer uses when calling functions exported from Callback Libraries.

Interface | Description
IPECallbackLibraryEvent | A pointer to this interface is passed to a callback function that handles events for the Callback Library itself, e.g. on enabling/disabling the library.
IPEReceiveEvent | A pointer to this interface is passed to a callback function that handles events for messages that are received by PCAN-Explorer.
IPETransmitEvent | A pointer to this interface is passed to a callback function that handles events for messages that are transmitted by PCAN-Explorer.

See also

Reference: PCAN-Explorer Objects


IPECallbackLibraryEvent Interface

Home Page (Callback Libraries) | Overview | Reference

This interface can be used to query information about a Callback Library that is being enabled or disabled. A pointer to this interface is passed by PCAN-Explorer to the called callback functions when the OnEnable or OnDisable events occur.

For a list of properties and methods of the IPECallbackLibraryEvent interface, please see the reference of the CallbackLibraryEvent object.

Note

The IPECallbackLibraryEvent interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

The IPECallbackLibraryEvent COM interface has the following predefined interface ID (IID): 2F9B6A72-2A97-4EC1-A884-590A21A35D12. The interface is defined in the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder.


IPEReceiveEvent Interface

Home Page (Callback Libraries) | Overview | Reference

This interface must be used to read data from a message that has been received by PCAN-Explorer. A pointer to this interface is passed by PCAN-Explorer to the called callback functions when the OnReceive or OnTimingError events occur.

For a list of properties and methods of the IPEReceiveEvent interface, please see the reference of the ReceiveEvent object.

Note

The IPEReceiveEvent interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

The IPEReceiveEvent COM interface has the following predefined interface ID (IID): 0CB3A137-E323-4C8F-B4A1-7EBBD075DCF3. The interface is defined in the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder.


IPETransmitEvent Interface

Home Page (Callback Libraries) | Overview | Reference

This interface must be used to read or modify data of a message that is being transmitted by PCAN-Explorer. A pointer to this interface is passed by PCAN-Explorer to the called callback functions when the OnBeforeTransmit, OnAfterTransmit, OnResume, OnPause, or OnReset events occur.

For a list of properties and methods of the IPETransmitEvent interface, please see the reference of the TransmitEvent object.

Note

The IPETransmitEvent interface is not a Dual Interface, since it is not derived from IDispatch. It is derived from IUnknown.

The IPETransmitEvent COM interface has the following predefined interface ID (IID): 226B0C97-D642-43D3-A5CA-E24A89055879. The interface is defined in the PCAN-Explorer Callback Events Type Library PECallbackEvents.tlb, which is located in the PCAN-Explorer installation folder.


OnAfterTransmit Event

Home Page (Callback Libraries) | Overview | Reference

Occurs after a message has been transmitted (CAN, CAN FD, J1939).

Syntax
C++

HRESULT __stdcall FunctionName(

IPETransmitEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPETransmitEvent

);
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM interface of the PCAN-Explorer TransmitEvent object, which represents the message that has been transmitted.


OnBeforeTransmit Event

Home Page (Callback Libraries) | Overview | Reference

Occurs before a message is transmitted (CAN, CAN FD, J1939).

Syntax
C++

HRESULT __stdcall FunctionName(

IPETransmitEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPETransmitEvent

);
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM interface of the PCAN-Explorer TransmitEvent object, which represents the message that is transmitted.

Example

The following example creates a rolling counter in data byte 0 of a message with ID 100h, which is increased by one before each transmission:

Visual C++

using namespace PCANExplorer6;

int counter = 0;

HRESULT __stdcall HandleBeforeTransmit(IPETransmitEvent *pEvent)

{

long id;

if (SUCCEEDED(pEvent->get_ID(&id)) && (id == 0x100))

{

counter++;

if (counter > 255)

counter = 0;

pEvent->put_Data(0, counter);

}

return S_OK;

}
Delphi / Lazarus

uses PCANExplorer6_2_0_TLB;

var counter: Integer = 0;

function HandleBeforeTransmit(const pEvent: IPETransmitEvent): HRESULT; stdcall;

begin

if (event.ID = $100) then

begin

Inc(counter);

if (counter > 255) then

counter := 0;

event.Data[0] := counter;

end;

Result := S_OK;

end;


OnDisable Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when a Callback Library is being disabled.

Syntax
C++

HRESULT __stdcall FunctionName(

IPECallbackLibraryEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPECallbackLibraryEvent

);
Parameters

pEvent

A pointer (IPECallbackLibraryEvent*) to the COM interface of the PCAN-Explorer CallbackLibraryEvent object, which represents the Callback Library that is being disabled.


OnEnable Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when a Callback Library is being enabled.

Syntax
C++

HRESULT __stdcall FunctionName(

IPECallbackLibraryEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPECallbackLibraryEvent

);
Parameters

pEvent

A pointer (IPECallbackLibraryEvent*) to the COM interface of the PCAN-Explorer CallbackLibraryEvent object, which represents the Callback Library that is being enabled.


OnPause Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when the periodic transmission of a message is halted.

Syntax
C++

HRESULT __stdcall FunctionName(

IPETransmitEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPETransmitEvent

);
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM interface of the PCAN-Explorer TransmitEvent object, which represents the message for which the periodic transmission is halted.


OnReceive Event

Home Page (Callback Libraries) | Overview | Reference

Occurs after a message has been received (CAN, CAN FD, J1939).

Syntax
C++

HRESULT __stdcall FunctionName(

IPEReceiveEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPEReceiveEvent

);
Parameters

pEvent

A pointer (IPEReceiveEvent*) to the COM interface of the PCAN-Explorer ReceiveEvent object, which represents the message that has been received.


OnReset Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when the Reset command has been executed for a connection. The event is then triggered for all transmit messages associated with the connection for which the Reset command has been executed.

Syntax
C++

HRESULT __stdcall FunctionName(

IPETransmitEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPETransmitEvent

);
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM interface of the PCAN-Explorer TransmitEvent object, which represents the message for which the OnReset event has been triggered.


OnResume Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when the periodic transmission of a message is being resumed.

Syntax
C++

HRESULT __stdcall FunctionName(

IPETransmitEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPETransmitEvent

);
Parameters

pEvent

A pointer (IPETransmitEvent*) to the COM interface of the PCAN-Explorer TransmitEvent object, which represents the message for which the periodic transmission is resumed.


OnTimingError Event

Home Page (Callback Libraries) | Overview | Reference

Occurs when a timing error has been detected for a received message.

Syntax
C++

HRESULT __stdcall FunctionName(

IPEReceiveEvent *pEvent

);
Pascal

function FunctionName(

const pEvent: IPEReceiveEvent

);
Parameters

pEvent

A pointer (IPEReceiveEvent*) to the COM interface of the PCAN-Explorer ReceiveEvent object, which represents the message for which a timing error has been detected.

Remarks

Detecting of timing errors depends on the values of the parameters Timeout and MinInterval of Symbol or Multiplexer definitions, please also see Timing. Additionally, logging of timing errors must be enabled for the currently loaded project, either in the Project Settings dialog box, or via the [image] button on the toolbar.


Home Page: Reference

This section contains information about dialog boxes and windows, key combinations, PCAN-Explorer commands, Macros, and error messages.

In This Section

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.

PCAN-Explorer Commands

Contains the reference for all predefined PCAN-Explorer commands.

Symbols Files

Contains the reference for Symbols Files.

Standard Macros

Contains the reference for standard Macros.

Error Messages

Enumerates all the error messages that may occur when working with Symbols Files and Standard Macros, as well as in transmit and receive operations.

Related Sections

VBScript Language Reference

Contains topics to the VBScript programming language regarding properties, methods, objects, functions and others.


User Interface

User Interface

Home Page (Reference)

The User Interface Reference topics explain the user interface elements that appear in the various dialog boxes, windows, and other parts of the user interface. Reference topics are usually displayed if you press the [F1] key in a dialog box or a window, or press the Help button in a dialog box.

In This Section

General Elements of the User Interface

Describes the Properties Window, Output window, Text editor, Library Browser, About dialog box, Add-in Manager dialog box, and the External Tools dialog box.

Project-specific Elements of the User Interface

Describes the elements of the user interface that are used in dealing with projects. i.e. the Project Manager.

CAN-specific Elements of the User Interface

Describes elements of the user interface regarding CAN, e.g. the Add Connection dialog box and the Edit Message dialog box.

File-related Elements

Describes elements of the user interface that are used in dealing with files.

Macro Elements

Describes elements of the user interface regarding VBScript Macros and Standard Macros.

Options Dialog Box

Allows the configuration of various options to influence the PCAN-Explorer environment.

Receive/Transmit Window

Shows received CAN and J1939 messages and allows the manual transmission of own messages.

Signal and Symbol Elements

Describes elements of the user interface regarding signals and Symbols, e.g. the Select Signal dialog and the Watch window.

Key Combinations

Describes predefined key combinations and further elements of the user interface regarding key combinations.

Tracer Elements

Contains the reference to elements of the user interface regarding the message tracer.

Other Elements

Describes other elements of the user interface that to not fit into any of the categories, e.g. the Callback Library window.

Related Sections

PCAN-Explorer Commands

Contains the reference for the predefined PCAN-Explorer commands.

Error Messages

This section enumerates all error messages that may occur when working with Symbols Files and Standard Macros, as well as in transmit and receive operations.


General Elements of the User Interface

In the following general elements are listed that are available in the user interface of PCAN-Explorer, such as the Properties window, the Connections window, and the Output window.

In This Section

Properties Window

Shows the properties of different objects when they are selected in the user interface.

Output Window

Shows status messages for different elements of the PCAN-Explorer user interface.

Connections Window

Contains a detailed overview of all connections of the current project.

Add-in Manager Dialog Box

Allows the installation of PCAN-Explorer Add-ins.

VBS Macro Manager Dialog Box

Manages VBScript Macros.

External Tools Dialog Box

Allows adding of items to the Tools menu to launch external tools from within PCAN-Explorer.

Library Browser

A tool to browse the PCAN-Explorer Library.

Text Editor

Allows editing of Symbol Files, Standard Macros, and VBScript Macros.

About Dialog Box

Shows information about PCAN-Explorer.

Related Sections

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Properties Window

The Properties window can be used to display or change properties of any element selected in the PCAN-Explorer user interface.

To access the Properties window, select Properties from the View menu.

See also

User Interface


Output Window

The Output window shows status and event messages for various elements of the PCAN-Explorer user interface.

To show the Output window, select the Output command on the View menu.

The Output window shows messages on different tabs:

Messages

On this page, general messages are displayed that are generated by various elements of the user interface.

Editor

On this page, messages from the text editor are displayed, e.g. error messages, that can occur during the activation of Symbol Files or while compiling Standard Macros.

Macro

This page shows messages that are create by the PrintToOutputWindow method of VBScript Macros, or the PrintToOutputWindow statement of standard Macros.

Events

This page shows messages for the following events:

  • Bus errors

  • Plug-in and plug-out of CAN hardware

  • J1939 addressing protocol messages and errors.

Additional tabs can be created e.g. by accessing the OutputWindowPanes collection from a VBScript Macro.

See also

User Interface


Connections Window

The connections window gives a quick overview about all connections of the current project. In contrary to the connections node of the Project Manager, which only informs about the names and connection status of the connections, the connections window shows detailed information for each connection. Furthermore, you can choose which information is shown in the window.

To access the connections window, select Connections on the View menu.

Toolbar

Button | Command | Description
 | Add Connection | Adds a new connection to the current project.
 | Reset Connection | Resets the connection that is selected in the list. Depending on which actions are enabled for the Reset command in the Options dialog box on the Receive/Transmit page, messages belonging to the connection can be deleted from the Receive list, message counters and time data can be cleared in the Receive and Transmit lists, and periodic transmit messages can be restarted.
 | Claim Address | If the selected connection uses the J1939 protocol, you can use this button to claim an address for the connection. The connection will attempt to claim the address that is entered as Preferred Address in the connection properties (see also specification SAE J1939-81, Network Management).
 | Release Address | If the selected connection uses the J1939 protocol, and if an address has already been claimed for the connection, you can use this button to release the claimed address (see also specification SAE J1939-81, Network Management).

Columns in the Connections Window

The following columns are available in the Connections Window:

(Enabled)

This column has no caption text. Set a check mark or clear the check mark in one of the boxes to enable/disable a connection.

Bus

Shows the bus number of the connection (1-16).

Name

The name of the connection as it also appears in the Project Manager.

Net Connection

The net connection in the form NetName@DeviceName.

Net Name

The name of the PCAN net the connection uses.

Device

The name of the PCAN device the connection uses.

Hardware

The name of the PCAN hardware used.

Bit Rate

The transfer rate on the CAN bus.

Status

The current bus status of the connection. The following status texts can be displayed here:
OK, Error Passive, Warning, Bus-Off, BUSLIGHT, BUSHEAVY, OVERRUN, QOVERRUN. See also Hardware Status.

Overruns

The number of occurred overruns for the connection. Overruns occur, if the CAN controller receives so many messages, that the processing of the triggered hardware interrupts cannot be executed fast enough.

QXmtFulls

The number of occurred Transmit Queue Full events for the connection. This is the number of attempts to send a message although the transmit queue for the CAN hardware in the device driver is full. The filling level of the transmit queue increases, if messages cannot be transmitted on the bus because of a problem on the bus. The transmit queue for a CAN hardware usually has a size of 32767 messages.

Options

CAN controller options.

Option

Description

EF

Error Frames. This option activates the reception of Error Frames.

The option is only available if the connection is associated with a CAN hardware that supports the reception of Error Frames.

LO

Listen-only. This option activates the Listen-only mode of the CAN controller. In Listen-only mode, PCAN-Explorer is not an active bus user. This means that the connected CAN controller does not transmit any Acknowledge as a result of a received CAN message on the bus. Only receive mode is then possible, transmitting of messages is not possible.

This option is only available if the connection is associated with a CAN hardware that supports the Listen-only mode.

ST

Timestamps at Start-of-Frame. If activated, the timestamp of a CAN message is determined at Start-of-Frame instead of at End-of-Frame.

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

SA

Tx Self-Acknowledge. If activated, the CAN controller sends an Acknowledge slot (ACK) on the bus even as sender, so that no other CAN nodes must be present on the bus to acknowledge the frame.

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

IB

Ignore BRS (Bit Rate Switch). If activated, the CAN controller ignores received CAN FD frames that have the BRS bit set.

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

Bus Load

The current bus load of the connection. To display a value here, bus load calculation must first be activated in the properties of the connection (see Show Bus Load property).

Tip

Double-clicking in this column resets the Maximum indicator of the bus load meter.

Bus Load Peak

The bus load peak value and time of the peak value.

Protocol

The type of the protocol the connection uses, e.g. CAN, J1939.

Type

The type of the connection. Currently only the type "PCAN" is supported.

Symbols File

The symbols file that is assigned to the connection.

Filter

The message filter that the connection uses.

J1939 Address

If the connection uses the J1939 protocol, this column shows the currently claimed address of the connection.

Customizing the visible columns

The types of columns that the connections window shows as well as the order of the columns can be customized.

To select the visible columns:

  1. Open the context menu on one of the column headers.

  2. Select the columns that you would like to show.

To change the order of the columns:

  1. Press the left mouse button on a column header and keep it pressed.

  2. Drag the column to a new location.

  3. Release the mouse button.

See also

User Interface


Add-in Manager Dialog Box

The Add-in Manager dialog box allows the installation of Add-ins in the PCAN-Explorer user interface. To access the Add-in Manager dialog box, select Add-in Manager from the Tools menu.

For information about Add-ins and how to create them see Add-ins for PCAN-Explorer.

Available Add-ins

A list of all Add-in components registered in PCAN-Explorer. By clicking on the check box in front of the Add-in's name you can activate or deactivate the corresponding Add-in.

Version

Shows the version number of the Add-in.

Status

Indicates, whether the Add-in component is loaded. If the status Not unlocked is displayed, the currently installed PCAN-Explorer license file does not allow the use of the Add-in.

Description

A short description of the Add-in, which has been written by the author of the Add-in. E.g. this can contain usage tips for as well as support-, version-, and license information.

Add

Use this button to choose an Add-in component that shall be loaded in PCAN-Explorer. Administrator Privileges are required to perform this operation.

When you press this button, first browse for the Add-in component (*.dll) that you would like to add. Depending on whether you are an Administrator or a standard user, Windows then shows either a User Access Control (UAC) prompt, or a login prompt where you can enter credentials for an Administrator account. After a successful authentication, the Add-in is registered in the System and shown in the list of available Add-ins.

Remove

Use this button to remove an Add-in component from PCAN-Explorer. Administrator Privileges are required to perform this operation.

When you press this button, depending on whether you are an Administrator or a standard user, Windows then shows either a User Access Control (UAC) prompt, or a login prompt where you can enter credentials for an Administrator account. After a successful authentication, PCAN-Explorer de-registers the Add-in component and removes it from the list of available Add-ins.

See also

Connecting Add-ins to PCAN-Explorer


VBS Macro Manager Dialog Box

In the VBS Macro Manager Dialog Box, all VBScript macro files are listed that are installed in PCAN-Explorer. Use this dialog box to install, remove, activate, or deactivate macro files. Only the macro procedures of activated macro files can be executed in the PCAN-Explorer environment.

You can access this dialog box by selecting VBS Macro Manager on the Macro menu.

For information about VBS Macros see VBScript Macros.

Macro files

A list of all VBScript Macro files that are installed in PCAN-Explorer. You can activate or deactivate an individual macro file by clicking on the check box in front of the macro file's name.

Description

A short description of the macro file, which has been written by the author of the Macro file.

Location

Shows the installation location of the selected macro file.

Add

Click on this button to choose a VBScript macro you would like to install in PCAN-Explorer.

Remove

Removes an installed macro file. This function is only available for macro files that were not installed into the Library directory for VBS macro files. Macro files in the Library directory for VBS macros cannot be removed from the Macro files list.

See also

Installing VBScript Macros


External Tools Dialog Box

Use this dialog box to add external tools, such as PCAN Status Display or PCAN Nets Configuration to the Tools menu. Adding external tools allows you to easily launch other applications while working in PCAN-Explorer. You can specify arguments and a working directory when launching the tool. To access this dialog box, select the External Tools command from the Tools menu.

For more information on how to add external tools to the Tools menu, see Customizing the Tools Menu.

Menu contents

Lists the titles of the items currently added to the Tools menu.

Add

Adds a new entry to the list.

Delete

Removes the selected tool or command from the Menu contents list as well as from the Tools menu.

Move Up

Moves the selected tool higher in the list of tools that appear on the Tools menu.

Move Down

Moves the selected tool lower in the list of tools that appear on the Tools menu.

Title

The name of the menu option.

Tip

Type an ampersand (&) before one of the letters in the tool name to create an accelerator key for the command when it appears on the Tools menu. For example, if you use 'My &External Tool', the letter 'E' will be the accelerator key.

Command

Specifies the path to the .exe, .com, .bat, .cmd, or other file that you intend to launch.

Arguments

Specifies the variables that are passed to the tool when the tool is selected on the Tools menu. Arguments can specify values that are passed to the tool or command when it is launched. For example, a value can specify a filename or directory. Use the Arrow button to select from a list of predefined arguments. You can add one or more arguments. For a complete list of all predefined arguments and their definitions, see the Argument Macros table. You can also enter custom arguments - command line switches, for example - depending on the command or tool you use.

Initial directory

Specifies the working directory of the tool. Use the Arrow button to select directories. You can select more than one.

Prompt for arguments

Displays the Arguments dialog box to allow you to enter or edit values for the arguments each time you launch the external tool.

Allow multiple instances

If this option is enabled, each execution of the tool creates a new instance of the tool (unless the tool prevents that from itself).

If you turn off the option and have run the tool before, PCAN-Explorer will first look for the previously launched instance the next time you run it. If this is still active, the window of this instance is brought to the foreground, instead of starting a new instance of the tool.

Note

If you turn off the option and specify startup arguments in the Arguments field, they may only affect the first time the tool is run. If a previously launched instance is found and reused while running the tool, start arguments have no effect and there is no display of the Arguments dialog box, even if the Ask for Arguments option is checked.

See also

Customizing the Tools Menu

Arguments for External Tools

Argument Macros


Arguments for External Tools

When launching external tools from the Tools menu, you can use Argument Macros to pass predefined arguments to the tool. Arguments are variables that PCAN-Explorer supplies values for when an external tool is launched from the Tools menu.

To use a macro as an argument, type the macro name in the Arguments box. Or, for macros that expand to a directory, you can type the macro name in the Initial Directory box.

To add an argument macro to an installed tool and to run it:

As an example, the following procedure demonstrates how to add the $(FilePath) argument to the Windows Notepad accessory.

  1. On the Tools menu, click External Tools.

  2. In the Menu Contents list, select the command that you want to edit. In this case, select the Notepad accessory that you installed earlier.

  3. In the Arguments box, type $(FilePath) or select the drop-down arrow to the right of the Arguments box to display a list of available arguments, e.g. File Path.

  4. Click OK.

  5. To see your changes, on the Tools menu click Notepad. The Windows Notepad accessory opens, with the active document as its text file.

See also

Customizing the Tools Menu

Argument Macros


Library Browser

The Library Browser is a tool for browsing a directory structure containing frequently used files, e.g. Symbols files, Macros, Transmit Lists, etc.

To show the Library Browser, in the View menu select the Library command.

Using the Library Browser, you can quickly add frequently used files to the current project. To do this, open the context menu (right mouse button) and either select the Add to Project command or the Copy and Add to Project command.

Symbols Files

This node lists all Symbols files that are contained in the preset library directory for Symbols files. The file names are shown without the file name extension .sym.

Using the context menu, you can add Symbols files to the current project, and you can edit or delete Symbols files.

If a Symbols file is not empty, you can display its contents by expanding the node. All contained Symbols are then displayed. In turn these can contain Multiplexers and Variables.

VBS Macro Files

This node lists all VBScript Macro files that are contained in the preset library directory for VBScript Macro files. By expanding a file node you can show the contained Macro procedures.

You can execute a VBS Macro procedure by double-clicking on a procedure.

You can edit or execute a VBS Macro procedure using the context menu.

Standard Macros

This node lists all Standard Macros that are contained in the preset library directory for Standard Macros. Every Standard Macro needs a file of its own, unlike VBScript Macro procedures.

Standard Macros can be edited by double-clicking on a macro, or by selecting the Edit command from the context menu.

Standard Macros cannot be executed in the Library Browser. In order to run a Standard Macro, first add it to the current project, then run it from the Project Manager or the Macro drop-down list in the Macro Toolbar.

Transmit Lists

This node shows all Transmit Lists that are contained in the library directory for Transmit Lists.

Using the context menu, Transmit Lists can be added to the current project, opened, or deleted.

Trace Files

This node lists all trace files that are contained in the library directory for trace files.

Using the context menu, Trace files can be added to the current project, opened, or deleted.

Callback Libraries

This node lists all Callback Libraries that are contained in the library directory for Callback Libraries.

Using the context menu, Callback Libraries can be added to the current project, opened, or deleted.

CANdb Files

If the CANdb Add-in is installed and loaded, this node lists all CANdb Network files that are contained in the library directory for CANdb files.

Using the context menu, CANdb files can be added to the current project, opened, or deleted.

Plotter Files

If the Plotter Add-in is installed and loaded, this node lists all Plotter files that are contained in the library directory for Plotter files.

Using the context menu, Plotter files can be added to the current project, opened, or deleted.

Instruments Panel Files

If the Instruments Panel Add-in is installed and loaded, this node lists all Instruments Panel files that are contained in the library directory for Instruments Panel files.

Using the context menu, Instruments Panel files can be added to the current project, opened, or deleted.

See also

User Interface

Library, Options Dialog Box


Text Editor

The text editor is a tool for word processing, with which code and text can be entered, displayed, and edited.

Several text editor windows can be open at the same time to make work with different types of text files easier. The text editor supports different programming languages. It recognizes the syntax and keywords of the dialects and inks these to the easier readability.

Text editor windows can be opened in the following ways:

  • In the Project Manager, by selecting a file on the Project Files tab, and selecting the Open command from the file's context menu.

  • In the Library window, by selecting a file and clicking on either the Open or Edit commands on the file's context menu.

  • In the File menu, by selecting the New or Open commands.

Text area

The area, where the text is entered. Various settings can be changed that customize the appearance of the text and the behavior of the text input. See also Fonts and Colors, Options Dialog Box.

Display border

The area at the left side of the text editor, on which line numbers and bookmarks can be displayed. If you click with the mouse in the border, the cursor is set to the beginning of the corresponding line.

Selection border

A narrow empty area between the display border and the first characters in the text area. If you click in this area, the whole text line next to the mouse cursor is selected. When the mouse pointer is in the selection border, it changes its form.

Horizontal and vertical scroll bars

The scroll bars allow the scrolling of the text area in horizontal and vertical direction, in order to make text visible that is located outside the visible text area.

Status bar

The status bar shows the line and column where the cursor is currently positioned. Also, it shows whether the text editor is currently in Insert or Overwrite mode, and contains a caps lock and num lock indicator.

See also

Working with the Text Editor

User Interface


About Dialog Box

The About dialog box displays information about version, copyright information, and registration status of PCAN-Explorer. To access the About dialog box, choose the About PCAN-Explorer command from the Help menu.

Version

This is the version number of the PCAN-Explorer main executable, PcanExpl.exe.

Product License Status

Displays the current registration status. Possible values are, for example, Activated, Registered, Trial, Expired, or an error message.

License Information

Displays a dialog box showing details that are stored in the currently loaded License file.


Project-specific Elements

These elements of the user interface are needed in dealing with projects.

In This Section

Project Manager

Provides an organized view of the currently loaded project.

Project Settings Dialog Box

Allows configuration of the various project settings.

Add New Item Dialog Box

Allows adding of new files to the project.

Related Sections

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Project Manager

The Project Manager provides an organized view of the currently loaded project and its files as well as a ready access to the commands that pertain to them. A toolbar at the top of the window offers commonly used commands.

To access the Project Manager, select Project Manager on the View menu.

Tree View

This standard Project Manager view presents the active project as a logical container for the files and items associated with a project. You can open project items for modification and perform other management tasks directly from this view.

Project Files tab

On this tab, the tree view shows all the files the active project contains. You can create virtual folders to better organize your files. You can define a file extension filter for a virtual folder, so that newly created or added files will be put in a compatible folder automatically. Physical folders cannot be added to a project.

Project Items tab

On the Project Items tab, the tree view shows the elements that are stored directly in the project file (e.g. connections), and other elements that reflect items created by adding a file to the project (e.g. Symbols and Signals).

Icons

The following list describes the icons that appear in the Project Manager tree view:

Icon | Description
 | The project root node.
 | The Connections node.
 | An enabled connection.
 | A disabled connection.
 | An invalid connection.
 | An enabled connection to which an enabled message filter is assigned.
 | The Message Filters node.
 | An enabled message filter.
 | A disabled message filter.
 | The Macros node, a VBS Macro file.
 | A Standard Macro.
 | A VBS Macro procedure.
 | The Active Symbols node.
 | A Symbols file.
 | A Symbols file that is used by at least one connection.
 | A Symbols file that contains an error.
 | A CANdb Network file.
 | A CANdb Network file that is used by at least one connection.
 | An Instruments Panel file.
 | A Plotter file.
 | A Multiplexer.
 | A Variable.
 | The Signals node, a Signal.
 | A virtual Signal.

Commands

You can open files, add and remove items, and perform other management tasks. Using the context menu on a project file or project item, you can execute different commands for each file, depending on the file type or project item type. Double-clicking a file opens the file for editing.

The action performed when double-clicking on an item on the Project Items tab depends on the item:

Item | Action
Connections node | Expands the Connections node.
Connection | Shows the Change Connection dialog box.
Message Filters node | Expands the Message Filters node.
Message Filter | Opens the Edit Filter dialog box.
Macros node | Expands the Macros node.
Standard Macro | Executes the Standard Macro.
VBS Macro file | Expands the VBS Macro File node.
VBS Macro procedure | Executes the Macro procedure.
Active Symbols | Expands the Active Symbols node.
Symbols file, Symbol, Multiplexer | Expands the node.
Variable | None.
Signals node | Expands the Signals node.
Signal | None.

See also

User Interface


Add New Item Dialog Box

Use the Add New Item dialog box to create a new file and add it to the project in only one step.

The Add New Item Dialog Box can be accessed by selecting the Add New Item command on the Project menu, or by pressing the New button on the Project Manager toolbar.

The Add New Item dialog box has following fields:

Templates

Contains all file types that are supported by PCAN-Explorer, and which can be created by using this dialog box.

The framed field below the templates list shows a short description for a file type, if one is selected in the templates list.

Name

Sets the name of the new file.

Location

Specifies the location where the file will be created. By default, the path of the current project is shown. Using the button to the right of the field, you can open a dialog box to select a path.

When the OK button is clicked, a new file is created at the selected location. If creation of the file was successful, the Project Manager is updated to show the newly created file on the Project Files tab.

See also

Project Manager

User Interface


Project Settings Dialog Box

Use this dialog box to configure project settings.

To open this dialog box, select Settings on the Project menu or the project context menu in the Project Manager.

The Project Settings dialog box is divided into two parts: a category list on the left side, and a display area on the right. On the individual pages, the options are grouped according to functionality. When you select an entry from the list, its options appear in the display area.

To see documentation for any page in the Project Settings dialog box, go to the page and press F1, or press the Help button.

The Project Settings dialog box can display the following pages:

Page | Description
General | General project settings.
CAN | Settings concerning the CAN protocol, e.g. Remote Transmission Requests.
J1939 | Settings concerning the J1939 protocol.
J1939 Auto-values | Settings related to automatic signal value calculation for J1939 transmit messages.
Connections | Does not contain any options, serves as a container for the project connections.
Connection | Settings of the connections in the project.
Tracers | Does not contain any options, serves as a container for the tracers in the project.
Tracer | Settings of the tracers in the project.
Timing | Settings for the logging of timing errors.

See also

User Interface


General, Project Settings Dialog Box

Use the General page of the Project Settings dialog to configure general settings of the project.

You can access this dialog box by selecting Settings from the Project menu, and then selecting the General page.

Settings

Name

Names the project.

Description

Use this field to enter a short description for the project.

Execute command after loading the Project

This command is executed after the project is loaded.

Example

If you want a window of your project desktop to be shown in full screen mode after opening the project, enter the ToggleFullScreen command in the field. After closing the dialog box, activate the window you would like to show in full screen mode. Then save and close the project, or exit PCAN-Explorer. When you open the project the next time, the selected window is shown in full screen mode. You can quit the full screen mode by pressing [F11].

See also

Project Settings Dialog Box


CAN, Project Settings Dialog Box

Use the CAN page of the Project Settings dialog box to change general settings for connections in the project that use the CAN protocol. You can access the Project Settings dialog box by selecting Settings from the Project menu, and then selecting the CAN page.

Remote Transmission Requests

Remote Transmission Requests (RTR) are transmitted by CAN nodes to request specific data that is usually provided by another bus user.

Process Remote Request Frames

If this option is activated, PCAN-Explorer deals with incoming Remote Request Frames and, if necessary, transmits one or more messages as a response, if the Transmit List in the Receive/Transmit window contains matching messages.

Ignore Data Length Code

If this option is activated, PCAN-Explorer ignores the Data Length Code of a received Remote Request Frame when searching for matching messages in the Default Transmit List, which could be transmitted as responses to the RTR. Therefore, all CAN messages that have the same CAN ID as the Remote Request Frame are transmitted as a response.

If this option is deactivated, only those messages from the Default Transmit List will be sent as a response that have the same CAN ID and the same Data Length Code as the received Remote Request Frame.

Error Warnings

Error Warnings occur when because of multiple bus errors an error counter of the CAN controller exceeds certain values.

Auto-reset on Bus-Off

If a transmission and/or reception operation cannot be resumed after a Bus-Off error state occurred, the Reset command can automatically be invoked by activating this option. This triggers a hardware reset of the CAN controller and may help to solve the problem. But on the other hand, CAN messages can get lost while the CAN controller is in the Reset state.

See also

Reset Command

Remote Transmission Request

Displaying Error Frames

Hardware Status

Project Settings Dialog Box

Default Transmit List


J1939, Project Settings Dialog Box

Use the J1939 page of the Project Settings dialog box to configure settings for connections in the project that use the J1939 protocol. The settings on this page are valid for all J1939 connections in a project.

You can access this dialog box by selecting Settings from the Project menu, and then selecting the J1939 page. The page is only available when the J1939 Add-in is loaded and if the current project has at least one J1939 connection.

Settings

Process Requests (RQST)

If this option is activated, PCAN-Explorer tries to answer received RQST (PGN 59904) messages. PCAN-Explorer searches for matching messages not only in the Transmit List in the Receive/Transmit window, but in any other open Transmit List.

Transport Protocol Read Sessions

These settings only have an effect if a J1939 connection acts as a responder during a data transfer.

CTS: Number of accepted packets

This is the maximum number of large message data packets cleared to send. The actual number of packets cleared to send in a TPCM.CTS message will never be larger than the requested number or packets from a received TPCM.RTS message.

Number of Re-CTS

Sets the maximum number of Re-CTS during a read session.

After the responder has transmitted a CTS, and no data packet (TPDT) is received from the originator within a timeout of 1250 ms, the responder sends again a CTS. When the number of these re-sent CTS reaches the number of specified Re-CTS, the responder aborts the session when the next timeout occurs by sending a TPCM.ConnAbort.

Transport Protocol Write Sessions

These settings only have an effect if a J1939 connection acts as an originator during a data transfer.

RTS: Maximum number of packets

Limits the number of requested packets that can be sent by the originator in response to one CTS. If the responder complies with this limit, the responder ensures that the originator can re-transmit packets that the responder has not received correctly for whatever reason.

Number of retries

Sets the maximum number of RTS-retries during a write session.

After the originator has transmitted the number of data packets that were cleared to send by the last received CTS, the originator sends again an RTS to request the next data transfer. If the responder does not answer with a CTS within a timeout of 1250 ms, the originator issues again an RTS. When the number of these re-sent RTR reaches the number of specified Retries, the originator aborts the session when the next timeout occurs by sending a TPCM.ConnAbort.

See also

Project Settings Dialog Box

J1939 Auto-values, Project Settings Dialog Box

J1939, Options Dialog Box


J1939 Auto-values, Project Settings Dialog Box

Use the J1939 Auto-values page of the Project Settings dialog box to configure settings for transmit messages that use the J1939 protocol. The settings on this page are valid for all J1939 transmit messages in a project.

You can access this dialog box by selecting Settings from the Project menu, and then selecting the J1939 Auto-values page below the J1939 node. The page is only available when the J1939 Add-in is loaded and if the current project has at least one J1939 connection.

When sending, automatically calculate these J1939 signal values

Here you can choose for different J1939 signals (SPNs) whether their values are automatically calculated when sending a J1939 message containing the signals.

Recipients of certain J1939 messages such as TSC1 (Torque/Speed Control 1, PGN 0) can determine the data integrity of the message by evaluating the rolling counter value as well as the checksum that come in the message data.

The automatic signal value calculation is linked to the SPNs and only takes place if a symbol of type J1939PG is associated with the transmit message that contains matching SPNs.

When you click the [image] button, which is located at the right above the list, a popup menu will be displayed, allowing you to customize various options for the list, e.g. the sorting order.

See also

Project Settings Dialog Box

J1939, Project Settings Dialog Box

J1939 Auto-values, Options Dialog Box


Connection, Project Settings Dialog Box

Use the Connection page of the Project Settings dialog box to configure general settings of each connection in the project.

You can access this dialog box by selecting Settings from the Project menu, and then selecting the corresponding connection under the Connections node.

Settings

Enabled

This option enables the connection.

Name

Names the connection.

Protocol

Selects the protocol that the connection uses.

CAN

These settings are available if the CAN protocol is selected in the Protocol drop-down list.

Listen-only mode

This option activates the Listen-only mode of the CAN controller. In Listen-only mode, the CAN controller gives no acknowledge to the CAN bus, even if a message is received successfully. The CAN controller is forced to be error passive. Message transmission is not possible. The Listen-only mode can be used e.g. for monitoring purposes or software-driven bit rate detection.

The option is only available if the connection is associated with a CAN hardware that supports the Listen-only mode.

Error Frames

This option activates the reception of Error Frames for the connection.

Determine Timestamps at Start-of-Frame

If activated, the timestamp of a CAN message is determined at Start-of-Frame instead of at End-of-Frame.

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

Tx Self-Acknowledge

If activated, the CAN controller sends an Acknowledge slot (ACK) on the bus even as sender, so that no other CAN nodes must be present on the bus to acknowledge the frame.

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

Ignore BRS

If activated, the CAN controller ignores received CAN FD frames that have the BRS bit set (Bit Rate Switch).

Requires at least PCAN driver version 4.3.0 and the CAN interface used or its firmware version must support the feature.

See also

Project Settings Dialog Box


Tracer, Project Settings Dialog Box

You can access this dialog box by selecting Settings from the Project menu, and then selecting the corresponding Tracer under the Tracers node.

Settings

Filter

Selects the message filter for the tracer.

Buffer type

Determines how the buffer is filled with data.

  • File: The data is written directly in a Trace file during recording.

  • Dynamic: The buffer size grows continuously as messages are recorded.

  • Linear: The buffer has a fixed size. When the buffer is completely filled, the recording is stopped and a message is shown in the Output window.

  • Ring: The buffer has a fixed size. If the buffer is full, the oldest message in the buffer is overwritten when a new message is recorded.

Buffer size

Sets the fixed size of the data buffer (number of CAN messages) for the Linear and Ring buffer types. The maximum buffer size you can enter is 999,999,999 messages. While you enter a value in the field, the required working memory is calculated and displayed next to the field.

Timestamps

Determines the format that is used to display timestamps in the trace window.

  • Relative: The displayed value indicates the time offset since start of the recording in Seconds.

  • Absolute: The timestamp is shown as an absolute time.

  • Differential: The displayed value indicates the time period between the message and the previous recorded message.

First entry sets start time

If this option is enabled, the timestamp of the first recorded message determines the start time of the tracer, which is also stored in the Trace file. The time offset of the first entry is in this case 0.

If this option is disabled, the recorded start time is the time at which the tracer is started, e.g. when the Start button is pressed in the tracer window.

Repeat playback

If this option is enabled, playback of CAN messages restarts from the beginning when the end of the Trace file is reached.

Repeat count

If this option is enabled, the number of playback repetitions can be specified here. After the last cycle, playback is stopped.

Pause before repeating

If this option is enabled, the tracer waits a specified time after playing the last message in the buffer before playback starts again from the beginning.

See also

Project Settings Dialog Box


Timing, Project Settings Dialog Box

Use the Timing page of the Project Settings dialog box to configure settings for the logging of timing errors. You can access this dialog box by selecting Settings from the Project menu, and then selecting the Timing page.

Log timing errors

If this option is active, PCAN-Explorer checks for possible timing errors at the reception of a symbolic message. To recognize timing errors, timeouts and/or minimum intervals must be defined for Symbols and Multiplexers respectively.

Log timing errors to file

If this option is active, PCAN-Explorer saves the occurred timing errors into the specified log file. To select a file, you can also display a File Open dialog box using the button next to the field.

Check permanently for timeouts

If this option is active, PCAN-Explorer does not only check for a timeout when a message is received, but does this permanently on all Symbols and Multiplexers in the Receive List.

See also

Timing

Project Settings Dialog Box


CAN-specific Elements

This section contains information about all dialog boxes and other elements, which are directly related to the subjects CAN and CAN messages.

In This Section

Add Connection Dialog Box

Connects with a PCAN net, which serves for the communication with an external CAN bus.

Change Connection Dialog Box

Selects a different PCAN net for an existing connection.

Edit Message Dialog Box

Allows to input and edit the parameters of a CAN or J1939 message that shall be transmitted manually on a CAN bus.

Edit Data Dialog Box

Allows manipulating data bytes of a message using a hex editor.

Edit Filter Dialog Box

Allows defining of filter items for Message Filters. Message Filters are used to filter the CAN messages that are displayed in the Receive List, or that are recorded by Tracers.

Transmit List Windows

Contains a number of CAN messages that are transmitted by PCAN-Explorer.

Timing Errors Window

Facilitates the supervision of the periodical reception of CAN messages within predefined periods of time.

Export Data Dialog Box

Exports CAN messages to different file formats.

Related Sections

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Add Connection Dialog Box

Use the Add Connection dialog box to add a new connection to the current project.

To access the Add Connection dialog box, select Add Connection from the Connections menu.

Using the tabs at the top margin of the dialog box, select the device type for which you would like to add a connection. Depending on the installed drivers, the tab pages Peakcan, Virtual, ISA, Dongle, PCI, USB, PC Card, or LAN are displayed.

Peakcan (only available on 32-bit operating systems)

This device type can be selected, if a connection with a Non-Plug-and-Play hardware is to be established, for example a PCAN-ISA card or a PCAN-Dongle (for the parallel port).

Virtual

This device type does not support any hardware, only internal nets.

ISA (only available on 32-bit operating systems)

If available, this device type can be selected if a connection with a PCAN-ISA card is to be established.

Dongle (only available on 32-bit operating systems)

If available, this device type can be selected if a connection with a PCAN-Dongle (for the parallel port) is to be established.

PCI

If a PCI- or PCI-Express-based CAN card is to be used, this device type must be selected.

USB

If a PCAN adapter with a USB connector is to be used, this device type must be selected.

PC Card

If a PCAN-PC Card adapter is to be used, this device type must be selected.

LAN

If PCAN-Gateway is to be used via a network connection (Ethernet, Wi-Fi), this device type must be selected.

Available Nets

All PCAN nets that have been configured for the selected device type are displayed here. If the list should be empty, create a net first by selecting the Edit Nets button.

Name

Enter the name for the new connection in this field.

Note

A project cannot contain two connections with the same name. If the name you enter in the Name field is already occupied, a number is appended to the name to create a unique connection name.

Protocol

Selects the protocol, which the new connection shall use.

Note

If the J1939 Add-in is not installed, only the CAN protocol is available in the Protocol drop-down list.

Enable Connection

If this option is activated, the new connection is enabled immediately after closing the dialog box.

Preferred Address

Specifies the J1939 Preferred Address of the new connection. This box is only available if J1939 is selected in the Protocol drop-down list. The value of the J1939 address must be in the range 0-253.

Edit Nets

Launches the PCAN Nets Configuration tool where you can create or edit PCAN nets for the installed PCAN devices.

Updates the Available Nets list.

See also

Configuring PCAN Nets

Change Connection Dialog Box

User Interface


Change Connection Dialog Box

Use the Change Connection dialog box to select a different PCAN net for an existing connection.

To access the Change Connection dialog box, select a connection in the Connections Window, then open the context menu (press the right mouse button) and choose Change.

Using the tabs at the top margin of the dialog box, select the device type from which you would like to select a PCAN net. Depending on the installed drivers, the tab pages Peakcan, Virtual, ISA, Dongle, PCI, USB, PC Card, or LAN are displayed.

Peakcan (only available on 32-bit operating systems)

This device type can be selected if a connection with a Non-Plug-and-Play hardware is to be established, for example a PCAN-ISA card or a PCAN-Dongle (for the parallel port).

Virtual

This device type does not support any hardware, only internal nets.

ISA (only available on 32-bit operating systems)

If available, this device type can be selected if a connection with a PCAN-ISA card is to be established.

Dongle (only available on 32-bit operating systems)

If available, this device type can be selected if a connection with a PCAN-Dongle (for the parallel port) is to be established.

PCI

If a PCI- or PCI-Express-based CAN card is to be used, this device type must be selected.

USB

If a PCAN adapter with a USB connector is to be used, this device type must be selected.

PC Card

If a PCAN-PC Card adapter is to be used, this device type must be selected.

LAN

If PCAN-Gateway is to be used via a network connection (Ethernet, Wi-Fi), this device type must be selected.

Available Nets

All PCAN nets that have been configured for the selected device type are displayed here. If the list should be empty, create a net first by selecting the Edit Nets button.

Edit Nets

Launches the PCAN Nets Configuration tool where you can create or edit PCAN nets for the installed PCAN devices.

Updates the Available Nets list.

See also

Configuring PCAN Nets

Add Connection Dialog Box

User Interface


Edit Message Dialog Box

The Edit Message dialog box is used to enter and edit the parameters of a CAN message.

To access this dialog box, select the New Message or Edit Message commands from the Transmit menu.

The dialog box contains following fields:

Bus

Determines the bus/connection, on which the message is sent. The drop-down list contains all connections of the current project.

Opens the Add Connection dialog box that lets you add a new connection on-the-fly, without having to close this dialog box.

Ctrl+F

Searches the Symbols list.

Symbols

This list shows all Symbols that are currently loaded for the selected bus, and which can be selected for transmission. Symbols that were defined as pure receive symbols are not listed here. If the <Custom message> entry is selected, any CAN message can be created. The <Custom message> entry is not available, if a symbolic message is edited.

When you click the [image] button, a popup menu is shown that contains further display options for the Symbols list. Activating the Sorted option sorts the list alphabetically. If the sorted option is not activated, the symbols appear in the list in the exact order in which they were defined in the Symbols file.

For J1939 connections, the Symbols list can also be configured to display Acronyms, Long Names, decimal PGNs, or hexadecimal PGNs.

Multiplexers

This list shows all Multiplexers that were defined for the selected Symbol. If a Symbol does not contain any Multiplexers, the list contains an entry <Empty>. When a Multiplexer is selected, its data is automatically entered into the Data fields. These fields are then locked for editing. If you would like to transmit other values in the Data fields that the Multiplexer is occupying, select the <Other> entry.

This list is only enabled if a Symbols File is loaded for the selected bus.

ID

The CAN ID of the message (hexadecimal). If a Symbol is selected in the Symbols list, this field cannot be edited, because the CAN ID is then determined by the selected Symbol.

Length

The number of data bytes of the message. If the message is a data frame, this value determines the number of data bytes (0-8 for CAN messages, 0-64 for CAN FD messages, 0-1785 for J1939 messages). If the message is a Remote Request frame, then this value corresponds to the length of the data frame to be requested. If a Multiplexer was selected from the Multiplexers list, this field can not be changed eventually, in the case if the length is determined by the definition of the selected Multiplexer.

Data

The data bytes of the message in hexadecimal form. If a Multiplexer was selected from the Multiplexers list, the value defined for the Multiplexer appears in the corresponding positions. If a Multiplexer occupies all bits of a data byte, this field is locked for editing. If a Multiplexer only occupies parts of a data byte, the field can be edited. However, when leaving the field, the bits occupied by the Multiplexer are then overwritten with data of the Multiplexer.

Pressing the ... button next to the data byte fields opens the Edit Data dialog box, where you can manipulate the data bytes of the message using a hex editor. This is especially useful when dealing with J1939 large messages, which can have up to 1785 data bytes.

Cycle Time

The time interval in Milliseconds, in which the message shall be sent. If the message shall not be sent periodically, the value 0 must be entered.

Paused

If this option is activated, a message to be transmitted periodically is stopped. The transmitting can be continued later.

Note

This field cannot be changed if the Listen Only mode of the CAN controller is activated. In this case, the Paused state is always set.

Comment

Comments the transmit message. To display comments in the Transmit List, use the Select Columns dialog box to add the corresponding column to the list.

Special fields for CAN messages

Message Type

Extended Frame

If this check box is activated, the message is sent as an Extended Frame according to CAN specification 2.0B. The field is only available, if the connected hardware supports the CAN 2.0B protocol.

Remote Request

If a Remote Request frame shall be sent, then this check box must be activated. In this case, the fields for entering the data bytes are removed.

Single Shot

Creates a CAN message that will be sent with the Single Shot Transmission option. See NXP Application Note AN97076 "SJA1000 Stand-alone CAN controller", section 5.4.

CAN FD

Defines the message as a CAN FD message. A CAN FD message can have up to 64 data bytes.

Bit Rate Switch

Sets the Bit Rate Switch flag for a CAN FD message. The data fields in a CAN FD frame will be transferred with a higher bit rate if the Bit Rate Switch flag is set.

Error State Indicator

Sets the Error State Indicator flag for a CAN FD message. The Error State Indicator provides information, whether the sender of the message is in Error Active or Error Passive state.

Special fields for J1939 messages

PGN

Determines the Parameter Group Number of the J1939 message. You can only edit the PGN value when you create a new J1939 message and the <Custom message> entry is selected in the Symbols list.

If the entered value is displayed in red, the value is no valid PGN. Note that for PDU1 format messages the lower byte of the PGN must be 0, since in this case the byte has no storage space within the CAN-ID. There, this byte is then occupied by the destination address. For more information, see the J1939 specification top level document, chapter 4.1.2 Message Format and Usage.

Priority

Determines the priority (0-7) of the J1939 message. 0 is the highest priority, 7 the lowest. The priority is a 3-bit field, which is part of the CAN-ID, bits 26-28.

Source

Sets the source address of the J1939 message.

If the message has a maximum of 8 data bytes, any value from 0 to 253 is allowed, or the Null address (254).

If the message is a large message with more than 8 data bytes, the source address must be identical with the claimed address of the corresponding connection. Trying to send a large message with a different source address than the claimed address will result in a "Wrong parameter value" error. Trying to send a large message when the connection has no address claimed yet, will result in an "Address not claimed" error. Furthermore, the Null address is not allowed as source address for large messages.

The source address is part of the CAN-ID (bits 0-7).

Destination

Sets the destination address of the J1939 message.

If the selected PGN has the PDU1 format, any value from 0 to 253 is allowed, or the Global address (255). The destination address must be different from the Source Address.

If the selected PGN has the PDU2 format and the message has a maximum of 8 data bytes, no destination address can be entered, these messages will always be transmitted as broadcast. However, if a PDU2 PGN allows packetization, and the data length is set to a value higher than 8, a destination address can be selected. Valid destination addresses are 0 to 253, or the Global address (255).

For PDU1 format messages, the destination address is part of the CAN-ID (bits 8-15).

Hexadecimal Values

If this option is activated, the values in the fields PGN, Source, and Destination are displayed in hexadecimal format.

See also

Working with Transmit Lists

Transmitting CAN Messages

Edit Data Dialog box


Edit Data Dialog Box

Use the Edit Data dialog box to manipulate the raw data of a message.

The Edit Data dialog box can be accessed by pressing the ... button next to the data byte fields in the Edit Message dialog box.

Loads the data from a file.

Saves the data to a file.

Sets all data bytes to zero.

(Hex Editor)

In the Hex Editor, you can edit the data bytes of message by entering hex values or characters. By pressing [Tab] on the keyboard you can move the caret between the hex-editing area on the left and the ASCII representation of the data on the right side, where you can enter characters instead of hex codes. If the Hex Editor has the input focus, to leave the Hex Editor using the keyboard, press [Ctrl+Tab] or [Shift+Ctrl+Tab].

The Hex Editor display can be customized using the context menu. You can choose the number of displayed data bytes per row (8, 10, or 16) and the number of data bytes per column (1, 2, or 4).

See also

Edit Message Dialog Box


Edit Filter Dialog Box

The Edit Filter Dialog Box can be used to define filter items for a Message Filter. Message Filters are used to filter the CAN messages that are displayed in the Receive List, or that are recorded by Tracers.

A filter can consist of multiple filter items, which in turn can have different operation modes and parameters. Each filter item can be configured to filter messages of a single bus or of all active buses in the project.

Enable Filter

Enables or disables the Message Filter. If the filter is enabled, the items in the Filter Items list determine if the message can pass through the filter. If the filter is disabled, all messages will pass through the filter.

Description

Allows to describe the filter.

Filter Items

This list shows all filter items that are configured for the filter.

Bus This column shows the bus of which a filter item filters messages. The state of the check box on the left side determines the enabled state of the filter item. When the check box is cleared, from the message filter's view it is the same as if the filter item were not present in the list.

Type This column shows the type or operation mode of a filter item.

Details This column shows the parameters of a filter item.

Add Item

Adds a new filter item to the list.

Delete Item

Deletes a selected filter item from the list.

Move Up / Move Down

Changes the position of the selected filter item in the list.

When a filter checks whether a message can pass through, the filter processes the filter items from the top of the list to the end. If it finds a matching filter item and the condition evaluates to true, processing of further filter items will be aborted. Therefore, the position of a filter item in the list affects the filtering result.

Settings

Bus

If a specific bus is selected in this drop-down list, only messages of this bus are filtered by the current filter item. Messages of other buses will not pass through this filter item.

Type

Determines the type or operation mode of the current filter item.

Type/Mode Description

CAN-ID Range

In this mode, the filter item adds a continuous range of specified CAN-IDs that shall pass through the filter.

If Mode is set to Standard, the filter item processes only 11-bit messages. If Mode is set to Extended, the filter item processes only 29-bit messages.

If the RTR option is selected, the filter item processes only Remote Transmission Requests.

If the Exclude option is selected, the filter item excludes specific messages from passing through the filter.

SJA1000 Code/Mask

This mode emulates the low-level filter mechanism of the SJA1000 CAN controller. For a description of the operating principle and the meaning of the SJA1000 Code and Mask values, see NXP (formerly Philips) Application Note AN97076, "SJA1000 Stand-alone CAN controller", section 4.1.2.

If the Exclude option is selected, the filter item excludes specific messages from passing through the filter.

Adjust to Symbols

In this mode, only those messages will pass through the filter that have a corresponding Symbol definition in an active Symbols file.

Adjust to marked Symbols

This mode allows only those Symbols, Multiplexers, or Variables to pass through the filter that are marked with the Trace switch (-t) in an active Symbols file. See also Filtering Messages.

Options

Allows additional types of messages to pass through the filter.

Note that Error Warnings are never shown in the Receive/Transmit window, even if the filter item has this option activated and the filter containing the item is assigned to the Receive/Transmit window.

J1939

This mode is only available if the J1939 Add-in is loaded.

In this mode, messages can be filtered by PGN, Priority, Source, Destination, and any combination of these values.

If the Exclude option is selected, the filter item excludes specific messages from passing through the filter.

See also

User Interface

Filtering Messages


Transmit List Windows

Transmit List Windows are views of opened Transmit List files. They define a number of CAN messages that shall be transmitted by PCAN-Explorer.

The following columns can be displayed for Transmit Lists:

Bus

The Bus column displays the number of the connection, to which the message belongs (1-16).

If the associated connection is disabled, the icon [image] is displayed in front of the bus number.

Connection

The name of the connection, to which the message belongs.

CAN-ID (hexadecimal)

The CAN Identifier of the message in hexadecimal representation. 11-bit CAN messages are displayed with a 3-digit CAN-ID (0-7FFh), 29-bit CAN messages according to CAN protocol 2.0B are displayed with a 8-digit CAN-ID (0 - 1FFFFFFFh).

CAN-ID (decimal)

The CAN Identifier of the message in decimal representation. 29-bit extended CAN messages according to CAN protocol 2.0B have the postfix 'x'.

Type

Type of the CAN message. The individual types are represented by colored indicators.

The following indicators can be displayed:

Indicator | Description
No display | 11- or 29-bit data message
 | Remote Request frame
 | CAN FD message
 | CAN FD message with Bit Rate Switch set
 | Error State Indicator
 | The message uses the Single Shot Transmission option. See NXP Application Note AN97076 "SJA1000 Stand-alone CAN controller", section 5.4.
 | J1939 message
 | J1939 message that requires the Transport Protocol for transmission

DLC

The Data Length Code of the message. For CAN messages, the value is in the range 0-8, for CAN FD messages in the range 0-15, and for J1939 messages in the range 0-1785.

Length

The number of data bytes. Conventional CAN messages can have maximum length of 8 data bytes. The maximum length of J1939 messages is 1785.

For CAN FD, the maximum number of data bytes is 64, whereas the following relationship between DLC and Length applies:

DLC | Length
<= 8 | DLC
9 | 12
10 | 16
11 | 20
12 | 24
13 | 32
14 | 48
15 | 64

Symbol

The name of the Symbol that is compatible with the message.

Data

The values of the data bytes of the message.

Cycle Time

The time interval, in which a message is sent periodically. If the cycle time is set to 0 ms, the text Wait is displayed, which means the message is not transmitted periodically.

Count

The number of transmitted messages since the Reset command was executed last.

Trigger

The reason for the last transmission of a message. Following reasons for transmitting a message can be displayed:

  • Manual: The message was sent manually by the user.

  • Time: The message was sent due to the defined transmission period.

  • RTR: The message was sent in response to a received Remote Request frame.

  • Macro: The message was sent by a standard Macro.

  • Automation: The message was sent by a VBScript Macro or by an external program, which operates PCAN-Explorer as an Automation server.

  • RQST: The message was sent as a response to a J1939 Request (PGN 59904).

Time

The time at which the message was last sent.

Creator

Identifies the creator of a message.

Comment

A text that comments the message. The comment text can be edited in the Properties window if the message is selected in the Transmit list.

Additional columns for the J1939 protocol

PGN

Identifies the Parameter Group Number of the message.

Priority

The Priority (0-7) of the message.

Source

The Source Address of the message. If Null is indicated, the message has the Null Address (254).

Separate columns can be included to display the Source Address in decimal and/or hexadecimal notation.

Destination

The Destination Address of the message. If All is indicated, the message is transmitted using the Global address 255, which means the message is transmitted as a broadcast. If Null is indicated, the message has the Null Address (254).

Separate columns can be included to display the Destination Address in decimal and/or hexadecimal notation.

See also

Working with Transmit Lists

Symbols in Transmit Lists

Default Transmit List


Timing Errors Window

The Timing Errors Window allows monitoring of timing errors that occur during the periodical reception of CAN messages. To access the Timing Errors Window, select Timing Errors from the View menu.

Filter

Selects a specific Symbol, for which the timing errors shall be displayed in the list.

Clear

Clears all recorded timing errors.

Copy

Copies the timing errors list as text to the clipboard.

Time

Shows the timestamp of a timing error.

Bus

Shows the bus number of the connection, on which a timing error occurred.

ID

Shows the CAN ID of the message responsible for the timing error.

Symbol

Shows the name of the Symbol, for which a timing error has occurred.

Min. Interval

Shows the smallest time interval allowed during reception of the symbol (in milliseconds).

Timeout

Shows the timeout value that was defined for the Symbol (in milliseconds).

Period

Shows the time period between the last two receptions of the Symbol, which caused the timing error. If the Check permanently for Timeouts option is activated (see Timing, Project Settings Dialog Box), timeouts can be detected even before the next matching CAN message is received for a Symbol. The time period can be calculated only after a matching CAN message was received. During this time, a question mark is displayed for the period value.

See also

Timing

Timing, Project Settings Dialog Box

User Interface


Export Data Dialog Box

Use the Export Data dialog box to export data from recorded CAN messages or from to Receive and Transmit lists to Text or CSV files. To display the Export Data dialog box, activate a Trace window, the Receive List, or a Transmit window, then select the Export command from in the File menu.

Depending on the available export possibilities, up to three tab pages are visible:

  • Messages - Text

  • Messages - CSV

  • Signals - CSV

The selected tab page determines what kind of export is performed after clicking the OK button.

Path

Determines the path and the name of the file, into which the data is exported. The drop-down list contains path names of the most recently used files. Use the ... button next to the drop-down list to open a dialog box where you can browse for a file path.

Time stamps

Selects the format of the time stamps. Available options are:

Option Description

Relative in milliseconds

Saves time stamps of the recorded CAN messages as time offsets relative to the beginning of the recording, in milliseconds.

Relative in seconds

Saves time stamps of the recorded CAN messages as time offsets relative to the beginning of the recording, in seconds.

Absolute - formatted

Saves time stamps of the recorded CAN messages as absolute times. The time values are formatted according to the Format of absolute timestamps setting in the Options dialog box.

Absolute - raw values

Saves absolute time stamps as floating point values. The integral part of such a value is the number of days that have passed since December 30, 1899. The fractional part is the fraction of a 24-hour day that has elapsed.

Microsoft Excel can natively understand these values by formatting a cell containing the value as Date or Time, or a combination of both.

Differential in milliseconds

Saves the time stamp of a recorded CAN message as a time difference to the message recorded immediately before, in milliseconds.

Differential in seconds

Saves the time stamp of a recorded CAN message as a time difference to the message recorded immediately before, in seconds.

Decimal Separator

Determines the decimal separator that is used for the values in the file. If the Automatic setting is selected, the decimal separator is determined by the Region and Number format setting in the Windows Control Panel.

'Messages - Text' Tab

If you select this tab page, data will be exported to a text file, with the various information being arranged in columns. Use the options on this tab page to adjust the text output according to your requirements.

Output

Determines, which elements are written into the file.

Option | Description
Data Frames | Saves data frames to the file. This included CAN, CAN FD, and J1939 data frames.
RTR Frames | Saves RTR frames to the file.
Error Frames | Saves Error Frames to the file. Only available when exporting from a Trace recording or from the Receive List.
Error Counter Changes | Saves changes of error counters in the CAN controller to the file. Only available when exporting from a Trace recording or from the Receive List.
Status Changes | Saves changes of the hardware status to the file. Only available when exporting from a Trace recording.
Events | Saves events, e.g. CAN hardware plug-in/out, to the file. Only available when exporting from a Trace recording.

Columns

Displays the individual columns that are currently configured for the export operation.

Use the Select button to adjust the columns and their order.

Options

Option Description

Include header

Inserts a file header with details on the saving location, active buses, and column headings at the beginning of the file.

Output variable values

If symbolic information is available for a CAN message, the contained variables as well as their values are output to the file.

Use the Alignment drop-down list to control where the variables appear in the file relative to the raw data line.

Only marked variables

Writes only those variables to the file that have an enabled Trace switch. Only available if the Output variable values is enabled.

Qualified names

Displays names of symbols and variables in their fully qualified form. This means, the name is composed of the names of symbols file, symbol, multiplexer (if available), and the variable, separated by points. Examples:

SymbolsFile.SymbolName
SymbolsFile.SymbolName.MultiplexerName
SymbolsFile.SymbolName.VariableName
SymbolsFile.SymbolName.MultiplexerName.VariableName

'Messages - CSV' Tab

If you select this tab page, data will be exported to a CSV file (comma-separated values). Use the options on this tab page to adjust the output according to your requirements.

Column Separator

Determines the character that is used to separate the individual columns in the file.

If the Automatic setting is selected, the column separator depends on the decimal separator:

  • If the decimal separator is a Point, the column separator will be a Comma.

  • If the decimal separator is a Comma, the column separator will be a Semicolon.

Output

Determines which elements are written into the file.

See Output under Messages - Text.

Columns

Displays the individual columns that are currently configured for the export operation.

Use the Select button to adjust the columns and their order.

Options

Option Description

Column headings

If enabled, the first line in the file will have the headings of all columns.

Only marked variables

Writes only those variables to the file that have an enabled Trace switch.

Qualified names

Displays names of symbols and variables in their fully qualified form. This means, the name is composed of the names of symbols file, symbol, multiplexer (if available), and the variable, separated by points. Examples:

SymbolsFile.SymbolName
SymbolsFile.SymbolName.MultiplexerName
SymbolsFile.SymbolName.VariableName
SymbolsFile.SymbolName.MultiplexerName.VariableName

'Signals - CSV' Tab

If you select this tab page, data will be exported to a CSV file (comma-separated values). If you press OK and this tab is active, PCAN-Explorer first searches the selected trace file for Signal information, and then opens a dialog box where you can select the signals you would like to export.

This tab page is only available when exporting from a Trace recording.

Column Separator

Determines the character that is used to separate the individual columns in the file.

If the Automatic setting is selected, the column separator depends on the decimal separator:

  • If the decimal separator is a Point, the column separator will be a Comma.

  • If the decimal separator is a Comma, the column separator will be a Semicolon.

Time Column

Determines how time stamps of signals are stored in the file.

Option | Description
Individual columns for each signal | Each signal gets two columns in the file, which contain the value pairs of time stamp and signal value.
Common column for all signals | The first column in the file is a common time column. The other columns contain only the values of signals at the respective time.

Options

Option | Description
Column headings | If enabled, the first line in the file will have the headings of all columns.
Qualified signal names | Exports signal names in their fully qualified form. If a signal is based on a CAN symbol, the name is composed of the names of symbols file, symbol, multiplexer (if available), and the variable, separated by points. Examples: SymbolsFile.SymbolName.VariableName SymbolsFile.SymbolName.MultiplexerName.VariableName If a signal is not based on a CAN symbol: SymbolsFile.SignalName

See also

Exporting Recorded Data

Exporting Messages


File-related Elements

These elements of the user interface are needed in dealing with files.

In This Section

New File Dialog Box

Creates a new file of the type to be selected.

Print Selection Dialog Box

Controls the printout of text files.

Find Dialog Box

Searches for text in the text editor window.

Related Sections

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Find Dialog Box

The Find dialog box makes the search for text in the active text editor window possible. To access the Find dialog box select Find from the Edit menu.

The Find dialog box searches a text file from the cursor position either downward or upward, depending on the chosen search direction. The first found place with the sought-after text is highlighted. If from this position the search shall be continued with the same settings, in the menu Edit the command Find Next must be selected. The search can be continued as long as either the end or the beginning of the file has been reached. When reaching the end or the beginning of the file a message is displayed in the status bar of the text editor window.

The Find dialog box has following fields:

Text to find

Enter the text, for which you intend to search.

Match case

If selected, the search operation looks only for occurrences that match the uppercase and lowercase characters you enter in the Text to find box.

Match whole word only

Searches only for whole words, rather than matching the text as it occurs within words.

Direction

Up

Searches upward beginning at the cursor position.

Down

Searches downward beginning at the cursor position.

See also

Searching for Text

User Interface


New File Dialog Box

Use this dialog box to create new files.

Templates

Contains all file types that are supported by PCAN-Explorer, and which can be created by using this dialog box.

Shows the file types as large icons.

Shows the file types as small icons.

See also

User Interface


Print Selection Dialog Box

Use the Print Selection dialog box to configure options that affect the appearance of the printout of text files.The Print Selection dialog box is shown, when the command Print is selected from the File menu.

File to print

Shows the name of the file to be printed.

Print selected block

If a block of text is selected in the text editor window (highlighted text), only this text is printed (check box is activated). If this option is not activated, the whole file is printed.

Setup

Shows the dialog for the print setup.

Options

Header/page number

If this option is activated, on every page a header and the page number is printed. The header contains the file name; the page number appears centered at the lower sheet border.

Wrap lines

Causes lines that exceed the width of the printed page to continue to the next line.

Left margin

Sets the left margin for the printed pages.

See also

User Interface


Macro Elements

This section contains information about all dialog boxes and other elements that are related to VBScript Macros and Standard Macros.

In This Section

Macro Dialog Box

Serves for the management of VBScript Macros.

Macro Status Window

Shows information about the program flow of Standard Macros.

Macro Drop-down List

Serves for the quick access to Standard Macros or VBScript Macros, in order to start or edit them.

Related Sections

VBScript Macros

Contains topics about the use of and the reference to VBScript Macros.

Standard Macros

Contains the reference for standard Macros.

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Macro Dialog Box

The Macro dialog box is used to manage VBScript Macros. Macros can be started, edited, or created. To show the Macro dialog box, select Macro from the Macro menu.

Name

This list displays the names of all VBScript Macros that are contained in the selected Macro file (File drop-down list). In the field above the name of a Macro can be entered. The list automatically jumps to the entries that match with the entered starting letters.

If an entered name is not contained in the list, a new Macro can be added to the selected Macro file by clicking on the Edit button.

File

Selects the installed VBScript Macro file, whose Macros shall be displayed in the Name list.

Description

Shows the description of the Macro that is selected in the Name list.

Run

Starts the selected Macro.

Edit

Opens the Macro file of the selected Macro in the text editor.

New File

Creates a new Macro file.

Close

Closes the Macro dialog box.

Help

Shows the online help to the Macro dialog box.

See also

VBScript Macros

User Interface


Macro Status Window

The Macro Status window shows information about the program flow of Standard Macros. It also shows debug output or other messages from the Standard Macro that are generated by the Print Macro statement.

The Macro Status window is shown automatically when starting a Standard Macro. This behavior can be configured in the Options dialog box, on the Macros page.

When closing the window, the Macro will not be terminated but executed in the background. To show the window again, select Macro status from the View menu.

See also

Standard Macros

Print Statement

Macros, Options Dialog Box

User Interface


Macro Drop-down List

At the start of PCAN-Explorer, all Macros are read and translated that are contained in the preset library directories for Standard Macros and VBScript Macros. All Macros are added to the Macro drop-down list in the standard toolbar. In front of each Macro name an icon is displayed that informs about the kind and the status of the Macro.

Icon | Description
 | The Macro is a Standard Macro that was compiled successfully, and which does not contain any errors.
 | The Macro is a Standard Macro, which contains errors.
 | The Macro is a VBScript Macro.

The library directories for Standard Macros and VBScript Macros can be set in the Options dialog box, on the Library page. When PCAN-Explorer was launched for the first time, corresponding directories have been created and the paths were saved.

See also

Library, Options Dialog Box

Standard Macros

VBScript Macros


Options Dialog Box

In the Options dialog box, many of the settings that affect the PCAN-Explorer environment can be changed. For example, the directories can be defined that shall be used by default to save files of the different file types. To access the Options dialog box, select Options from the Tools menu.

The Options dialog box is divided into two parts: a category list on the left side, and a display area on the right. On the individual pages, the options are grouped according to functionality. When you select an entry from the list, its options appear in the display area.

To see documentation for any page in the Options dialog box, go to the page and press [F1], or press the Help button.

The Options dialog box can display the following pages:

Page | Description
General | General settings concerning Signals, Symbols Files, and the format of floating-point numbers.
Environment | General settings concerning the user interface.
Windows | General settings concerning windows in the user interface.
Documents | Settings concerning the handling of externally changed files.
Text Editor | Settings for the behavior of the text editor, display of line numbers.
Fonts and Colors | Setting of fonts and colors for different windows and elements of the user interface.
Keyboard | Use this page to customize shortcut keys.
Receive/Transmit | Controls displaying of data in the Receive/Transmit window.
Actions on Reset | Specifies the actions that are carried out when the Reset command is executed.
Tracer | Default settings for tracers.
Trace Window | Default display options of trace windows.
Macros | Settings concerning the handling of Macros.
Library | Configures the location and directories of the PCAN-Explorer Library.
Internet | Settings related to the internet connection.
Connections | General settings related to connections.
J1939 | Default settings concerning the J1939 protocol.
J1939 Auto-values | Default settings related to automatic signal value calculation for J1939 transmit messages.

See also

User Interface


General, Options Dialog Box

Use the General page of the Options dialog box to configure general settings concerning the user interface, Symbols Files, and the format of floating-point numbers. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the General page.

Float values

Format

This value defines the output format of floating-point numbers, when they are displayed in the different windows of PCAN-Explorer.

Setting | Meaning
Fixed | Floating-point numbers are displayed as fixed-point values of the format -xxx.xxx.
Scientific | Floating-point numbers are displayed in the scientific format: -x.xxx...E+xxx.
Shortest | Floating-point numbers are displayed in the shortest form possible, where either the Fixed format or the Scientific format is used.

Decimal places

This value defines the number of decimal places for floating-point numbers.

Default Decimal Separator

Determines the Decimal separator that divides the integer and fractional part of a number. Possible values are:

Setting | Meaning
Auto | The decimal separator is defined by the number format set up in Windows. The decimal separator can be modified in the Regional Options Control Panel.
Point | The decimal separator is a point.
Comma | The decimal separator is a comma.

Symbols Files

Activate Symbols only for enabled connections

If this option is set, PCAN-Explorer loads Symbols only for those connections in the project, that are currently enabled.

Signals

Signal name display mode

Controls, how Signals are named in the various windows of the user interface. Possible values are:

Setting | Meaning
Short Names | Displays signals with their short name, without a full qualification.
Qualified Short Names | Displays signals with their fully qualified name. If a signal is based on a CAN symbol, the displayed name is composed of the names of symbols file, symbol, multiplexer (if available), and the variable, separated by points. Examples: SymbolsFile.SymbolName.VariableName SymbolsFile.SymbolName.MultiplexerName.VariableName If a signal is not based on a CAN Symbol: SymbolsFile.SignalName
Long Names | Displays signals with their long name. If no long name is defined for a signal, the short name is displayed.

Reset Signal values when connections are reset

If this option is enabled, all Signal values are reset to their default values when resetting the connections via the Reset command.

Timestamps

Format of absolute timestamps

Controls the display format of absolute timestamps in the various windows of the user interface.

The drop-down list contains several predefined format strings, but any format can be entered. The following format specifiers can be used to format the date and time output:

Specifier | Displays
am/pm | am and pm indication, hour output in 12-hour format.
d | Day as number (1-31), shortest possible form.
dd | 2-digit day (01-31).
ddd | Day name, abbreviated to 2 characters (system locale dependent).
dddd | Day name, not abbreviated (system locale dependent).
h | Hour, shortest possible form. If am/pm is also indicated in the format string, hour is in 12-hour format.
hh | 2-digit hour. If am/pm is also indicated in the format string, hour is in 12-hour format.
m | Month as a number (1-12), shortest possible form.
mm | 2-digit Month (01-12).
mmm | Month name, abbreviated to 3 characters (system locale dependent).
mmmm | Month name, not abbreviated (system locale dependent).
n | Minute, shortest possible form (0-59).
nn | 2-digit Minute (00-59).
s | Second, shortest possible form (0-59).
ss | 2-digit Second (00-59).
x | Microseconds, up to 3 digits (x, xx, xxx).
yy | 2-digit Year.
yyyy | 4-digit Year.
z | Milliseconds, up to 3 digits (z, zz, zzz).

See also

Options Dialog Box

Apply Command


Environment, Options Dialog Box

Use the Environment page of the Options dialog box to configure general settings concerning the PCAN-Explorer user interface and other Environment settings. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Environment page.

Settings

Show status bar

Shows the status bar. The status bar is located at the bottom of the PCAN-Explorer main window and displays short descriptions of the menu items or toolbar buttons over which you hover the mouse.

Auto-save Project Desktop

If this option is activated, PCAN-Explorer saves the arrangement of your desktop when you close a project or exit the program. When you later open the same project, all files opened when the project was last closed are opened again, regardless of whether they are used by the project.

Tip

Pressing the [Shift] key while closing a project or exiting the program temporarily disables auto-saving of the project desktop.

At startup

You can specify what you want to view every time you start PCAN-Explorer.

Language

Specifies the language of the user interface.

Style

Determines the user interface style and colors.

Output Window

Play Sound on new Event if the Events tab is not visible

If the Output window is hidden or the Events tab is not active in the visible Output window, a sound is played if this option is activated and a new event is added to the Output window.

Other

Enable Debug Logfile

Enables the creation of a debug logfile for diagnostic purposes. If the option is enabled, debug output is logged in the file

C:\Users\UserName\AppData\Roaming\PEAK-System\PCAN-Explorer\6.0\Debug.log

The exact file path is displayed in the "About PCAN-Explorer" window under Debug Logfile. To show this window, select the About PCAN-Explorer command from the Help menu.

See also

Options Dialog Box


Windows, Options Dialog Box

Use the Windows page of the Options dialog box to configure general settings concerning windows in the PCAN-Explorer user interface. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Windows page.

Settings

Window Border Snap

If this option is enabled, the edges of a window that is moved or sized in the workspace snap to the edges of other windows or to the workspace border. This allows easy alignment of different windows, and is helpful in making the best possible use of the available workspace.

Note

This option only affects windows that have the type Tabbed Window.

Border Snap Distance

Determines the maximum number of pixels that be between the window edge and the edge of other windows or the workspace border, before the form snaps to the edge or border.

Tool Windows

Reset Layout

Resets the arrangement of the desktop to the default layout that was active when the program was started the first time.

See also

Options Dialog Box


Documents, Options Dialog Box

Use this page of the Options dialog box to control the display of documents in the PCAN-Explorer environment and manage external changes to documents and files. You can access this dialog box by selecting Options from the Tools menu and choosing the Documents page.

Detect when file is changed outside the environment

When selected, a message immediately notifies you of changes to an open file that have been made by an editor outside of PCAN-Explorer. The message allows you to reload the file from storage.

Auto-load changes (if not currently modified inside the environment)

When you have Detect when file is changed outside the environment checked and an open file in PCAN-Explorer has been changed externally, a warning message is generated by default. If this option is enabled, no warning will appear and the document will be reloaded to pick up the external changes.

Auto-apply reloaded files

If this option is activated, the Apply command is automatically executed for files that have been reloaded automatically because of external changes. This setting affects only certain file types, such as Symbols Files and Macro Files.

Auto-save on File Apply

If this option is activated, a file is saved automatically when the Apply command is executed for a file.

Recent Files

Selects the document types that are shown under the Reopen menu item after opening.

See also

Options Dialog Box

Apply Command


Text Editor, Options Dialog Box

Use the Text Editor page in the Options dialog box to change settings that control the behavior of the text editor. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Text Editor page.

Auto indent mode

Places the cursor below the first non-blank character (no space or tabulator character) of the line when you press the Return key.

Backspace unindents

If activated, pressing the backspace key while the cursor is at the first non-empty character of a line will make it the same indentation level as the previous line.

Use tab character

Inserts tab characters for line indentations.

Find text at cursor

Places the text at the cursor into the Text To Find field in the Find dialog box when you choose the Find command on the Edit menu.

Line numbers

Shows numbers at the left window border. This option can be activated separately for those file types that are based on text input.

Tab stops

The number of columns the cursor moves to the right when you press the tabulator key.

See also

Working with the Text Editor

Customizing Font Style, Size, and Colors

Customizing the Syntax Highlighting

Options Dialog Box


Fonts and Colors, Options Dialog Box

The Fonts and Colors page of the Options dialog box allows the setting of the font type and the color scheme for different elements of the user interface. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Fonts and Colors page.

Show settings for

Contains all elements of the user interface, which allow the setting of font type and color scheme. After an element has been selected, the settings for the object selected in the list Display items can be changed.

  • Connections Window
    Sets the font, font size, and color display settings for the Connections window.

  • Macro Status Window
    Changes of font, font size, and color display settings affect the appearance of text in the Macro Status window.

  • Output Window
    Changes of font, font size, and color display settings affect the appearance of text on the different tabs of the Output Window.

  • Receive/Transmit Windows
    Changes of font, font size, and color display settings affect the appearance of text in the Receive List, the Default Transmit List and other Transmit List windows.

  • Text Editor
    Changes of font, font size, and color display settings affect the appearance of text in Text Editor windows.

  • Trace Hint Window
    Changes of font, font size, and color display settings affect the appearance of text in the Hint window that displays values of trace message variables in Trace Windows.

  • Trace Windows
    Changes of font, font size, and color display settings affect the appearance of text in Trace Windows.

  • Watch Window
    Changes of font, font size, and color display settings affect the appearance of text on the different tabs of the Watch Window.

Use Defaults

Sets all settings back to default values.

Font

Lists all fonts appropriate for the display of the element. According to the chosen element in the list only the fonts are shown which have a constant character width. A change of the font affects all objects listed in Display items, that belong to the element selected in Show settings for.

Size

Contains a selection of sizes for the selected font. When using TrueType fonts, values not contained in the list can be entered in the entry field. A change of the font size affects all objects listed in Display items, that belong to the element selected in Show settings for.

Display items

Lists the items for which you can modify the foreground and background color.

Note

Text is the default display item. As such, properties assigned to Text will be overridden by properties assigned to other display items. For example, if you assign the color blue to Text and the color green to Keyword, all keywords will appear in green. In this example, Keyword properties override Text properties.

Item foreground

Lists the available colors you can choose for the foreground of the item selected in Display items.

Item background

Provides a color palette from which you can choose a background color for the item selected in Display items.

Text Attributes

Select these options to display the text of selected Display items in bold, italic, or as underlined text.

Sample

Displays a sample of font, font size, and the color scheme for the Show settings for and Display items selected. You can use this box to preview the results as you experiment with different formatting options.

See also

Options Dialog Box


Keyboard, Options Dialog Box

The Keyboard page allows you to customize key shortcuts in PCAN-Explorer. New shortcut keys can be created for frequently used commands. You can access this dialog box by selecting Options on the Tools menu, and then selecting the Keyboard page.

Hint

Enter a key combination in the Press new shortcut key(s) textbox to check the key combination for an existing command mapping. For example, FileSave displays in the Currently assigned to field when you enter Ctrl+S in the Press new shortcut key(s) textbox.

Category

Allows selecting a category of commands.

Commands

Lists all available commands of the selected category.

Shortcut for selected command

When a command is selected in the Commands list, this field displays the shortcut key which is mapped to the command.

Press new shortcut key(s)

Allows you to press a key combination to be used for the currently selected command. You must use one or more modifier keys such as [Ctrl], [Alt], or [Shift]. For example, pressing [Ctrl] and [Shift], and then [F2] creates the shortcut key [Shift+Ctrl+F2]. Use [Backspace] to delete the shortcut key combination from the field.

Description

A short description of the command.

Assign

Binds the new key combination to the selected command. This button is active after you type a key combination in the Press new shortcut key(s) box.

Remove

Removes the assigned key combination from the selected command.

Reset All

Resets all key combinations to their default settings.

See also

Options Dialog Box

Customizing Key Combinations

Table of Shortcut Keys

PCAN-Explorer Commands


Receive/Transmit, Options Dialog Box

Use the Receive/Transmit page of the Options dialog box to control the display of data in the Receive and Transmit lists. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Receive/Transmit page.

Receive List

Show Symbol Comment and Long Name hints

If this option is activated, hint texts (ToolTips) will be displayed at the mouse pointer when the mouse is positioned over a Symbol or Variable in the Receive List, in the Symbol or Data column. Displaying hint texts can make the understanding of the displayed data easier.

The hint text for a Symbol shows the comment that was defined in the Symbols file for the corresponding element. If also a Multiplexer is associated with the Receive List entry, the comment that was defined for the Multiplexer is shown in the next line of the hint text.

The hint text for a Variable shows the Long Name that was defined for the Variable in the Symbols file, and in the next line the comment.

Auto-expand Symbols

If this option is active, Symbols are automatically displayed expanded at their first reception, otherwise collapsed. In expanded state, the Variables contained in the Symbol are visible, along with their values.

Show hexadecimal data for symbolic messages

If this option is activated, PCAN-Explorer additionally displays hexadecimal data bytes for symbolic messages in the data column, above the variables.

Transmit List

Show Symbol Comment and Long Name hints

If this option is activated, hint texts (ToolTips) will be shown at the mouse pointer when the mouse is positioned over a Symbol or Variable in a Transmit List, in the Symbol or Data column. Displaying hint texts can make the understanding of the displayed data easier.

The hint text for a Symbol shows the comment that was defined in the Symbols file for the corresponding element, and in the next line the comment that was defined for a Multiplexer, if a Multiplexer is associated with the Transmit List entry.

The hint text for a Variable shows the Long Name that was defined for the Variable in the Symbols file, and in the next line the comment.

Show hexadecimal data for symbolic messages

If this option is activated, PCAN-Explorer additionally displays hexadecimal data bytes for symbolic messages in the data column, above the variables.

Common Settings

The following settings affect both the Receive list and Transmit lists.

Show Long Names of Variables

If this option is activated, long names of Variables, if available, are displayed in the Data column of Receive and Transmit lists instead of the short names, which are limited to a length of 32 characters. The short names are still displayed for all Variables that do not have a long name.

Long names are specified via an additional parameter in the Variable definition. See also Optional Parameters for Signal and Variable Definitions.

Keep Variable values in visible area

If this option is activated, Variable values in the Data column are not immediately cut off on the right if the column is not wide enough to display all information. Instead, the length of the Variable names is first shortened in order to create enough space for the Variable values.

Alignment of Variable names

Determines the alignment of the Variable names in the Data column.

See also

Actions on Reset, Options Dialog Box

Options Dialog Box


Actions on Reset, Options Dialog Box

Use the Actions on Reset page of the Options dialog box to specify the actions that are carried out when the Reset command is executed.

Actions for the Reset command

The following actions are available:

Clear Receive List

If this option is enabled, the Receive list is cleared. Setting this option also includes the options Clear Receive List counters and Clear Receive List time data.

Clear Receive List counters

If this option is enabled, the counters of all entries in the Receive list are reset to zero.

Clear Receive List time data

If this option is enabled, the timestamps of the last reception and measured cycle times of all messages in the Receive list are cleared.

Clear Transmit List counters

If this option is enabled, the counters of all entries in the Transmit list are reset to zero.

Clear Transmit List time data

If this option is enabled, the timestamps of the last transmission and the values in the Trigger column of all messages in the Transmit list are cleared.

Reschedule periodic transmit messages

If this option is enabled, the transmission times of all periodic transmit messages will be recalculated as if the sending was stopped and restarted. If the Transmit List contains multiple enabled periodic transmit messages, clearing only the transmission counters can, especially at slow transmission intervals, lead to unclear relationships of counter readings among each other.

See also

Receive/Transmit, Options Dialog Box

Options Dialog Box


Tracer, Options Dialog Box

Use the Tracer page of the Options dialog box to configure settings for tracers and trace windows. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Tracer page.

Settings

Temporary trace files directory

When a new Tracer is opened with the command Start New Tracer [image], and the default buffer type is set to File (see below), PCAN-Explorer stores the trace file in the directory that is selected here.

The selected directory is not taken into account if the current project does not have a storage location yet. If a new project has been created that has not been saved yet, new trace files are automatically stored in the Temp directory of the local user account, usually in C:\Users\UserName\AppData\Local\Temp.

Delete temporary trace file after Save As

If this option is enabled, a temporary trace file is deleted after it has been successfully saved under a different file name using the File | Save As command.

Include file name and path in header of trace file

If this option is enabled, the name and path of the file is written into the header of the trace file as a comment.

Hint

If a trace file opened with buffer type File is saved under a different name, the file name and path in the file header will not be adjusted. In this case, the original file is only copied to the new location and not recreated.

Append filter name to name of filtered Trace

The Trace that is created when a trace file is filtered is usually named FileName_filtered. If this option is activated, the name of the applied filter will be added to the file name, for example the newly created Trace is named FileName_filtered_MyFilter. Any characters in filter names that could lead to invalid file names are automatically removed. Spaces are also removed.

Tracer Default Settings

These settings are used to initialize newly created Tracers.

Buffer type

Determines how the buffer is filled with data.

  • File: The data is written directly in a trace file during recording.

  • Dynamic: The buffer size grows continuously while messages are recorded.

  • Linear: The buffer has a fixed size. When the buffer is completely filled, the recording is stopped and a message is shown in the Output window.

  • Ring: The buffer has a fixed size. If the buffer is full, the oldest message in the buffer is overwritten when a new message is recorded.

Buffer size

Sets the fixed size of the data buffer (number of CAN messages) for the Linear and Ring buffer types. The maximum buffer size you can enter is 999,999,999 messages. While you enter a value in the field, the required working memory is calculated and displayed next to the field.

First entry sets start time

If this option is enabled, the timestamp of the first recorded message determines the start time of the tracer, which is also stored in the trace file. The time offset of the first entry is in this case 0.

If this option is disabled, the recorded start time is the time at which the tracer is started, e.g. when the Start button [image] is pressed in the tracer window.

File Format

Determines which version of the trace file format is used by default.

  • Automatic: PCAN-Explorer automatically determines the version based on the PCAN hardware used. The following applies here: if only PCAN-USB adapters (IPEH-002021/002022), PCAN-USB Pro (IPEH-002061), or PCAN-USB Hub (IPEH-002004) are used in a project, PCAN-Explorer saves trace files using version 1.3, in all other cases using version 2.1.

  • Version 2.1: Specifies that the currently latest version 2.1 should always be used when saving trace files.

Further information on the different versions of the trace file format can be found in the PEAK-System file format specification for CAN trace files, which can be downloaded from our website under Support / Downloads / Documentation.

See also

Trace Window, Options Dialog Box

Options Dialog Box

Project Settings Dialog Box


Trace Window, Options Dialog Box

Use the Trace Window page of the Options dialog box to configure default settings for trace windows. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Trace Window page below the Tracer node.

Trace window

Show column captions

Sets whether Trace windows display column captions by default.

Show status bar

Sets whether Trace windows have a status bar by default.

Show hex data in Pause and Stop modes

If this option is enabled, a Hex View panel is shown in a Trace window below the trace list when the tracer is in pause or in stop mode. If you select a message in the trace list, the message is shown in detail in the Hex View panel.

Show hint window for Variable values when window is inactive

If a message in a Trace window has symbolic information, a hint window with the Variable values is displayed when the mouse pointer is positioned over the data bytes of the message. For this, the Tracer must be paused or stopped, and both the Trace window and PCAN-Explorer itself must be active.

If this option is enabled, the hint window will be displayed even when the Trace window is not the active window in the PCAN-Explorer user interface, or when the application is currently not active.

See also Displaying Variables in the Trace Window.

Show long Variable names in hint window

If this option is activated, long names of Variables, if available, are displayed in the Variable values hint window instead of the short names, which are limited to a length of 32 characters. The short names are still displayed for all Variables that do not have a long name.

Long names are specified via an additional parameter in the Variable definition. See also Optional Parameters for Signal and Variable Definitions.

Show file overwrite warning for Tracers using the File buffer type

If this option is enabled, a warning message is displayed in a Trace window if the Tracer uses the File buffer type and already contains recorded data. Executing the Start command for the Tracer will write new data immediately into the currently opened file and overwrite a previous recording, in contrary to the buffer types Dynamic, Linear, and Ring, which record data into memory first.

Timestamps

Determines the default format that is used to display timestamps in Trace windows.

  • Relative: The displayed value indicates the time offset since start of the recording in Seconds.

  • Absolute: The timestamp is shown as an absolute time.

  • Differential: The displayed value indicates the time period between the message and the previous recorded message.

Relative and differential timestamps in microseconds resolution

Improves the resolution of the timestamps shown in Trace windows to 1 microsecond. By default, relative and differential timestamps are shown with a resolution of 1/10 millisecond.

The higher resolution can only be shown for trace files that use format version 1.3 or newer. Older formats do not store the timestamps with the required number of decimal places. All Trace files recorded with PCAN-Explorer 6 enable the display of timestamps in the higher resolution.

CAN ID Format

Chooses the default display format of CAN IDs in Trace windows. Selectable options are decimal or hexadecimal format.

Data Length Display

Selects whether the length of CAN messages is displayed by default as Data Length Code or as number of data bytes in Trace windows.

Data Bytes Format

Chooses the default display format of data bytes in Trace windows. Selectable options are decimal, hexadecimal, or ASCII format.

J1939

This section is only available if the J1939 Add-in is loaded.

Display format of PGNs

Determines whether Parameter Group Numbers are displayed in decimal or hexadecimal notation in Trace windows by default.

Display format of addresses

Determines whether source and destination addresses are displayed in decimal or hexadecimal notation in Trace windows by default.

See also

Tracer, Options Dialog Box

Trace Windows

Options Dialog Box

Project Settings Dialog Box


Macros, Options Dialog Box

Use the Macros page of the Options dialog box to configure how PCAN-Explorer shall deal with changed Macro files before a Macro is started. This is related to Standard Macros as well as VBScript Macros. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Macros page.

Settings

Always reload the file

If this option is activated, PCAN-Explorer reloads a Macro file every time the file that contains the Macro has been changed.

Never reload the file

If this option is activated, PCAN-Explorer never reloads a Macro file after the Macro file has been changed. However, the Macro file can be reloaded manually after a modification has been made by selecting the Reload Macro File command from the Macro editor's context menu.

Ask whether to reload the file

If this option is activated, PCAN-Explorer shows a message window to prompt the user, if a changed Macro file shall be reloaded.

Standard Macros

The settings in this section are for Standard Macros only.

Automatically show Macro Status...

If this option is activated, the Macro Status window is shown automatically when a Standard Macro is started.

Show timestamps in Macro Status window

If this option is activated, timestamps are displayed in the Macro Status window at the beginning of each line. The timestamps indicate the number of seconds since the start of the macro.

Check maximum number of allowed arguments

If this option is activated, PCAN-Explorer checks when translating a Standard Macro whether the allowed number of arguments for the individual macro instructions has been exceeded. Exceeding the allowed number of arguments generates the error message Error 208: Too many arguments for macro instruction.

See also

Options Dialog Box

Error Messages of Standard Macros


Library, Options Dialog Box

On the Library page of the Options dialog box, the library directories for the various PCAN-Explorer file types can be defined. Files that are saved in these directories are listed in the Library Browser under the respective category tree node, to allow a quick access of these files.

You can access the Options dialog box by selecting Options from the Tools menu and then selecting the Library page.

Library Root Directory

Sets the root directory for the PCAN-Explorer library. The directory in this field is used when referencing the $(LibDir) directory macro.

To select a directory, you can also display a Browse dialog box using the button next to the field, or choose a Directory Macro.

Library Directories

This list includes the directories for the respective file types.

Column | Meaning
File type | Displays the name of the file type as well as its file name extension.
Path | Contains the preset standard directory for the file type. The path name can also contain Directory Macros.

See also

Library

Options Dialog Box

Library Browser

Directory Macros


Internet, Options Dialog Box

Use the Internet page of the Options dialog box to change settings related to your internet connection. PCAN-Explorer uses the internet connection to update the news list, which is shown on the Start Page.

You can access the Options dialog box by selecting Options from the Tools menu, and then selecting the Internet page.

Updates

Check for new version every ... days

Determines whether and at which time interval PCAN-Explorer checks for product updates over the internet.

News

Check for updated news every ... days

Determines whether and at which time interval PCAN-Explorer updates the news list on the Start Page over the internet.

Proxy with Authentication

I use a proxy with authentication (HTTP)

If this box is checked, the application will send an authentication message to the proxy server when connecting to the Internet. Check this option only if your server requires authentication, then fill the User Name and Password fields below.

User Name

Specifies the Proxy authentication login.

Password

Specifies the Proxy authentication password.

See also

Options Dialog Box


Connections, Options Dialog Box

Use the Connections page of the Options dialog box to configure general settings regarding connections.

You can access this page of the Options dialog box by selecting Options from the Tools menu and then selecting the Connections page.

Settings

Enforce hardware options configured in the project

If the option is activated, the various hardware options of the CAN interface used are overwritten with the settings saved in the project when a connection is established, even if the CAN interface is already occupied and configured by other software.

This affects the following settings:

  • Listen-only mode

  • Determine Timestamps at Start-of-Frame

  • Tx Self-Acknowledge

  • Ignore BRS

See also

Connection, Project Settings Dialog Box

Options Dialog Box


J1939, Options Dialog Box

Use the J1939 page of the Options dialog box to configure default settings for connections that use the J1939 protocol.

You can access the Options dialog box by selecting Options from the Tools menu, and then selecting the J1939 page. The page is only available when the J1939 Add-in is loaded.

J1939 Default Settings

Process Requests (RQST)

If this option is activated, new projects are configured so that PCAN-Explorer will try to answer received RQST (PGN 59904) messages.

Transport Protocol Read Sessions

These settings have an effect if a J1939 connection acts as a responder during a data transfer.

CTS: Number of accepted packets

This is the default maximum number of large message data packets cleared to send. The actual number of packets cleared to send in a TPCM.CTS message will never be larger than the requested number or packets from a received TPCM.RTS message.

Number of Re-CTS

Sets the default maximum number of Re-CTS during a read session.

After the responder has transmitted a CTS, and no data packet (TPDT) is received from the originator within a timeout of 1250 ms, the responder sends again a CTS. When the number of these re-sent CTS reaches the number of specified Re-CTS, when the next timeout occurs the responder aborts the session by sending a TPCM.ConnAbort.

Transport Protocol Write Sessions

These settings have an effect if a J1939 connection acts as an originator during a data transfer.

RTS: Maximum number of packets

This is the default maximum number of requested packets that can be sent by the originator in response to one CTS. If the responder complies with this limit, the responder ensures that the originator can retransmit packets that the responder has not received correctly for whatever reason.

Number of retries

Sets the default maximum number of RTS-retries during a write session.

After the originator has transmitted the number of data packets that were cleared to send by the last received CTS, the originator sends again an RTS to request the next data transfer. If the responder does not answer with a CTS within a timeout of 1250 ms, the originator issues again an RTS. When the number of these re-sent RTR reaches the number of specified Retries, when the next timeout occurs the originator aborts the session by sending a TPCM.ConnAbort.

See also

Options Dialog Box

J1939 Auto-values, Options Dialog Box

J1939, Project Settings Dialog Box


J1939 Auto-values, Options Dialog Box

Use the J1939 Auto-values page of the Options dialog box to configure default settings for transmit messages that use the J1939 protocol.

You can access this dialog box by selecting Options from the Tool menu, and then selecting the J1939 Auto-values page below the J1939 node. The page is only available when the J1939 Add-in is loaded.

When sending, automatically calculate these J1939 signal values

Here you can choose for different J1939 signals (SPNs) whether their values are automatically calculated when sending a J1939 message containing the signals.

Recipients of certain J1939 messages such as TSC1 (Torque/Speed Control 1, PGN 0) can determine the data integrity of the message by evaluating the rolling counter value as well as the checksum that come in the message.

The automatic signal value calculation is linked to the SPNs and only takes place if a symbol of type J1939PG is associated with the transmit message that contains matching SPNs.

When you click the [image] button, which is located at the right above the list, a popup menu will be displayed, allowing you to customize various options for the list, e.g. the sorting order.

Hint

The settings on this page are only used as default settings when you create a new project. To adjust the J1939 auto-value calculation of your current project, please use the J1939 Auto-values page in the Project Settings dialog box.

See also

Options Dialog Box

J1939, Options Dialog Box

J1939 Auto-values, Project Settings Dialog Box


Receive/Transmit Window

The Receive/Transmit window is one of the central elements of the PCAN-Explorer user interface. It contains the Receive List and the Default Transmit List.

Both lists are labeled vertically on the left side of the window (Receive and Transmit). The Receive List displays all CAN messages that are received by PCAN-Explorer. The Transmit List contains CAN messages that are transmitted by PCAN-Explorer. Transmit messages can be created manually by the user, or will be created automatically by a sending Standard Macro, VBScript Macro, or Instruments Panel.

The sizes of the lists in the Receive/Transmit window can be adjusted using the horizontal separator bar between the two lists, by dragging it with the mouse.

One of the two lists can also be maximized, so that it occupies the whole area of the Receive/Transmit window:

Button | Description
 | Maximizes the corresponding list. Alternatively, the [+] key can be pressed while the list has the input focus.
 | Restores the initial partitioning of Receive list and Transmit list. Alternatively, the [-] key can be pressed.

The input focus can be toggled between the two lists by pressing the [Tab] key.

Toolbar

The Receive/Transmit window also has a separate toolbar, which allows quick access to the most frequently used commands to edit the Transmit list.

Button | Command | Description | Alternative
 | New Message | Creates a new transmit message, shows the Edit Message dialog box. | [Ins] Transmit | New Message
 | Edit Message | Shows the Edit Message dialog to edit a single Transmit message. | [Enter] / [Shift+Enter] Transmit | Edit Message
 | Edit Variables | Shows the Edit Variables dialog to edit the Variable values of a single Transmit message. | [Enter] Transmit | Edit Variables
 | Pause / Resume | Pauses or resumes selected periodic transmit messages. | [Pause] Transmit | Pause / Resume

Filter

The Filter drop-down list allows to select a message filter for the Receive list. If you select a filter, only those message are shown in the Receive list that pass through the filter. The drop-down list contains all message filters in the current project (see Project Manager, Message Filters node on the Project Items tab). If the selected filter is disabled, all received messages will pass through the filter.

Symbol | Description
 | No filter is selected.
 | An enabled message filter.
 | A disabled message filter.

The buttons next to the drop-down list have the following meaning:

Button | Description
 | Edits the selected filter, opens the Edit Filter dialog box.
 | Adds a new message filter to the current project and shows the Edit Filter dialog box.

See also

Receive List

Default Transmit List

Receiving and Transmitting CAN Messages

Receive/Transmit, Options Dialog Box


Receive List

The Receive List is located in the Receive/Transmit window and shows CAN messages that are received by PCAN-Explorer.

You can choose the columns that are displayed in the Receive List by using the Select Columns dialog box. You can also change the order of the columns easily by dragging a column header with the mouse to a new position.

The following columns are available for the Receive List:

Bus

The bus number of the connection from which a message was received (1-16).

CAN-ID (hexadecimal)

The CAN Identifier of the message in hexadecimal representation. 11-bit CAN messages are displayed with a 3-digit CAN-ID (0-7FFh), 29-bit CAN messages according to CAN protocol 2.0B are displayed with a 8-digit CAN-ID (0 - 1FFFFFFFh).

CAN-ID (decimal)

The CAN Identfier of the message in decimal representation. 29-bit extended CAN messages according to CAN protocol 2.0B have the postfix 'x'.

Type

Type of the CAN message. The individual types are represented by colored indicators.

The following indicators can be displayed:

Indicator | Description
No display | 11- or 29-bit data message
 | Remote Request frame
 | CAN FD message
 | CAN FD message with Bit Rate Switch set
 | Error State Indicator
 | J1939 message
 | J1939 message that used the Transport Protocol for transmission
 | Error Frame
 | Error Counter change

DLC

The Data Length Code of the message. For CAN and CAN FD messages the value is in the range 0-15, and for J1939 messages in the range 0-1785.

If the DLC of a CAN message is greater than 8, it is displayed in red. Since the DLC field in a CAN frame consists of 4 bits, the DLC value can be in the range 0-15. However, the data length can never be higher than 8. DLC values greater than 8 have a meaning only with CAN FD.

Length

The number of data bytes. Conventional CAN messages can have maximum length of 8 data bytes. The maximum length of J1939 messages is 1785.

For CAN FD, the maximum number of data bytes is 64, whereas the following relationship between DLC and Length applies:

DLC | Length
<= 8 | DLC
9 | 12
10 | 16
11 | 20
12 | 24
13 | 32
14 | 48
15 | 64

Symbol

The name of a Symbol that is compatible with the message.

Data

The values of the data bytes of the message. CAN messages can have up to 8 data bytes, J1939 messages have a maximum of 1785 data bytes.

If the message is an Error Frame, this column shows details regarding the Error Frame.

Timeouts

The number of occurred time-outs, if a timeout has been defined for a Symbol or Multiplexer.

Cycle Time

The time interval between the last two reception times of the message, in Milliseconds.

Max. Cycle Time

The maximum measured cycle time since the Reset command was last executed.

Message Rate

The number of received messages per Second.

Count

The number of received messages since the Reset command was last executed.

Time

The time at which the message was last received.

Additional columns for the J1939 protocol

These columns are only visible or available for selection, if the current project contains at least one connection that uses the J1939 protocol.

PGN

Identifies the Parameter Group Number of the message.

Separate columns can be included to display the PGN in decimal and/or hexadecimal notation.

Priority

The priority (0-7) of the message.

Source

The source address of the message. If Null is indicated, the message has the Null address (254), which means the originator of the message did not claim an address.

Separate columns can be included to display the source address in decimal and/or hexadecimal notation.

Destination

The destination address of the message. If All is indicated, the message was transmitted using the Global address 255, which means the message was transmitted as a broadcast.

Separate columns can be included to display the destination address in decimal and/or hexadecimal notation.

See also

Receive/Transmit Window

Symbols in the Receive List

Default Transmit List

Error Frames in the Receive List

Select Columns Dialog Box


Default Transmit List

The Transmit List in the Receive/Transmit window is also called the Default Transmit List. Transmit messages can be added to the list either manually by the user, or will be added automatically by a sending Standard Macro, VBScript Macro, or Instruments Panel.

All messages in this list are automatically saved in the project file.

You can choose the columns that are displayed in a Transmit List by using the Select Columns dialog box. You can also change the order of the columns easily by dragging a column header with the mouse to a new position.

The following columns are available for Transmit Lists:

Bus

The Bus column displays the number of the connection, to which the message belongs (1-16).

If the associated connection is disabled, the icon [image] is displayed in front of the bus number.

Connection

The name of the connection, to which the message belongs.

CAN-ID (hexadecimal)

The CAN Identifier of the message in hexadecimal representation. 11-bit CAN messages are displayed with a 3-digit CAN-ID (0-7FFh), 29-bit CAN messages according to CAN protocol 2.0B are displayed with a 8-digit CAN-ID (0 - 1FFFFFFFh).

CAN-ID (decimal)

The CAN Identifier of the message in decimal representation. 29-bit extended CAN messages according to CAN protocol 2.0B have the postfix 'x'.

Type

Type of the CAN message. The individual types are represented by colored indicators.

The following indicators can be displayed:

Indicator | Description
No display | 11- or 29-bit data message
 | Remote Request frame
 | CAN FD message
 | CAN FD message with Bit Rate Switch set
 | Error State Indicator
 | The message uses the Single Shot Transmission option. See NXP Application Note AN97076 "SJA1000 Stand-alone CAN controller", section 5.4.
 | J1939 message
 | J1939 message that requires the Transport Protocol for transmission

DLC

The Data Length Code of the message. For CAN messages, the value is in the range 0-8, for CAN FD messages in the range 0-15, and for J1939 messages in the range 0-1785.

Length

The number of data bytes. Conventional CAN messages can have maximum length of 8 data bytes. The maximum length of J1939 messages is 1785.

For CAN FD, the maximum number of data bytes is 64, whereas the following relationship between DLC and Length applies:

DLC | Length
<= 8 | DLC
9 | 12
10 | 16
11 | 20
12 | 24
13 | 32
14 | 48
15 | 64

Symbol

The name of the Symbol that is compatible with the message.

Data

The values of the data bytes of the message.

Cycle Time

The time interval, in which a message is sent periodically. If the cycle time is set to 0 ms, the text Wait is displayed, which means the message is not transmitted periodically.

Count

The number of transmitted messages since the Reset command was executed last.

Trigger

The reason for the last transmission of a message. Following reasons for transmitting a message can be displayed:

  • Manual: The message was sent manually by the user.

  • Time: The message was sent due to the defined transmission period.

  • RTR: The message was sent in response to a received Remote Request frame.

  • Macro: The message was sent by a standard Macro.

  • Automation: The message was sent by a VBScript Macro or by an external program, which operates PCAN-Explorer as an Automation server.

  • RQST: The message was sent as a response to a J1939 Request (PGN 59904).

Time

The time at which the message was last sent.

Creator

Identifies the creator of a message.

Comment

A text that comments the message. The comment text can be edited in the Properties window if the message is selected in the Transmit list.

Additional columns for the J1939 protocol

These columns are only visible or available for selection, if the current project contains at least one connection that uses the J1939 protocol.

PGN

Identifies the Parameter Group Number of the message.

Separate columns can be included to display the PGN in decimal and/or hexadecimal notation.

Priority

The priority (0-7) of the message.

Source

The source address of the message. If Null is indicated, the message has the Null address (254).

Separate columns can be included to display the source address in decimal and/or hexadecimal notation.

Destination

The destination address of the message. If All is indicated, the message is transmitted using the Global address 255, which means the message is transmitted as a broadcast. If Null is indicated, the message has the Null address (254).

Separate columns can be included to display the destination address in decimal and/or hexadecimal notation.

See also

Symbols in Transmit Lists

Working with Transmit Lists

Select Columns Dialog Box


Error Frames in the Receive List

To show Error Frames in the Receive List, enable the Error Frames property of a connection in the Properties window. In the Connections window in the Options column the EF option is then indicated for the connection.

The Receive List marks a recognized Error Frame by indicating the kind of error in the ID column:

  • Bit error

  • Form error

  • Stuff error

  • Other error

For a description of the different bus errors, see NXP (formerly Philips) Application Note AN97076, "SJA1000 Stand-alone CAN controller", section 5.2.3.

If the text "Error Counter" is displayed in the ID column, one of the error counters RXERR or TXERR in the CAN controller has decreased. This is not an Error Frame, but only informs about the changed register values.

The Data column either indicates the text Error, or additional information about the Error Frame. If the option Show detailed information for Error Frames is activated in the Options dialog box on the Receive/Transmit page, this column displays additional information, each separated by a comma:

  • Tx or Rx, if the error occurred during transmission or reception

  • A description of the position of the error on the bus

  • The values of the error counter registers RXERR and TXERR of the CAN controller.

See also

Displaying Error Frames

Connections Window

Options Dialog Box

Receive List


Select Columns Dialog Box

Use this dialog box to change the columns that are displayed in the Receive List or in Transmit Lists, and to select columns when you export data from the Receive/Transmit lists or from a Tracer.

To access this dialog box, for example, right-click on the header at the top of a message list to open the context menu, and then select the Configure Columns command.

Columns

Lists all available column types. Set a check mark in the box in front of a column name to select the column.

Description

Displays a short description for the selected column.

Move Up

Moves the selected column upwards in the Columns list. In the message list or during export, the column is then shifted to the left.

Move Down

Moves the selected column downwards in the Columns list. In the message list or during export, the column is then shifted to the right.

To change the order of the columns, you can also click a column with the mouse and drag it to another position in the list.

See also

Receive List

Default Transmit List


Signal and Symbol Elements

This section contains information about all dialog boxes and other elements that are related to Signals and Symbols.

In This Section

Select Signal Dialog Box

Used to select a Signal.

Watch Window

Allows the monitoring of Signal values.

Edit Variables Dialog Box

Used to edit Variable values of CAN messages in Transmit Lists.

Inspect Variables Dialog Box

Used to inspect Variable values of CAN messages in the Receive List.

Related Sections

Signals

Describes the operation of Signals and their use in PCAN-Explorer.

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Select Signal Dialog Box

The Select Signal dialog box is used in different places in PCAN-Explorer to select one of the available Signals. Signals are generated for example by loading and activating a Symbols file, or by VBS Macros.

Filter

Filters the signals displayed by different categories:

  • All signals: All available signals are displayed in alphabetical order.

  • CAN Symbols: Lists all signals that have been generated by activation of a Symbols file and its contained variable and signal definitions.

  • Virtual: Lists only virtual variables and signals, which are not assigned to any CAN symbols.

  • Bus n: Shows signals that belong to a specific bus number n.

Display

Selects how signal names are displayed in this window. If the option Default is selected, the display format is determined through the default setting in the Options dialog box. See also General, Options Dialog Box, under Signal name display mode.

To make it easier to find a Signal in the list, press [Ctrl+F] to search for specific signals. While you enter a part of a signal name, the list is filtered immediately and matches in the names are highlighted.

See also

Signals


Watch Window

Using the Watch window, you can monitor the values of a selection of signals. To show the Watch window, select the Watch command from the View menu. The Watch window contains four tab pages Watch 1, Watch 2, Watch 3, and Watch 4. You can use these to arrange the monitored signals in different groups.

The following columns can be displayed in the Watch window:

Name

Contains the names of the monitored signals.

Value

Shows the current signal values.

Time

Displays the time at which signal values were last changed. If no time is displayed for a signal, the signal value was either not changed manually, or there have been no CAN message received or sent, which contained the signal.

Meter

Shows graphic representations of the signal values as bars. The range of values of the respective bar graph arises from the data type and the defined minimum and maximum values of the corresponding signal.

Type

Shows the data types of the monitored signals.

Comment

Shows comment texts, which have been assigned to the signals.

You can show or hide columns by using the context menu (right mouse button) of the Watch window.

To change the arrangement of the columns, drag the column headers with the mouse to other positions.

To change the vertical order of signals, select the rows and either press [Ctrl+Arrow-up] or [Ctrl+Arrow-down] on the keyboard, or open the context menu and choose one of the commands Move Up or Move Down.

See also

Watching Signals

User Interface


Edit Variables Dialog Box

Using the Edit Variables dialog box, you can change the variable values of CAN messages that have been inserted into Transmit Lists. To display this dialog box, select a CAN message in a Transmit List, then select the Edit Variables command from the Transmit menu or from the context menu of the Transmit List.

Variables tab

Name

This column displays the names of the variables that are defined for this CAN message.

SPN

If the message is a J1939 message, this column shows the Suspect Parameter Numbers that are associated with the variables.

Value

This column displays the values of the individual variables. The values are displayed according to the individually defined display formats.

Unit

Displays the physical units of the variables.

Type

Shows the data types of the variables.

Range

Shows the ranges of values for the variables. If an entered value is not within this range, an error message is displayed.

To change a variable value, either double-click with the mouse into the value field, or press [F2] while the list has the input focus and a value field is selected. A new Variable value can be entered in different formats or number systems, see Input Syntax of Different Value Formats.

Raw Data tab

This tab is only visible if the message contains variables that have the type "Raw". Raw variables can have a dynamic data length of up to 1785 bytes. On this tab, you can edit the data bytes of these variables with the help of a hex editor.

Variable

Selects the variable to be edited. The drop-down list contains all "Raw" variables of the message.

(Hex Editor)

In the Hex Editor, you can edit the data bytes of the selected variable by entering hex values or characters. By pressing [Tab], you can move the caret between the hex-editing area on the left and the ASCII representation of the data on the right side, where you can enter characters instead of hex codes. If the Hex Editor has the input focus, to leave the Hex Editor using the keyboard, press [Ctrl+Tab] or [Shift+Ctrl+Tab].

The Hex Editor display can be customized using the context menu. You can choose the number of displayed data bytes per row (8, 10, or 16) and the number of data bytes per column (1, 2, or 4).

Loads the data from a file.

Saves the data to a file.

Sets all data bytes to zero.

See also

Symbols in Transmit Lists

Input Syntax of Different Value Formats

Data Types

Edit Message Dialog Box


Inspect Variables Dialog Box

Using the Inspect Variables dialog box, you can inspect the values of variable of CAN messages in the Receive List. To display this dialog box, select a CAN message in the Receive List, then select the Inspect Variables command from the View menu or from the context menu of the Receive List.

Variables tab

Name

This column displays the names of the variables that are defined for this CAN message.

SPN

If the message is a J1939 message, this column shows the Suspect Parameter Numbers that are associated with the variables.

Value

This column displays the values of the individual variables. The values are displayed according to the individually defined display formats.

Unit

Displays the physical units of the variables.

Type

Contains the data types of the variables.

Range

Shows the ranges of values for the variables.

Raw Data tab

This tab is only visible if the message contains variables that have the data type "Raw". Raw variables can have a dynamic data length of up to 1785 bytes. On this tab, you can inspect the data bytes of these variables with the help of a hex editor display.

Variable

Selects the variable to be shown. The drop-down list contains all "Raw" variables of the message.

(Hex Editor)

In the Hex Editor, you can inspect data bytes of the selected variable. The Hex Editor is in read-only mode, so you cannot modify any data bytes. If the Hex Editor has the input focus, to leave the Hex Editor using the keyboard, press [Ctrl+Tab] or [Shift+Ctrl+Tab].

The Hex Editor display can be customized using the context menu. You can choose the number of displayed data bytes per row (8, 10, or 16) and the number of data bytes per column (1, 2, or 4).

Saves the data to a file.

See also

Symbols in the Receive List

Data Types


Table of Shortcut Keys

The following table lists the shortcut key combinations that are predefined in the PCAN-Explorer user interface:

Command alias | Shortcut Key | Description
ActivateConnectionsWindow | [Alt+5] | Activates the Connections window.
ActivateLibraryBrowser | [Alt+2] | Activates the Library Browser.
ActivateMacroStatus | [Alt+7] | Activates the Standard Macro status window.
ActivateOutputWindow | [Alt+3] | Activates the Output window.
ActivateProjectManager | [Alt+1] | Activates the Project Manager.
ActivateTimeoutsWindow | [Alt+6] | Activates the Timeouts window.
ActivateToolsWindow | [Alt+8] | Activates the Tools window.
ActivateWatchWindow | [Alt+4] | Activates the Watch window.
AddExistingItem | [Shift+Alt+A] | Adds am existing item to the project.
AddNewItem | [Shift+Ctrl+A] | Adds a new item to the project.
ClearAll | [Shift+Esc] | Erases the contents of a window.
Copy | [Ctrl+C] | Copies the selection to the clipboard.
Cut | [Ctrl+X] | Cuts the selection and puts it on the clipboard.
Delete | [Del] | Deletes the selection.
FileExport | [Ctrl+E] | Exports the currently active document.
FileImport | [Ctrl+I] | Imports data into the active window or document.
FileNew | [Ctrl+N] | Creates a new file.
FileOpen | [Ctrl+O] | Opens a file.
FilePrint | [Ctrl+P] | Prints a document.
FileSave | [Ctrl+S] | Saves the currently active document.
FileSaveAll | [Shift+Ctrl+S] | Saves all the open files.
Find | [Ctrl+F] | Finds a specified text.
FindNext | [F3] | Finds the next occurrence of a specified text.
FindPrevious | [Shift+F3] | Finds the previous occurrence of the searched text, towards the beginning of the text.
LogTimeouts | [Ctrl+L] | Enables/disables Timeout logging.
MacroRun | [Ctrl+M] | Runs the Macro currently selected in the Macro Drop-down list.
MacroStop | [Shift+Ctrl+M] | Stops a running Macro.
NewMessage | [Ins] | Creates a new transmit message.
Paste | [Ctrl+V] | Inserts the clipboard contents at the insertion point.
ProjectNew | [Shift+Ctrl+N] | Creates a new project.
ProjectSettings | [Alt+F7] | Edits the current project's settings.
Redo | [Ctrl+Y] | Redoes the previously undone action.
ResetHardware | [\] | Resets connected CAN-hardware, erases the Receive list, and resets the counter readings in the transmit lists.
SelectAll | [Ctrl+A] | Selects the entire document.
Send | [SPACE] | Sends the selected transmit messages.
ShowProperties | [Alt+Enter] | Edits the current selection's properties.
ShowReceiveTransmit | [Ctrl+R] | Shows the Receive/Transmit window
ToggleFullScreen | [F11] | Shows the currently active window in full screen mode or resets the window state to normal.
ToggleMessagePaused | [Pause] | Pauses or resumes all selected periodic transmit messages.
TracePlay | [F5] | Starts playback of recorded CAN messages in the active Tracer.
TracePlayAll | [Shift+F5] | Starts playback of recorded CAN messages in all open Tracers.
TraceStart | [F9] | Starts recording of CAN messages in the active Tracer.
TraceStartAll | [Ctrl+T] | Starts recording of CAN messages in all open Tracers.
TraceStop | [F6] | Stops recording of CAN messages in the active Tracer.
TraceStopAll | [Ctrl+Alt+T] | Stops recording of CAN messages in all open Tracers.
Undo | [Ctrl+Z] | Undoes the last action.
XmtLoadSendSymbols | [Ctrl+Ins] | Loads all Send Symbols into the active Transmit list.

See also

Customizing Key Combinations

Using Key Combinations

Keyboard, Options Dialog Box

PCAN-Explorer Commands


Keyboard Map Window

The Keyboard Map window represents a list of all commands that are available in PCAN-Explorer, and displays the Shortcut Key combinations that are assigned to the individual commands. To show the Keyboard Map window, select the Keyboard Map command from the Help menu.

Using the drop-down list at the top of the window, you can select a command category that you want to display:

Bound commands

Shows only those commands that have a Shortcut Key mapped to.

All commands

Displays all available commands in PCAN-Explorer.

Macros

Shows commands that are defined by loaded VBScript Macros.

Add-ins

Shows commands that are implemented by loaded Add-ins.

Copies the data of the selected commands as text into the clipboard. If the whole contents of the list shall be copied, all commands can be selected at once by using the shortcut key [Ctrl+A].

Shows the help for the Keyboard Map window.

Command List

The command list displays all commands in the selected category. It can be sorted in various ways by clicking on the column captions. It is possible to toggle between an ascending and descending sort order.

Command

The name of the command, which is dependent of the application's user interface language.

Alias

The internal name of the command, which is independent of the application's user interface language.

Key

The currently assigned Shortcut Key combination

Description

A description of the command

See also

Using Shortcut Keys

Customizing Shortcut Keys

User Interface


Tracer Elements

This section contains information about dialog boxes and other elements that are related to the tracer.

In This Section

Trace Window

Displays recorded CAN messages in tabular form.

Related Sections

Recording CAN Messages

Contains topics about using the tracer.

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Trace Window

The Trace window represents a view window to a data buffer of recorded CAN messages. Several Trace windows can be opened and operate at the same time, which can use filters to record different messages.

Toolbar

The Trace window contains a toolbar at the top, with which you can control the operation of the Tracer.

Button | Command | Description
 | Trace Start | Starts tracing of CAN messages in this Tracer.
 | Trace Pause | Pauses tracing of CAN messages in this Tracer.
 | Trace Stop | Stops tracing of CAN messages in this Tracer.
 | Trace Playback | Starts playback of CAN messages in this Tracer.
 | Trace Repeat | If enabled, playback of CAN messages restarts from the beginning when the end of the Trace file is reached.

Filter

The Filter drop-down list allows to select a message filter for the Tracer. If you select a filter, only those message are recorded by the Tracer that pass through the filter. The drop-down list contains all message filters in the current project (see Project Manager, Message Filters node on the Project Items tab). If the selected filter is disabled, all received messages will pass through the filter.

Symbol | Description
 | No filter is selected.
 | An enabled message filter.
 | A disabled message filter.

The buttons next to the drop-down list have the following meaning:

Button

Description

Edits the selected filter, opens the Edit Filter dialog box.

Adds a new message filter to the current project and shows the Edit Filter dialog box.

Either applies the selected message filter to the trace or opens a selection list with various predefined filter functions to filter the contents. The result is displayed in a new Tracer window. This action is available only when the message recording was paused or stopped.

Applying a filter always creates a new trace in the main memory, so you should be careful when filtering large trace files. You may want to split the trace file to be filtered into several smaller files beforehand. A tool for splitting trace files can be downloaded from our website under Support/Downloads: PEAK-Trace Splitter.

Columns in the Trace View

Time

This column displays the timestamps of the CAN messages. Depending on the selected timestamp format, the timestamps are displayed either relative, absolute, or differential. To change the timestamp format, press the second mouse button on the column header and select the desired option. See also Tracer, Project Settings Dialog Box, Timestamp setting.

Bus

Indicates the bus number of the connection to which each message belongs.

ID / Symbol

This column displays the CAN IDs of the messages. If a Symbols file is loaded for a connection, this column also shows the names of the symbols, if compatible symbols have been defined for the CAN messages. CAN IDs can be displayed either in hexadecimal or in decimal notation. To change the CAN ID format, press the second mouse button on the column header and select the desired option.

Rx/Tx

Indicates the transfer direction:

  • Rx: The CAN message was received.

  • Tx: The CAN message was transmitted.

Type

This column displays the types of the recorded messages:

  • Data: Data Frame.

  • FD: CAN FD Data Frame (0-64 data bytes).

  • FD, BRS: CAN FD Data Frame with enabled Bit Rate Switch (data byte transfer with higher bit rate).

  • FD, ESI: CAN FD Data Frame with Error State Indicator.

  • FD, BRS, ESI: CAN FD Data Frame with enabled Bit Rate Switch (data byte transfer with higher bit rate) and Error State Indicator.

  • RTR: Remote Transmission Request.

  • Status: A hardware status.

  • Error: An Error Frame was detected on the bus.

  • Err.Cnt: Indicates changes of receive or transmit error counter values in the CAN controller.

DLC / Length

This column displays either the Data Length Codes or the number of data bytes of the recorded messages. To change between DLC and Data Length display, press the second mouse button on the column header and select the desired option.

Data

Displays the data bytes of the recorded messages. You can change between hexadecimal, decimal, and ASCII representation. Press the second mouse button on the column header and select the desired option.

If the message is an Error Frame, this column contains additional information about the Error Frame. RxErr and TxErr values show the contents of the receive and transmit error counter registers of the CAN controller.

J1939-specific Columns

J1939-specific columns are displayed if the active project contains connections that use the J1939 protocol. If a filter is selected for the tracer that is configured to block messages from J1939 connections, the J1939-specific columns are not shown.

Prio

Shows the priority of the J1939 message.

PGN

The Parameter Group Number of the message. You can change between hexadecimal and decimal representation. Press the second mouse button on the column header and select the desired option.

SA

The Source Address, which was specified by the originator of the message. You can change between hexadecimal and decimal representation. Press the second mouse button on the column header and select the desired option.

DA

The Destination Address, which was specified by the originator of the message. You can change between hexadecimal and decimal representation. Press the second mouse button on the column header and select the desired option.

When a recording is started and a new Trace window is opened, a data buffer is created in the background according to the settings in the Options dialog box. This can take a moment, depending on the size of the buffer. After the buffer has been created, the recording of CAN messages starts immediately.

A Trace window can also show Timeouts, if a Symbols file is loaded for a connection. When a Timeout is detected for a message, the message is shown by default using a red text color. The text and background colors for indicating Timeouts can be changed in the Options dialog box.

Status bar

The status bar indicators of the Trace window show the following information, from left to right:

State of operation

Gives information whether the tracer is stopped, started, paused etc.

Buffer type

Indicates, whether the data buffer is configured as a linear buffer, ring buffer, dynamic buffer, or as a file. See Tracer, Project Settings Dialog Box, Buffer Type setting.

Recording duration

Duration between the start of the recording and the time of the latest recorded message.

Filling level

The current filling level of the buffer in Percent (only for buffer types Linear and Ring).

Rx

The number of received messages.

Tx

The number of transmitted messages.

Status

The number of hardware status changes.

Errors

The number of Error Frames.

File Overwrite Warning

If a Tracer is opened that uses the File buffer type and already contains recorded data, a warning message may be displayed below the toolbar which warns against unintentional overwriting of the file. Executing the Start command for the Tracer will write new data immediately into the currently opened file and overwrite a previous recording, in contrary to the buffer types Dynamic, Linear, and Ring, which record data into memory first.

You can hide the warning message for the runtime of the program by clicking on [image]. To hide the warning permanently, either click the right mouse button on the message and choose Disable warning permanently, or disable the option Show file overwrite warning for Tracers using the File buffer type in the Options dialog box, see Trace Window, Options Dialog Box.

See also

Recording CAN Messages

Tracer, Project Settings Dialog Box

Tracer, Options Dialog Box

Trace Window, Options Dialog Box

Fonts and Colors, Options Dialog Box


Other Elements of the User Interface

This section of the online help describes elements of the user interface that do not fit into any of the other categories.

In This Section

Callback Library Window

Configures the execution of functions from external function libraries for different events.

Line Writer

Describes the PCAN-Explorer line writer, which is a simple 4-channel data plotter.

Related Sections

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.


Callback Library Window

With the help of the Callback Library window you can assign functions from external function libraries (DLLs) to different events, so that they are called when the events occur. In this way, for example, you can evaluate or modify data of CAN messages.

To show the Callback Library window, select a Callback Library of your project on the Project Files tab in the Project Manager, and then choose the Open command from the context menu.

The following information is shown in the Callback Library window:

DLL Information

Shows various information about the DLL, like the file version and different values from the version information resource of the file, time and date of the last change, and the number of exported DLL functions.

Enable Callback Functions

Only if this option is activated will the assigned functions be called when the various events occur.

General Tab

Here all events are listed that are related to the Callback Library itself. In the DLL Function column you can open a drop-down list to assign a DLL function to each event. The drop-down list offers all functions for selection that are exported from the Callback Library.

On Enable

Occurs when the Callback Library is being enabled.

On Disable

Occurs when the Callback Library is being disabled.

Transmit Tab

Here all events are listed that can be triggered in relation with transmitted messages. In the DLL Function column you can open a drop-down list to assign a DLL function to each event. The drop-down list offers all functions for selection that are exported from the Callback Library.

On Before Transmit

Occurs before a message is transmitted.

On After Transmit

Occurs after a message has been transmitted.

On Resume

Occurs when the periodic transmission of a message is being resumed.

On Pause

Occurs when the periodic transmission of a message is halted.

On Reset

Occurs for every Transmit message when the Reset command has been executed for a connection.

Receive Tab

Here all events are listed that can be triggered in relation with received messages. In the DLL Function column you can open a drop-down list to assign a DLL function to each event. The drop-down list offers all functions for selection that are exported from the Callback Library.

On Receive

Occurs after a message has been received.

On Timing Error

Occurs when a timing error has been detected for a received message.

Attention

The drop-down lists offer all exported DLL functions to choose from, independent of whether the individual function has the correct format. When selecting a function, make sure it has the correct calling convention and function parameter and returns the appropriate value. The calling of inappropriate functions can lead to unpredictable errors, in the worst case the program could crash.

See also

User Interface


Line Writer

The Line Writer Add-in allows the visual representation of the temporal course of up to 4 signals. This Add-in is enclosed by default and cannot be acquired separately.

You can show a new Line Writer window by selecting Line Writer from the Tools menu and then selecting Show.

Toolbar

(Select channel)

Selects the channel that is shown in the left scale.

(Clear)

Clears a signal assignment from the selected channel.

(Select signal)

Displays a list of signals that can be assigned to the selected channel.

(Properties)

Displays the Line Writer properties dialog box.

(Start)

Starts a recording.

(Stop)

Stops a recording.

(Zoom level)

Shows the currently selected zoom level of the Y-axis.

Drawing area

(Channel activate/deactivate)

Activates or deactivates individual channels.

(Move Y-axis up)

Moves the visible area of the Y-axis upwards.

(Zoom in)

Increases the zoom level of the Y-axis.

(Reset Y-axis)

Resets the zoom level and the moving of the Y-axis.

(Zoom out)

Decreases the zoom level of the Y-axis.

(Move Y-axis down)

Moves the visible area of the Y-axis downwards.


PCAN-Explorer Reference

Commands

PCAN-Explorer Commands

Home Page (Reference)

PCAN-Explorer commands allow a direct interaction with the user interface via Shortcut Key combinations or via VBScript Macros.

A list of all commands and their currently assigned shortcut keys can be found in the Keyboard Map window.

Command Alias

Each command has a name, which is also displayed in the various menus of the user interface. The alias on the other hand is the internal name of the command, which is independent of the application's display language.

Commands

The following list contains all Commands that are pre-defined in PCAN-Explorer:

Command Name | Command Alias | Description
Connections | ActivateConnectionsWindow | Activates the Connections window.
Library Browser | ActivateLibraryBrowser | Activates the Library Browser.
Macro status | ActivateMacroStatus | Activates the Standard Macro status window.
Output | ActivateOutputWindow | Activates the Output window.
Project Manager | ActivateProjectManager | Activates the Project Manager.
Timing Errors | ActivateTimingWindow | Activates the Timing Errors window.
Tools | ActivateToolsWindow | Activates the Tools window.
Watch | ActivateWatchWindow | Activates the watch window.
Add Connection | AddConnection | Adds a new connection to the current project.
Add Existing Item | AddExistingItem | Adds an existing item to the current project.
Add-in Manager | AddInManager | Shows the Add-in Manager dialog box.
Add Message Filter | AddMessageFilter | Adds a new message filter to the current project.
Add New Item | AddNewItem | Adds a new item to the current project.
Exit | ApplicationExit | Ends the program.
Cancel Full Screen | CancelFullScreen | Cancels the Full Screen mode.
Claim Address | ClaimAddress | Claims a J1939 address.
Clear All | ClearAll | Erases the contents of a window.
Comment Selection | Comment | Comments out the current text selection.
Copy | Copy | Copies the selected elements to the clipboard.
Cut | Cut | Cuts the selected elements out and copies them to the clipboard.
Delete | Delete | Deletes the selected elements.
Edit message | EditMessage | Shows the Edit Message dialog box.
Edit variables | EditVariables | Shows the Edit Variables dialog box.
Edit with Symbol Editor | EditWithSymbolEditor | Opens the Symbols file in the active text window with the PCAN Symbol Editor.
External Tools | ExternalTools | Customizes the Tools menu, shows the External Tools dialog box.
Apply | FileApply | Checks the source code in the active text window for errors and applies the modifications.
Close | FileClose | Closes the active window or document.
Close All But This | FileCloseAllButThis | Closes all windows but the active one.
Export | FileExport | Exports the active document to another file format.
Import | FileImport | Imports data into the active window or document.
New | FileNew | Creates a new document.
Open | FileOpen | Opens a file.
Print | FilePrint | Prints a document.
Save | FileSave | Saves the active document.
Save All | FileSaveAll | Saves all the open files.
Save As | FileSaveAs | Saves the active document under a different name.
Find | Find | Searches for text.
Find Next | FindNext | Finds the next occurrence of the searched text.
Find Previous | FindPrevious | Finds the previous occurrence of the searched text, towards the beginning of the text.
About | HelpAbout | Shows the About dialog box.
Help Contents | HelpContents | Shows the table of contents for the PCAN-Explorer documentation.
Help Index | HelpIndex | Show the index of the PCAN-Explorer documentation.
Keyboard Map | HelpKeyboard | Shows a table of all PCAN-Explorer commands and the assigned Shortcut Key combinations.
Help Search | HelpSearch | Searches the PCAN-Explorer documentation.
Home | Home | Moves the cursor to either the start of the current line or the start of the text on that line.
Home Extend | HomeExtend | Extends the selection to either the start of the current line or the start of the text on that line
Import Transmit List | ImportTransmitList | Imports a Transmit list file into the active Transmit list.
Increase Line Indent | Indent | Increases the line indent of the text selection.
Inspect Variables | InspectVariables | Opens a dialog box to inspect Variables.
License Information | LicenseInfo | Displays a dialog box containing detailed License information.
Log Timing Errors | LogTimingErrors | Enables or disables Timing error logging.
Macro | Macro | Shows the Macro dialog box.
Add Macro | MacroAdd | Adds a new Macro.
Edit Macro | MacroEdit | Edits the selected Macro.
Reload Macro File | MacroReloadFile | Reloads the Macro file that is currently open in the text editor.
Run Macro | MacroRun | Runs the Macro currently selected in the Macro Drop-down list.
Stop Macro | MacroStop | Ends the running Macro.
Make Lowercase | MakeLowercase | Makes the selected text lowercase.
Make Uppercase | MakeUppercase | Makes the selected text uppercase.
Maximize Receive List | MaximizeReceiveList | Maximizes the Receive List in the Receive/Transmit window.
Maximize Transmit List | MaximizeTransmitList | Maximizes the Transmit List in the Receive/Transmit window.
New message | NewMessage | Creates a new transmit message, shows the Edit Message dialog box.
Paste | Paste | Pastes in the clipboard's contents at the cursor position.
Pause all | PauseAllMessages | Pauses all periodic transmit messages in the active Transmit list.
Close Project | ProjectClose | Closes the current project.
New Project | ProjectNew | Creates a new project.
Open Project | ProjectOpen | Opens an existing project.
Save Project | ProjectSave | Saves the current project.
Save Project As | ProjectSaveAs | Saves the current project under a new name.
Settings | ProjectSettings | Edits the current project's settings, shows the Project Settings dialog box.
Redo | Redo | Restores an input, which has been undone before.
Release Address | ReleaseAddress | Releases a previously claimed J1939 address.
Reset all Counters | ResetAllCounters | Resets the counters of all transmit messages.
Reset Counter | ResetCounter | Resets the counters of the selected transmit messages.
Reset | ResetHardware | Resets connected CAN-hardware, erases the Receive list, and resets the counter readings in the transmit lists.
Restore Message Lists | RestoreMessageLists | Makes sure that both the Receive List and the Transmit List are visible in the Receive/Transmit window.
Resume all | ResumeAllMessages | Resumes all paused periodic transmit messages in the active Transmit list.
Select All | SelectAll | Selects the whole contents of a document.
Send | Send | Sends the selected transmit messages.
Properties | ShowProperties | Shows the Properties window.
Receive/Transmit | ShowReceiveTransmit | Shows the Receive/Transmit window.
Start Page | ShowStartPage | Shows the Start Page window.
Connections | ToggleConnectionsWindow | Shows or hides the Connections window.
Full Screen | ToggleFullScreen | Activates and deactivates the full screen mode for the active window.
Library | ToggleLibraryBrowser | Shows or hides the Library Browser.
Macro Status Window | ToggleMacroStatusWindow | Shows or hides the Macro Status window.
Pause / Resume | ToggleMessagePaused | Pauses or resumes all selected periodic transmit messages.
Toggle Output Window | ToggleOutputWindow | Shows or hides the Output window.
Toggle Project Manager | ToggleProjectManager | Shows or hides the Project Manager.
Toggle Timing Errors Window | ToggleTimingWindow | Shows or hides the Timing Errors window.
Toggle Watch Window | ToggleWatchWindow | Shows or hides the Watch window.
Customize | ToolsCustomize | Customizes Toolbar settings, shows the Customize dialog box.
Options | ToolsOptions | Shows the Options dialog box.
Pause All Tracers | TracePauseAll | Pauses the recording of CAN messages in all open Tracers.
Start All Tracers | TraceStartAll | Starts the recording of CAN messages in all open Tracers.
Start New Tracer | TraceStartNew | Creates a new Tracer window and starts tracing of CAN messages.
Stop All Tracers | TraceStopAll | Stops the recording of CAN messages in all open Tracers.
Uncomment Selection | Uncomment | Removes leading comment characters from the current text selection.
Undo | Undo | Undoes the last input.
Decrease Line Indent | Unindent | Decreases the line indent of the text selection.
 | UserTool1..16 | Invokes a user-defined Tool.
VBS Macro Manager | VBSMacroManager | Opens the VBS Macro Manager dialog box.
Cascade | WindowCascade | Arranges the windows as overlapping tiles.
Close | WindowClose | Closes a window.
Close All Documents | WindowCloseAllDocuments | Closes all open documents.
Dockable | WindowDockable | Makes the window a dockable tool window.
Floating | WindowFloating | Makes the window a floating tool window, unable to be docked.
Hide | WindowHide | Hides a tool window.
Maximize | WindowMaximize | Maximizes a window.
Next | WindowNext | Activates the next document window on the tab bar.
Previous | WindowPrevious | Activates the previous document window on the tab bar.
Restore | WindowRestore | Restores a window to its non-maximized state.
Tabbed Window | WindowTabbed | Makes the window a tabbed window.
Tile Horizontally | WindowTileHorizontal | Arranges the windows as horizontal, nonoverlapping tiles.
Tile Vertically | WindowTileVertical | Arranges the windows as vertical, nonoverlapping tiles.
Load all Send Symbols | XmtLoadSendSymbols | Loads all Send Symbols into the active Transmit list.


Apply Command

Checks the active source code for errors and applies the modifications.

Icon

Menu

File | Apply

Keyboard Shortcut

None.

Remarks

The Apply command can be used in connection with the following file types:

  • Symbols Files

If the Apply command is executed for a Symbols File, the Symbols File is parsed and checked for errors. If the file contains no errors, it is activated by assigning it to one or more connections in the project. A Symbols file must be part of the current project before it can be activated. If the file has not been included in the current project, a dialog box is displayed.

If the file contained errors, a corresponding error message is shown in the Output window, and the relevant position is highlighted in the source code.

  • Standard Macros

If the Apply command is executed for a Standard Macro file, the source code of the macro is compiled and checked for errors. If the compilation is successful, the macro is included into the Macro drop-down list on the toolbar, and can be started now.

If the filed contained errors, a corresponding error message is shown in the Output window, and the relevant position is highlighted in the source code.

  • VBScript Macros

If the Apply command is executed for a VBScript Macro file, the source code of the macro is parsed and checked for errors. If the file contains no errors, all macro procedures in the file are included into the Macro drop-down list on the toolbar.

If the file contained errors, a corresponding error message is shown.

Note

If the Apply command is executed for a file, the file will be automatically saved by default. This auto-save function can be controlled in the Options dialog box, on the Documents page.

See Also

Creating and Activating Symbol Files

PCAN-Explorer Commands


Reset Command

The Reset command carries out the following tasks:

  • Resets one or more connected CAN hardware.

  • Clears the Receive list if the corresponding option is enabled in the Options dialog box on the Receive/Transmit page.

  • Resets all counters and time data in Receive and Transmit lists, if the corresponding options are enabled in the Options dialog box on the Receive/Transmit page.

  • Resets the values of all signals that belong to the affected connections, if the corresponding option is enabled in the Options dialog box on the General page.

Icon

Menu

Connections | Reset

Keyboard Shortcut

The keyboard shortcut for this command depends on the keyboard language. On an English keyboard, the [\] key is assigned to the command. On a German keyboard, the [CIRCUMFLEX] key is assigned to the command, which corresponds to the [^] key. For other keyboard languages, open the Connections menu and read the assigned key from the Reset menu command.

Remarks

Executing the Reset command will reset only those connections that have the Include in Reset property enabled. You can also use the drop-down menu of the Reset button on the toolbar to select which connections should be included when executing the Reset command.

See Also

PCAN-Explorer Commands

Options Dialog Box


Symbols Files

Symbols Files

Home Page (Reference)

Symbols files contain definitions how the data of CAN messages is interpreted, and which symbolic identifiers are displayed in the different windows of PCAN-Explorer in their place.

In This Section

Format and Syntax of Symbols Files

Describes the general rules that have to be considered when creating Symbols files with respect to format and syntax.

Sections of Symbols Files

Describes the different sections of a Symbols file, and explains what data has to be defined in these sections.

Global Parameters

Describes the parameters that affect a complete Symbols file.

FormatVersion Parameter

Describes the meaning of the FormatVersion parameter, which is specified in the head of Symbols files.

Symbols

Describes the definition of symbols and their parameters.

Parameters for Symbol Definitions

Describes the individual parameters that are possible in symbol definitions.

Symbol Types

Describes the different types of symbols.

Signals

Instructions for defining signals.

Variables

Instructions for defining variables.

Data Types

Describes the available data types for signals and variables.

Data Types Float and Double

A description of the data types 'Float' and 'Double' and their usage.

Optional Switches for Signal and Variable Definitions

Describes the optional switches that can be used in signals and variable definitions to control the display format of signal and variable values, for example.

Optional Parameters for Signal and Variable Definitions

A description of optional parameters for signal and variable definitions, like factor, offset, and unit.

Enums

Describes the usage of enumerations (value tables) by defining enums.

Multiplexers

Describes the operating principle of multiplexers and their usage.

Timing

Describes optional parameters that can be used to monitor the timing of symbols and multiplexers.

Picture Parameter: Bit Sequence in Variables

Describes what has to be considered concerning the sequence of variable bits within the data bytes of a CAN message, and explains the Intel and Motorola format of variables.

Picture Parameter: Bit Sequence in Multiplexers

Describes what has to be considered concerning the sequence of multiplexer bits within the data bytes of a CAN message, and explains the Intel and Motorola format of Multiplexers.

Assigning CAN Messages or Macros to Function Keys (Deprecated)

Explains, how function keys can be used to transmit single CAN messages or to start macros.

Further topics

Working with Symbols

Describes the use of Symbols in the PCAN-Explorer user interface.

Working with the Text Editor

Describes the use of the text editor, e.g. to edit Symbols files or VBScript Macros.

Error Messages of Symbols Files

Contains a description of all error messages that can occur during handling of Symbols files.


Format and Syntax of Symbols Files

Symbols files have the file name extension .sym. The following general rules apply at the creation of Symbols files:

  • All characters between a semicolon ';' or a double slash '//' and the end of the line are considered commentary and are thus ignored.

  • Empty rows are permitted and are ignored.

  • All parameters are specified in the format 'Parameter=Value1 Value2 Value3'. The number of values to be specified is variable, values can be separated with empty spaces or tab characters.

  • All signals that are part of the individual CAN messages are defined in the {SIGNALS} section, before any symbol definitions, each with a line
    Sig=SignalName DataType NumberOfBits Options

  • All symbols to represent a message are defined in sections starting with a line
    [SymbolName]
    (message header).

  • The message header is followed by a parameter line in the form
    ID=CAN ID
    associating the symbolic message [SymbolName] with a CAN ID.

  • The message length (the number of data bytes) is defined by a parameter line in the form
    Len=Length
    If this parameter is omitted, a Symbol is defined that is valid for all data lengths.

  • If the symbol shall contain a multiplexer, a multiplexer definition line in the form
    Mux=MultiplexerName StartBit,NumberOfBits Options
    has to follow.

  • For each signal the symbol shall contain, a line
    Sig=SignalName StartBit Options
    has to follow. SignalName references one of the signals from the {SIGNALS} section.

  • Names of symbols, multiplexers, and variables can consist of up to 32 characters. If a name shall contain blanks, the name must be enclosed in double quotes. Names cannot contain points.

The following rules apply to Symbols files using the older format version 5.0 (PCAN-Explorer 5):

  • The message length (the number of data bytes) is defined by a parameter line in the form
    DLC=Length
    If this parameter is omitted, a Symbol is defined that is valid for all data lengths.

  • For each variable the symbol shall contain, a line
    Var=VariableName DataType StartBit,NumberOfBits Options
    has to follow.

The following rules apply to Symbols files using the older format versions 3.1 and 3.0 (PCAN-Explorer 4 and below):

  • If the CAN message contains data bytes, a parameter line in the form
    Picture=BitPattern
    has to follow. If this parameter is omitted, a symbol is defined that is valid for all data lengths, and no other information has to be added to the symbol definition.

  • A line
    Marker=VariableName DataType Options
    has to follow for each bit group that was defined in BitPattern of the Picture parameter. The marker must be one of the characters a to z, A to Z, 0 to 9, %, or &.

  • Names of symbols, multiplexers, and variables can consist of up to 30 characters.

For examples of Symbols files, see

Symbols File Example (FormatVersion 6.0)

or

Symbols File Example (FormatVersion 5.0)

or

Symbols File Example (FormatVersion 3.1)

See also

FormatVersion Parameter

Definition of Signals

Definition of Variables

Data Types

Optional Switches for Signal and Variable Definitions

Options Dialog Box


Sections in Symbols Files

A Symbols file consists of different sections:

ENUMS

Defines enumerations (value tables) that can be used in the following sections for signal and variable definitions.

SIGNALS (FormatVersion 6.0)

Defines all signals that are referenced from symbol definitions in the following sections {SEND}, {RECEIVE} and {SENDRECEIVE}.

SEND

Defines symbols for messages that are transmitted only. These symbols are never displayed in the Receive list.

RECEIVE

Defines symbols for CAN messages that are received only. When you create a new transmit message, you cannot select one of these symbols as a template for the transmit message.

SENDRECEIVE

Defines symbols for CAN messages that are transmitted and received (bidirectional symbols).

VIRTUALVARS (FormatVersion 5.0)

Defines virtual variables, which are not part of CAN messages.

Older Formats (3.0, 3.1, see FormatVersion parameter) of Symbols files allow the following further sections:

MESSAGEKEYS

Assigns transmit messages to function keys.

MACROKEYS

Assigns macros to function keys.

To mark the beginning of a section, enter a line into the Symbols file as follows:

{Section identifier}

A section continues until a new section is defined. Symbols that are defined before the first position of a section marker are considered bidirectional Symbols.

See also

FormatVersion Parameter

Symbols

Enums

Assigning CAN Messages or Macros to Function Keys


Global Parameters

Global parameters are entered at the beginning of a Symbols file.

The following global parameters are supported:

  • DecimalSeparator

  • FloatDecimalPlaces

  • FormatVersion

  • IDMask

  • MuxChar

  • Title

  • UniqueVariables

DecimalSeparator

Determines the decimal separator character that is expected when specifying floating point values in the Symbols file.

Valid decimal separator characters are comma or point.

If this parameter is omitted, the decimal separator that must be used is determined by the number format settings of the Windows Control Panel.

This parameter is only supported by Symbols files that use FormatVersion 3.1 or older.

Example

FormatVersion=3.1

DecimalSeparator=,

[MySymbol]

ID=100h

DLC=3

Picture=aaaaaaaa --------

a=MyVariable signed /f:0,5

FloatDecimalPlaces

This parameter controls the number of decimal places displayed for all variables defined in the Symbols file. The parameter overrides the Decimal Places setting in the Options dialog box.

Similarly, the number of decimal places displayed can be controlled separately for each variable. See Optional Parameters of Variable Definitions, Parameter /p.

Example

FormatVersion=6.0

FloatDecimalPlaces=3

{SIGNALS}

Sig=SignalA float

Sig=SignalB float /p:1

{SENDRECEIVE}

[MySymbol]

ID=100h

Len=8

Sig=SignalA 0

Sig=SignalB 32

In this example, VariableA is displayed with 3 decimal places, and VariableB is displayed with one decimal place.

FormatVersion

See topic FormatVersion Parameter.

IDMask

Specifies a mask for all CAN IDs in the Symbols file. A mask qualifies, which of the corresponding bits of a CAN ID are 'relevant' or 'don't care'. If PCAN-Explorer determines which Symbol matches a particular message, only those bits of the CAN ID are taken into account that have in the mask at the corresponding bit position a 1.

Example

FormatVersion=5.0

IDMask=FF00h

[MySymbol]

ID=1234h

DLC=2

Var=MyVariable unsigned 0,16

In this example, only bits 8-15 of a CAN ID are relevant to determine a matching Symbol. The result is that all messages with CAN IDs in the range 1200h to 12FFh are decoded as "MySymbol".

MuxChar

This parameter determines the placeholder character that is used in the Picture parameter to identify Multiplexer bits. The following Multiplexer marker characters are allowed:

# % & ( ) * + ? @, a-z, A-Z.

If this parameter is omitted, the default Multiplexer marker is '*'.

The MuxChar parameter is only supported by Symbols files that use FormatVersion 3.1 or older.

Example

FormatVersion=3.1

MuxChar=X

[MySymbol]

ID=100h

Picture=XXXXXXXX aaaaaaaa bbbbbbbb

X=MyMultiplexer 1

a=VariableA unsigned

b=VariableB unsigned

Title

Specifies a title for the Symbols file. If the Symbols file is in use by a connection, the title is displayed in the Project Manager under the Active Symbols node. If this parameter is omitted, the title of a Symbols file defaults to the name of the file without the file extension.

This parameter is only supported by Symbols files that use FormatVersion 5.0 or newer

UniqueVariables

Determines, whether variable names can be assigned to multiple variables within the same Symbols file.

Variable names must be unique within a symbol definition. However, in different symbol definitions a variable name can be used repeatedly. If the UniqueVariables parameter is included in the Symbols file with the value True, a variable name may be used only once in the whole Symbols file.

The default parameter value is False.

Example

FormatVersion=5.0

UniqueVariables=True

[Symbol1]

ID=100h

DLC=2

Var=MyVariable unsigned 0,16

[Symbol2]

ID=200h

DLC=2

Var=MyVariable signed 8,8

In this example, the definition of "MyVariable" in Symbol2 creates error code 62: "Variable name already in use".

See also

FormatVersion Parameter


FormatVersion Parameter

The FormatVersion parameter in the head of a Symbols file determines the version of the file format. This version number determines the syntax to be fulfilled, and the allowed and supported keywords. If no FormatVersion parameter is specified, the current file format 6.0 is automatically valid. It is strongly recommended to always specify a format version in the file header.

FormatVersion 3.0 and older

Up to PCAN-Explorer 3.0.2 the following restrictions were valid in Symbols files:

  • Multiplexer and Variable bit groups using the Motorola format had to be aligned to the edges of the data bytes.

  • The format declaration -m in the multiplexer definition determined how each of the specified multiplexer values were to be interpreted in Intel or Motorola format. In this case the values could be indicated differently for several multiplexers of a symbol.

FormatVersion 3.1

From PCAN-Explorer version 3.0.3 up to version 4.0, the version of the file format was 3.1. The following changes are valid as of this version compared to format version 3.0:

  • Multiplexers and Variables that are not aligned to the edges of data bytes can also use the Motorola format.

  • The format declaration -m in the Multiplexer definition determines the byte sequence of the Multiplexer in the data bytes. Each Multiplexer of a Symbol must be defined with the same format declaration -m.

FormatVersion 5.0

PCAN-Explorer 5 introduced file format 5.0. The following changes are valid in this version:

  • The Picture parameter is no longer allowed.

  • New Keywords "Type", "DLC", "Mux", "Var".

  • New section {VIRTUALVARS} to define virtual variables.

  • Sections {MESSAGEKEYS} and {MACROKEYS} no longer allowed.

  • The "Period" keyword has been replaced by "CycleTime", but the old keyword is still recognized and can be used.

  • Global parameter "MuxChar" no longer required.

  • Global parameter "DecimalSeparator" no longer allowed, the decimal separator is always a point.

FormatVersion 6.0

PCAN-Explorer 6 introduces file format 6.0. The following changes are valid in this version:

  • New section {SIGNALS} to define all signals that are used in later symbol definitions.

  • Section {VIRTUALVARS} no longer allowed.

  • New parameter "Len" which replaces "DLC", but the old parameter is still recognized and can be used.

  • New symbol types "FDStandard" and "FDExtended".

  • As a counterpart to Timeouts, smallest permitted time intervals can be defined for symbols and multiplexers with the "MinInterval" parameter.

Compatibility with Symbols files of PCAN-Explorer 3 or older

To use older Symbols files that did not explicitly specify a format version, the version number can be set manually to "3.1" or "3.0" using the FormatVersion parameter. Setting the version to "3.0" forces a compatibility with the old syntax so that all Multiplexer and Variable bit groups using the Motorola format must be aligned to the edges of the data bytes. Setting the version to "3.1" allows - compared to version 5.0 or newer - the use of the Picture parameter, and the use of the {MESSAGEKEYS} and {MACROKEYS} sections.

See also

Picture Parameter: Bit Sequence in Multiplexers

Symbols File Example (FormatVersion 6.0)

Symbols File Example (FormatVersion 5.0)

Symbols File Example (FormatVersion 3.1)


Symbols

Symbols are the topmost level of the definitions to be met. They assign a symbolic identifier to one or several CAN ID's. This Symbol is then displayed instead of the CAN ID in the different windows of PCAN-Explorer.

A Symbol definition consists of at least two lines, for example:

Symbols File

[MySymbol]

ID=100h

Here, the Symbol MySymbol is assigned to CAN ID 100h. If no further declarations are made, the definition applies only to a CAN message with CAN ID 100h, where the Data Length Code is of no importance.

If the Symbol definition is located within the {RECEIVE} section, also a range of CAN ID's can be defined:

Symbols File

{RECEIVE}

[MySymbol]

ID=100h-1FFh

This definition causes the display of the Symbol MySymbol when a CAN message is received whose CAN ID is in the range from 100h to 1FFh. For Symbol definitions that are located within sections {SEND} or {SENDRECEIVE}, it is not allowed to assign a CAN ID range.

After specifying the CAN ID, several more parameters can follow, see Parameters for Symbol Definitions.

See also

Parameters for Symbol Definitions

Symbol Types

Timing

Variables

Multiplexers


Parameters for Symbol Definitions

The following table shows all parameters that can be specified for Symbol and Multiplexer definitions:

Parameter Description Example

Color

Allows to assign a RGB color value to a symbol.

If you assign a color to a symbol, the name of the symbol displayed in the 'Symbol' column of Receive List and Transmit Lists with this font color. In Trace windows, the whole line of a message is displayed with this font color.

The color value is a 24-bit value, whereas LSB = red, and MSB = blue (BBGGRRh).

Color=FF0000h

(corresponds to the color blue)

CycleTime

FormatVersion 5.0 required.

Sets the default transmission period of the symbol, in Milliseconds. When you create a new message in the Transmit List and select a symbol that has a default transmission period, the transmission period of the new message is initialized with this value.

If you specify the additional -p switch after the transmission period, the new transmit message is initially paused.

CycleTime=250

CycleTime=250 -p

DLC

Assigns a data length code to the symbol (0-8 for CAN symbols, 0-1785 for J1939 symbols).

If a value higher than 8 is specified, the type of the symbol must be set to J1939PG.

If no data length is specified for a symbol, the symbol definition is valid for all data lengths.

DLC=6

ID

Assigns a CAN ID to the symbol (0-1FFFFFFFh).

If the specified value is higher than 7FFh or has more than 3 digits, the symbol type is automatically set to Extended.

If the symbol definition is located within the RECEIVE section, also a range of CAN ID's can be defined.

ID=100h

ID=18EFFFF9h

ID=100-1FFh

IgnoreSource

Only available if the J1939PG symbol type is selected. FormatVersion 5.0 or later.

If this option is enabled (default), the source address part in the CAN ID (bits 0..7) is not used to identify the symbol. In this case, for a J1939 symbol only the PGN part of the CAN ID (bits 8..25) is relevant. If a PGN is received from different ECUs on the bus from different source addresses, the signals contained overwrite each other, since signals exist only once and cannot distinguish between source addresses.

If the option is disabled, the bits 0..25 are used to identify the symbol, so that the symbol definition is valid only for a single ECU. Other ECUs with different source addresses require separate symbol definitions, so that the signals from individual ECUs can be clearly kept apart.

The J1939 priority part in the CAN ID (bits 26..28) is never used to identify a J1939 symbol.

IgnoreSource=False

Len

Specifies a data length of a symbol (0-8 for CAN symbols; 0-8, 12, 16, 20, 24, 32, 48, 64 for CAN FD symbols; 0-1785 for J1939 symbols). FormatVersion 6.0 required.

If no data length is specified for a symbol, the symbol definition is valid for all data lengths.

Len=8

MinInterval

Specifies a smallest permitted time interval in which a symbol or multiplexer must be received, in milliseconds. FormatVersion 6.0 required.

See also Timeout parameter.

MinInterval=50

Multipacket

Only available if the J1939PG symbol type is selected. FormatVersion 5.0 required.

Determines whether the J1939 parameter group utilizes the J1939 transport protocol to transfer messages that are longer than 8 bytes.

If you define a J1939 symbol that has a DLC higher than 8, the Multipacket parameter is automatically set to True.

Multipacket=True

Mux

Defines a multiplexer for the symbol. See Multiplexers. FormatVersion 5.0 required.

Mux=MyMux 0,8 5

Period

Sets the default transmission period of the symbol. This parameter was replaced by the parameter CycleTime starting with FormatVersion 5.0.

Period=250

Period=250 -p

Picture

Specifies the layout of variables and multiplexer in the data bytes of a symbol. Only FormatVersion 3.1 or older.

See Picture Parameter: Bit Sequence in Variables and Picture Parameter: Bit Sequence in Multiplexers for more information.

Picture=aaaaaaaa bbbbbbbb

Timeout

Specifies a timeout time for a symbol or multiplexer, in milliseconds.

If the time interval between the last two receptions of the symbol/multiplexer exceeds the defined timeout, this will be indicated in the Receive List. Optionally, time stamps of timeouts can be recorded (see Timing page on the Project Settings dialog box).

For further information, see Timing.

Timeout=500

Type

Determines the type of the symbol. See Symbol Types.

Type=Extended

Var

Defines a variable for the symbol. See Variables. FormatVersion 5.0 required.

Var=MyVar unsigned 8,16

See also

FormatVersion Parameter


Symbol Types

Beginning with FormatVersion 5.0, Symbols files support a new 'Type' keyword to define the type of Symbols.

The following Symbol Types are available:

Type | Description
Standard | Standard 11-bit CAN message (the default).
Extended | Extended 29-bit CAN message according to CAN protocol 2.0B.
J1939PG | J1939 Parameter Group.
FDStandard | 11-bit CAN FD message (FormatVersion 6.0 or newer)
FDExtended | 29-bit CAN FD message (FormatVersion 6.0 or newer)

Standard

The following example defines a Symbol that has an 11-bit CAN-ID:

Symbols File

[Demo]
ID=123h

Type=Standard

Extended

The following example defines a Symbol that has a 29-bit CAN-ID:

Symbols File

[Demo]
ID=123h

Type=Extended

which is the same as

Symbols File

[Demo]
ID=00000123h

J1939PG

The following example defines a Symbol that represents a J1939 Parameter Group:

Symbols File

[Demo]
ID=123h

Type=J1939PG

Symbols that are J1939 Parameter Groups always have 29-bit CAN-IDs, and can have a maximum Data Length of 1785. For example, you could define a message that has 20 data bytes:

Symbols File (FormatVersion 6.0)

[Demo]
ID=123h

Type=J1939PG

Len=20

Such a message is always transmitted over the CAN bus using the J1939 Transport Protocol.

If the Parameter Group has a dynamic length with a default data length of 8, but supports Packetization using the J1939 Transport Protocol, the new 'Multipacket' keyword can be used to explicitly allow transmitting of large messages:

Symbols File (FormatVersion 6.0)

[Demo]
ID=123h

Type=J1939PG

Multipacket=True

Len=8

If you insert such a message in the Transmit List, in the Edit Message dialog box you can set the data length of the message to a maximum of 1785 bytes. If the message has more than 8 bytes, it is transmitted using the Transport Protocol, otherwise a single CAN message is sent. If you omit the Multipacket keyword, or set the Multipacket parameter explicitly to False, in the Edit Message dialog box the maximum allowed data length for the message will be 8 bytes.

CAN FD

The following example defines a Symbol for a CAN FD message with 12 data bytes:

Symbols File (FormatVersion 6.0)

[Demo]
ID=123h

Type=FDStandard

Len=12

When a new Transmit message is created in a Transmit List for this Symbol, the Bit Rate Switch flag will automatically be enabled for the CAN FD message. To disable BRS by default for the Symbol, the definition can be extended as follows:

Symbols File (FormatVersion 6.0)

[Demo]
ID=123h

Type=FDStandard

BRS=0

Len=12


Timing

To monitor whether minimum or maximum time intervals are respected during cyclical reception of symbols or multiplexers, corresponding timing parameters can be included in a Symbols file. When the time interval exceeds a specified maximum value or falls below a minimum value, timing error events can be triggered.

If a timing error occurs, the number of timing errors is increased in the Timing Errors column of the Receive List, and the actual period is displayed in red. When logging of timing errors is enabled, the icon [image] is shown in the Timing Errors column. If you click on this icon with the mouse, the Timing Errors window is opened and the displayed list is automatically filtered for the corresponding Symbol/Multiplexer.

To check whether a maximum time interval is respected, specify a Timeout parameter for the Symbol/Multiplexer. To check whether a minimum time interval is respected, specify a MinInterval parameter. You can also combine both parameters. All parameter values are specified in milliseconds.

Timeout and MinInterval parameters are allowed for Symbols and Multiplexers that are defined in the {RECEIVE} and {SENDRECEIVE} sections.

Syntax

To define a timeout, include a Timeout parameter in a Symbol or Multiplexer definition:

Symbols File (FormatVersion 6.0)

[GeneralVehicleInfo]
ID=032h

Timeout=500
Mux=DataSet1 0,8 0Ah
Sig=MotorTemperature 8

To define a smallest permitted time interval, include a MinInterval parameter in a Symbol or Multiplexer definition:

Symbols File (FormatVersion 6.0)

[GeneralVehicleInfo]
ID=032h

MinInterval=100
Mux=DataSet1 0,8 0Ah
Sig=MotorTemperature 8

See also

Timing Errors Window

Timing, Project Settings Dialog Box


Signals

Signals are similar to variables the smallest information unit in a Symbols file. Signals describe physical values initially independent of single bits or bit groups in the CAN messages.

Definition of signals is supported since FormatVersion 6.0. A signal definition includes over variables initially no specification where the information is located within the data bytes of a CAN message.

Signals are defined in a Symbols file in their own section {SIGNALS}, which must be located before any symbols definitions. Only in the symbols definitions signals are assigned to specific CAN messages, and only then the assignment of a specific bit position is made.

Signals that are not assigned to any symbol in the whole Symbols file work under FormatVersion 6.0 in the same way as virtual variables in Symbols files using FormatVersion 5.0.

A signal definition consists at least of the following parameters:

  • Name

  • Data type

The following optional parameters can be specified:

  • Length (number of bits)

  • Optional switches, e.g. display format

  • Factor, offset

  • Physical unit

  • Initial value

  • Minimum, maximum

  • Comment

  • Enum (value table)

Signal definition in a Symbols file

As the Symbols File Example shows, each signal definition in a Symbols file has the following form:

Symbols File (FormatVersion 6.0)

{SIGNALS}

Sig=SignalName Type [NumberOfBits] [ Switches ] [ OptionalParameters ] [//comment]

If the signal name shall contain blanks, set the name in double quotes.

If the NumberOfBits parameter is omitted, the signal length is set depending on the data type to a default value:

Data Type | Number of Bits
Bit | 1
Float | 32
Double | 64
All other | 8

Signal definitions do not include a start bit definition. The start bit of a signal is determined later when the signal is assigned to a symbol. In a symbol definition, signal references are made in the following form:

Symbols File (FormatVersion 6.0)

{SENDRECEIVE}

[SymbolName]

...

Sig=SignalName StartBit [ OptionalParameters ] [//comment]

StartBit is counted beginning with data byte 0, bit 0. The highest bit in a 8 byte CAN messages is bit 63, which is bit 7 of data byte 7. For J1939 multipacket messages, the highest bit is 14279, which is bit 7 of data byte 1784.

OptionalParameters can override parameters specified in the original signal definition, e.g. you can specify a different default value.

Example
Symbols File (FormatVersion 6.0)

{SIGNALS}

Sig=Flag1 bit

Sig=Flag2 bit

Sig=Bits unsigned 3 -b

Sig=Value1 unsigned 8 -h

Sig=Value2 signed 16 -m

{SENDRECEIVE}

[MySymbol]

ID=100h

Len=4

Sig=Flag1 0

Sig=Flag2 1

Sig=Bits 5

Sig=Value1 8

Sig=Value2 16

See also

Data Types

Optional Switches for Signal and Variable Definitions

Optional Parameters for Signal and Variable Definitions


Variables

Variables are the smallest information unit in a CAN message. Variables describe the information content of single bits or bit groups in the data bytes of a CAN message and transform it to an easily understandable form for the user.

A variable definition consists at least of the following parameters:

  • Name

  • Data type

  • Start bit and number of bits

The following optional parameters can be specified:

  • Optional switches, e.g. display format

  • Factor, offset

  • Physical unit

  • Initial value

  • Minimum, maximum

  • Comment

  • Enum (value table)

Beginning with FormatVersion 6.0, signals can be defined instead of variables, which offer some advantages. Signals must be defined only once, but can be assigned to multiple symbols.

Variable definition in a Symbols file

As the Symbols File Example shows, each variable definition in a Symbols file has the following form:

Symbols File (FormatVersion 5.0)

Var=VariableName Type StartBit,NumberOfBits [ Switches ] [ Optional Parameters ] [//comment]

If the variable name shall contain blanks, set the name in double quotes.

StartBit is counted beginning with data byte 0, bit 0. The highest bit in a 8 byte CAN messages is bit 63, which is bit 7 of data byte 7. For J1939 multipacket messages, the highest bit is 14279, which is bit 7 of data byte 1784.

Variable definition in a Symbols file with FormatVersion 3.1 and older

As the Symbols File Example shows, every line 'Picture= ...' contains a map of a message's data bytes, where 8 characters are assigned to each data byte. The first 8 characters correspond to data byte 0, the next 8 characters to data byte 1, etc.

This is an example for a message with 5 data bytes:

Symbols File (FormatVersion 3.1)

Picture=ccc---ba ffff--ed -----ggg -------- hhhh----

Each block of 8 characters represents the 8 bits of a data byte. The first character represents the msb (most significant bit = bit 7, mask 80h), the second character bit 6 (mask 40h), etc.

Different application variables are coded in the data bytes of a message. Each variable occupies a contiguous sequence of bits, so called bit groups. All bits belonging to a specific bit group are marked in the parameter Picture with the "Marker" character of that bit group. Bit groups also may extend over the byte limits. Unused bits must be indicated with '-'. The complete number of given bits determines the number of data bytes of the CAN message, for which the Symbol is defined. Whole byte blocks must always be filled with characters. Valid markers are a to z, A to Z, 0 to 9, %, or &, so that a maximum of 64 variables is possible in one Picture.

In the following lines variable name and variable type are assigned to the marked bit groups. The type of the variable determines the interpretation and the representation of the bit group by PCAN-Explorer.

Such a variable definition must always be done in the following form:

Symbols File (FormatVersion 3.1)

Marker=VariableName Type [ Switches ] [ Optional Parameters ] [//comment]
Note

If an empty Picture parameter is specified without further bit group definitions ("Picture="), the Symbol definition applies to a CAN message with the Data Length Code 0.
Examples
Symbols File (FormatVersion 5.0)

DLC=4

Var=Flag1 bit 0,1

Var=Flag2 bit 1,1

Var=Bits unsigned 5,3 -b

Var=Value1 unsigned 8,8 -h

Var=Value2 signed 16,16 -m
Symbols File (FormatVersion 3.1)

Picture=ccc---ba dddddddd eeeeeeee eeeeeeee

a=Flag1 bit

b=Flag2 bit

c=Bits unsigned -b

d=Value1 unsigned -h

e=Value2 signed -m

See also

Data Types

Optional Switches for Signal and Variable Definitions

Optional Parameters for Signal and Variable Definitions

Picture Parameter: Bit Sequence in Variables


Data Types

The following data types are supported by Variables:

Type | Description | Example
 |  | Bits | Display
Bit | Binary representation of single bits | 1 | 1
Char | A byte as an ASCII character | 00001101 | #13
 |  | 01000011 | 'C'
String | ASCII character string | 01000001 01000010 01000011 | "ABC"
 |  | 01000001 00011111 01000011 | "A.C" Bytes that do not correspond to any visible ASCII character are represented as points.
Signed | 2s complement (2-32 bits) | 11110010 | -14
Unsigned | Integer without sign (1-32 bits) | 11110010 | 242
Float | Floating point according to IEEE754 (32 bits) |  | 1.23
Double | Floating point value with up to 16 significant digits (64 bits) |  | 1.23
Enum | Enumeration (value table). Assignment of strings to one or several signed or unsigned constants. |  | "Value1"
Raw | Raw data. This type can be used for longer data that cannot be interpreted with any other data type. The output is a string containing hexadecimal digits. | 01110001 00110101 10001100 | 71358C

See also

Data Types Float and Double

Optional Switches for Signal and Variable Definitions

Optional Parameters for Signal and Variable Definitions

Enums


Data Types Float and Double

The type Float can be used for the representation of 32-bit floating-point numbers in the IEEE754 format. The 32 bits of a variable of this type must always be aligned with the borders of data bytes.

The type Double can be used for the representation of 64-bit floating-point numbers. A variable of this type takes all 8 data bytes of a CAN message.

The representation of floating-point values in the receive and Transmit List can be set in the Options dialog box on the General page in the Float values section:

Format

This value determines the format of the output value. It can be chosen between fixed-point format (Fixed), Scientific format or the Shortest format, that is possible. As default the fixed-point format is used.

Decimal Places

This value determines the number of shown decimals. The standard value is 1.

Default decimal separator

Determines the decimal Symbol. Following settings are possible:

Auto: The decimal Symbol is determined by the number format set up in Windows. A modification of the decimal Symbol can be carried out in the corresponding dialogs for regional settings of the Control Panel.

Point: The decimal Symbol is a point.

Comma: The decimal Symbol is a comma.

The selected decimal symbol also has to be taken into account when entering floating-point numbers into Symbols files. However, a locally valid, fixed decimal symbol can also be specified directly in the Symbols file. See Direct Value Specification in Symbols Files.

See also

Data Types

General, Options Dialog Box


Optional Switches for Variable Definitions

PCAN-Explorer Reference

Symbols Files

Optional Switches for Signal and Variable Definitions

Optionally, you can also specify various switches for signals and variables, which, for example, control the value's display format. The display format determines how the signal (values) of a symbolic message are displayed in the Receive and Transmit List. Several of the switches can be combined.

Switch | Meaning
-a | (all) The variable is displayed as Name=Value (default setting, only for variable definitions).
-b | (binary) The signal value is displayed binary.
-d | (decimal) The signal value is displayed in decimal (default setting).
-i | (Intel) The data bytes of the signal are interpreted in the Intel format (default setting).
-h | (hexadecimal) The signal value is displayed in hexadecimal.
-m | (Motorola) The data bytes of the signal are interpreted in the Motorola format.
-o | (Off) The variable is not displayed (only for variable definitions).
-s | (Standard) This signal is displayed in the Data column, even if the Data View is collapsed (if the symbol/multiplexer contains more than one signal).
-t | (Trace) If this switch is specified for a signal, a message filter can be used to let only those messages pass through the filter that contain at least one such "marked" signal. This switch can also be applied to symbols/multiplexers. See also the Adjust to marked Symbols Filter Item type in Message Filter settings.
-v | (Value) Only the value of the variable is shown. Since PCAN-Explorer 5, this switch no longer affects how the variable is displayed in the Receive and Transmit lists. It only affects how the Variable is shown in the Trace window and in text files exported from a Tracer (only for variable definitions).
-x | See -h

The default switches for a signal correspond to -i -d (Intel format, decimal value display).

The default switches for a variable correspond to -i -a -d (Intel format, display of VariableName=Value, decimal value display).

See also

Optional Parameters for Signal and Variable Definitions


Optional Parameters for Signal and Variable Definitions

Signals and Variables can be provided with default value, enum, factor, offset, physical unit, and other parameters. The following table shows all possible optional parameters:

Parameter Description Example

/d

(Default value) Initial value for a variable, when a new transmit message is created. The default value is set as physical value (see notes below).

/d:123

/e

(Enum) Value table. Assigns an enum to a variable to display symbolic names for certain numeric variable values.

/e:MyEnum

/f

Factor/multiplier for the conversion of the variable value (see notes below).

At reception: Value is multiplied with the given factor.

At transmission: The specified variable value is divided by the factor.

/f:1.5

/ln

Long Name, FormatVersion 5.0 or newer.

Specifies a long name for the variable, which is not limited to the 32 characters of the variable name. Long Names can have a maximum length of 128 characters.

/ln:"My long name"

/m

(Multiplier) See /f

/m:1.5

/min

(Minimum) Smallest physical value allowed for the variable.

/min:1

/max

(Maximum) Largest physical value allowed for the variable.

/max:100

/o

Offset for the conversion of the variable value (see notes below).

At reception: The given offset is added to the variable.

At transmission: The offset is subtracted from the specified variable value.

/o:2.2

/p

Number of decimal places displayed for the variable value. Has an effect only if the variable contains non-integer values (e.g. by using the data types Float and Double, or by assigning factor/offset parameters).

Specifying this parameter overrides all other specifications of decimal places, e.g. the global parameter FloatDecimalPlaces.

/p:4

/spn

J1939: Suspect Parameter Number. FormatVersion 5.0 or newer.

/spn:2557

/u

Physical unit of the variable.

FormatVersion 3.1: up to 10 characters

FormatVersion 5.0 and newer: up to 16 characters.

/u:mph

/u:"rpm * 100"

Notes:

  • Factor and offset can be defined for a variable to transform a "raw value" into a "physical value". A raw value is the value of a variable as it is transmitted over the CAN bus. The physical value is the value of a physical quantity (e.g. air pressure, speed) that is represented by the variable.

  • On reception, the value of the variable is first multiplied with the factor, then the offset is added:
    Physical value = (Raw value * factor) + offset

  • On transmission, the offset is first subtracted from the entered physical variable value and then divided by the factor:
    Raw value = (Physical value - offset) / factor

  • The physical variable values that are displayed in the various PCAN-Explorer windows are formatted using the output format of floating-point numbers, which can be configured in the Options Dialog box.

  • The following optional parameters cannot be defined for variables of type 'String':
    Factor, offset, minimum, maximum, enum.

See also

Enums

Picture Parameter: Bit Sequence in Variables

Options Dialog Box

FormatVersion Parameter


Picture Parameter: Bit Sequence in Variables

Note

The Picture Parameter is only supported in Symbols files using FormatVersion 3.1 and older.

If variables cover several data bytes, it is important to be able to trace the individual parts of the entire variable.

The bytes of the variable can be arranged in either the Intel or the Motorola format. The byte sequence and the data format respectively are defined for each Variable separately. The default setting is the Intel format. If a variable shall be interpreted in the Motorola format, the display format -m must be indicated in the line with the variable definition.

Intel Format

In the simplest case a Variable of the type "signed" consists of 16 bits, which are aligned to the edges of the data byte:

Symbols File

// Byte 0 Byte 1

// 76543210 76543210

Picture=aaaaaaaa aaaaaaaa
a=Variable signed

For the purpose of calculating the variable value, in the Intel format the bits in data byte 0 are considered LSB (Least Significant Byte) and the bits in data byte 1 as MSB (Most Significant Byte).

It is not quite as simple if the variable is shifted by a few bits:

Symbols File

// Byte 0 Byte 1 Byte 2

// 76543210 76543210 76543210

Picture=aaa----- aaaaaaaa ---aaaaa
a=Variable signed

Here, the variable starts in data byte 0 with bit 5, which is the lsb (least significant bit) of the entire variable. Bit 0 in data byte 1 follows bit 7. The msb (most significant bit) of the entire variable is bit 4 in data byte 2.

Motorola Format

The Motorola format reverses the byte sequence, which means that the data within the least significant data byte of the bit group are the MSB of the entire Variable once they are decoded.

Symbols File

// Byte 0 Byte 1

// 76543210 76543210

Picture=aaaaaaaa aaaaaaaa
a=Variable signed -m

If, for example, a variable of the type "signed" is defined with a length of 16 bits in data bytes 0 and 1, then in Motorola format the bits of data byte 0 are the MSB of the Variable, and the bits in data byte 1 the LSB. Here, the msb is in bit 7 of data byte 0 and the lsb in bit 0 of data byte 1.

If the bit group is shifted by a few bits, the sequence of the bits is sequential in the Picture parameter, unlike the sequence in the Intel format:

Symbols File

// Byte 0 Byte 1 Byte 2

// 76543210 76543210 76543210

Picture=-----aaa aaaaaaaa aaaaa---
a=Variable signed -m

Here, the priorities of the bits are: msb is bit 2 of data byte 0, lsb is bit 3 of data byte 2, therefore continually descending from left to right.

See also

Variables

Optional Switches for Signal and Variable Definitions


Multiplexers

So-called Multiplexers can be defined to enable the use of different data sets in the data bytes of a symbolic message with the same CAN ID. Multiplexers are specially treated bits in the data bytes, its content identifies the meaning of the remaining data bytes.

Multiplexers can have a length of 1 to 64 bits and can be located freely within the data bytes. However, all Multiplexer bits have to be arranged successive.

Syntax

Multiplexers can be defined by using the Mux keyword (FormatVersion 5.0 or higher). The parameters of a Multiplexer definition are: name, position and length (separated by a comma), and the Multiplexer value. Also, optional switches can be specified.

Symbols File (FormatVersion 6.0)

Mux=MultiplexerName StartBit,BitCount MuxValue [Switches] [//comment]

As an example, a message with 5 data bytes is defined. The Multiplexer is located in data byte 0 and its value is defined as 0Ah:

Symbols File (FormatVersion 6.0)

[GeneralVehicleInfo]
ID=032h

Len=5
Mux=DataSet1 0,8 0Ah
Sig=MotorTemperature 8

If the older Symbols file format 3.1 is used, Multiplexers can be defined by using the Multiplexer marker (default: '*') in the Picture parameter of the symbol definition:

Symbols File (FormatVersion 3.1)

[GeneralVehicleInfo]
ID=032h
Picture=******** aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
*=DataSet1 0Ah
a=MotorTemperature float

In this format, more detailed information then has to be provided for the bit group, just as it is the case with Variables. The parameter line '*= ...' specifies the name ('DataSet1') and the value (0Ah) of the Multiplexer.

If a message is received, having the CAN-ID 32h, a length of 5 bytes, and the data byte 0 contains the value 0Ah, the message is displayed according to the definition of this Multiplexer. The data in the bytes 1 to 4 is interpreted as a float value.

To create a different data set for this message, another message definition must be included in the Symbols file. The name and the value of this new Multiplexer have to be different from the previous one:

Symbols File (FormatVersion 6.0)

[GeneralVehicleInfo]

Len=6
Mux=DataSet2 0,8 0Bh

Sig=MotorRPM 8
Sig=CurrentSpeed 32
Symbols File (FormatVersion 3.1)

[GeneralVehicleInfo]
Picture=******** aaaaaaaa aaaaaaaa -------- bbbbbbbb bbbbbbbb
*=DataSet2 0Bh
a=MotorRPM unsigned
b=CurrentSpeed signed

You can now omit the line 'ID= ...' since the CAN ID is always determined by the first definition of a Symbol. Note: the position and length of the Multiplexer bit group always has to be identical with the one of the first Multiplexer definition. However, the total number of data bytes of the message can differ for each Multiplexer definition.

Setting the Multiplexer Marker (FormatVersion 3.1 only)

The default marker character used as a placeholder for Multiplexers in the Picture parameter is '*'. To assign a specific Multiplexer marker to a Symbols file regardless of the default setting, the global parameter MuxChar can be included in the Symbols file:

Symbols File (FormatVersion 3.1)

MuxChar=Character

The following Multiplexer markers are allowed:

# % & ( ) * + ? @, a-z, A-Z.

Optional Switches for Multiplexers

Optionally, you can also specify various switches for Multiplexers, which, for example, control how a Multiplexer is displayed.

Switch | Description
-a | (All) The name of the Multiplexer is displayed (default).
-m | (Motorola) The individual data bytes of the Multiplexer are interpreted in the Motorola format.
-o | (Off) The Multiplexer is not displayed.
-t | (Trace) If this switch is specified for a Multiplexer, a message filter can be used to let only those messages pass through the filter that have a corresponding Multiplexer definition and which have this switch set. The -t switch can also be applied to variables or signals. See also the Adjust to marked Symbols Filter Item type in Message Filter settings.
-v | (Value) Only the value of the Multiplexer is displayed.

Please note that neither the value and the Multiplexer name nor signals/variables defined for a Multiplexer are displayed in the Receive and Transmit lists when using the switch -o. This format specification can invalidate the definition of a Multiplexer.

If you do not specify a switch, the format -a is automatically applied.

See also

Global Parameters

Picture Parameter: Bit Sequence in Multiplexers


Picture Parameter: Bit Sequence in Multiplexers

Note

The Picture Parameter is only supported in Symbol files using FormatVersion 3.1 and older.

If Multiplexers cover several data bytes, it is important to be able to trace the individual parts of the entire Multiplexer.

The individual bytes of the Multiplexer can be arranged in either the Intel or the Motorola format. The byte sequence is defined for each Multiplexer separately. As a standard setting the Intel format is chosen. If a Multiplexer shall be defined in the Motorola format, the formatting statement -m must be indicated in the line with the Multiplexer definition.

Intel Format

For example, in a simple case a Multiplexer consists of 16 bits, which are aligned to edges of the data byte:

Symbols File

// Byte 0 Byte 1 Byte 2

// 76543210 76543210 76543210

Picture=******** ******** aaaaaaaa
*=IntelMux 0102h

a=Variable signed

In the Intel format the bits in data byte 0 are considered LSB (Least Significant Byte) and the bits in data byte 1 as MSB (Most Significant Byte). When a received CAN message contains the value 02h in data byte 0 and the value 01h in data byte 1, PCAN-Explorer recognizes this Multiplexer.

It is not quite as simple if the Multiplexer is shifted by a few bits:

Symbols File

// Byte 0 Byte 1 Byte 2 Byte 3

// 76543210 76543210 76543210 76543210

Picture=***----- ******** ---***** aaaaaaaa
*=IntelMux 0102h

a=Variable signed

Here, the Multiplexer starts in data byte 0 with bit 5, which is the lsb (least significant bit) of the entire Multiplexer. Bit 0 in data byte 1 follows bit 7. The msb (most significant bit) of the entire Multiplexer is bit 4 in data byte 2. When a received CAN message contains the value 40h in data byte 0, 20h in data byte 1, and 0 in data byte 2, PCAN-Explorer recognizes this Multiplexer.

Motorola Format

The byte sequence is reversed in the Motorola format, i.e. the data in the lowest data byte of the bit group is considered as MSB of the entire Multiplexer after decoding.

For example, a Multiplexer with a length of 16 bit is defined in the data bytes 0 and 1:

Symbols File

// Byte 0 Byte 1 Byte 2

// 76543210 76543210 76543210

Picture=******** ******** aaaaaaaa
*=MotorolaMux 0102h -m

a=Variable signed

In Motorola format the bits in data byte 0 are considered MSB of the Multiplexer and the bits in data byte 1 as LSB. Here, the msb is in bit 7 of data byte 0 and the lsb in bit 0 of data byte 1. When a received CAN message contains the value 1 in data byte 0 and the value 2 in data byte 1, PCAN-Explorer recognizes this Multiplexer.

If the bit group is shifted by a few bits, the sequence of the bits is sequential in the Picture parameter, unlike the sequence in the Intel format:

Symbols File

// Byte 0 Byte 1 Byte 2 Byte 3

// 76543210 76543210 76543210 76543210

Picture=-----*** ******** *****--- aaaaaaaa
*=MotorolaMux 0102h -m

a=Variable signed

Here, the priorities of the bits are: msb is bit 2 of data byte 0, lsb is bit 3 of data byte 2, therefore continually descending from left to right. If a received CAN message contains the value 0 in data byte 0, the value 8 in data byte 1, and the value 10h in data byte 2, PCAN-Explorer recognizes this Multiplexer.

Attention: Before PCAN-Explorer version 3.0.3, the formatting statement -m in the Multiplexer definition did not define the byte sequence of the Multiplexer within the data bytes, but only determined how the given Multiplexer values had to be interpreted. These format statements could be indicated differently for several Multiplexers of a Symbol. Starting with version 3.0.3, each Multiplexer of a Symbol must be defined with the same formatting statement -m. To be able to use old Symbol Files further without a complete revision, insert the parameter

FormatVersion=3.0

at the beginning of the old Symbol File. This forces the compatibility to the old syntax. In this case all Multiplexer bit groups must be aligned to the edges of the data bytes, as it was required in older PCAN-Explorer versions.

See also

Variables

Optional Switches for Variable Definitions

FormatVersion Parameter


Enums

An Enum defines an enumeration (value table). Enums can be assigned to signals to represent certain values not numerically but alphanumerically. Character strings are defined for certain numerical values. If the raw value of a signal matches with one of the defined values at runtime, the text will be displayed instead of the numerical value.

Enums must be defined in the section {ENUMS}.

Syntax
Symbols File

{ENUMS}

Enum=EnumName(Value_1="Text 1",

Value_2="Text 2",

Value_3..Value..4="Text 3",

...,

Value_N="Text N") [-b]
Remarks

The specified values Value_... may be positive or negative, and must be within the permitted range from -2147483648 to 2147483647 (32-bit signed integer). If hexadecimal values are specified, they must be in the range from 0h to FFFFFFFFh (32-bit).

Enums can be assigned to signals and variables by specifying an optional parameter /e (see example). At runtime, the raw value of a signal/variable is used to find a matching Enum value. The raw value is the value as it is transmitted over the CAN bus, before applying factor and offset to transform it into a physical value. If no matching Enum value is found, the physical value will be displayed.

Since PCAN-Explorer 6.1, value ranges can also be specified in the form Value1..Value2="Text" if FormatVersion 6.0 is used.

Since PCAN-Explorer 6.4, if FormatVersion 6.0 is used, an enum can be defined as a Bit Mask by specifying the optional -b switch. In the case of Bit Mask enums, only the bits equal to 1 in the individual values are taken into account. All other bits are automatically don't-care. When decoding a signal value, several enum values can be recognized as suitable depending on the bits set in the value. The assigned strings are then shown concatenated, separated by pipe characters '|'.

Example

In the following example, a new Enum type "Color" is defined, which contains texts for different values. When the value of the signal "ColorSig" evaluates to one of the values 1 to 10, the corresponding text is displayed instead of the numeric value.

Symbols File (FormatVersion 6.0)

{ENUMS}

Enum=Color(1="Red", 2="Green", 3="Blue" ,4..10="Colorful")

{SIGNALS}

Sig=ColorSig unsigned 3 /e:Color

{RECEIVE}

[TestSymbol]
ID=123h
Len=1

Sig=ColorSig 0

A similar example for FormatVersion 5.0: When the value of the variable "ColorVar" evaluates to one of the values 1, 2, or 3, the corresponding text is displayed instead of the numeric value. Value ranges cannot be specified here.

Symbols File (FormatVersion 5.0)

{ENUMS}

enum Color(1="Red", 2="Green", 3="Blue")

{RECEIVE}

[TestSymbol]
ID=123h
DLC=1

Var=ColorVar unsigned 0,3 /e:Color

The following example demonstrates a Bit Mask enum that contains definitions for four individual bits.

Symbols File (FormatVersion 6.0)

{ENUMS}

Enum=BitMask(1="Bit 0", 2="Bit 1", 4="Bit 2", 8="Bit 3") -b

{SIGNALS}

Sig=BitMaskSig unsigned 4 /e:BitMask

{RECEIVE}

[TestSymbol]
ID=123h
Len=1

Sig=BitMaskSig 0

See also

Data Types

Optional Parameters of Variable Definitions


Direct Value Specification in Symbols Files

PCAN-Explorer Reference

Symbols Files

Direct Value Specifications in Symbols Files

Values in Symbols Files and Macros can usually be specified using the formats decimal, hexadecimal, binary, or as ASCII characters (see Input Syntax of Different Value Formats).

Decimal values are restricted in that their binary representation may not exceed 32 bits. Since Multiplexers can occupy up to 8 bytes, such values have to be specified in hexadecimal form.

Floating-Point Numbers

When editing a Symbols file that uses FormatVersion 3.1 or older, you must enter floating-point numbers by using the decimal separator specified in the Options dialog box. However, to make a Symbols file independent from local application settings, you can assign a decimal separator to a Symbols file. To assign a decimal separator, include the DecimalSepararator parameter in the head of the file:

Symbols File

FormatVersion=3.1

DecimalSeparator=DecimalSeparator

Allowed decimal separators are point '.' or comma ','.

Symbols files that use FormatVersion 5.0 always require a point as decimal separator.

See also

Input Syntax of Different Value Formats


Input Syntax of Different Value Formats

The following table shows the possibilities, how to enter values in the different input windows of PCAN-Explorer:

Format | Marking, Syntax | Example
 |  | Bits | Value
Decimal | No Prefix or Postfix | 00110010 | 50
Hexadecimal | Prefix $ or Postfix h | 00110010 | 32h or $32
Binary | Postfix b | 00110010 | 110010b
Floating point | No Prefix or Postfix. The syntax for entering float values also depends on the decimal separator which has been chosen in the Options dialog box. See Variable Types Float and Double. |  | 1.47E-3 or 1,47E-3
Single ASCII characters | Prefix # + ASCII code or character in quotes | 01000011 | #67 or 'C'
Character string | Character string in double quotes |  | "Abc"
Raw value | Hexadecimal character string. Without prefix, postfix, or quotes. | 11000100 | C8


Assigning CAN Messages or Macros to Function Keys

Assigning CAN messages or macros to function keys is only allowed in Symbols files using the format versions 3.0 or 3.1 (see FormatVersion parameter).

Using one of these older format versions, you can assign CAN messages to the function keys [F2] to [F12] to send certain messages with a single keystroke. The assignment must be done in the MESSAGEKEYS section of a Symbols file with one row being used for every function key to be assigned, entering

Symbols File

{MESSAGEKEYS}

Fn=CAN-ID Length DataBytes

or

Symbols File

{MESSAGEKEYS}

Fn=Symbol Multiplexer [Var1=Value [Var2=Value...VarN=Value]]

If you wish to send a Remote Request frame, indicate the RTR keyword instead of the data bytes or the variables. For example:

Symbols File

{MESSAGEKEYS}

Fn=CAN-ID Length RTR

Starting Macros

Using one of the older format versions, you can also assign Macros to function keys, i.e. to send a sequence of CAN messages with a single keystroke. These assignments must be done in the MACROKEYS section of a Symbols file. Each assignment requires a separate line with the following syntax:

Symbols File

{MACROKEYS}

Fn=MacroName

The MacroName parameter can be the name of a Standard Macro or the procedure name of a VBScript Macro.


Symbols File Example (FormatVersion 6.0)

Symbols File

// File header with global parameters

FormatVersion=6.0

Title="Sample"

{ENUMS}

// This section defines value lists that can be used to translate

// specific values into understandable text

Enum MyEnum(1="Left", 2="Right", 4="Center")

{SIGNALS}

// In this section all signals are defined that are referenced in

// later symbol definitions

Sig=CharValue char
Sig=BitValue bit
Sig=HexValue unsigned 4 -h

Sig=BitfieldValue unsigned 16 -b
Sig=MotorolaValue signed 16 -m

Sig=EnumValue unsigned /e:MyEnum

Sig=FloatValue float

Sig=LongValue signed 32 -h -m

Sig=ByteValue unsigned -h /d:123
Sig=IntValue signed 16 /f:1.5 /o:2.2

Sig=UnsignedValue unsigned 32

Sig=RawValue raw 64

{SEND}

// This section defines symbols for transmit-only messages

// The following symbol sends a message with CAN ID 222h, length 2

// with a default cycle time of 100 ms

[SendSymbol]
ID=222h

Len=2

CycleTime=100
Sig=CharValue 0
Sig=BitValue 8
Sig=HexValue 10

{RECEIVE}

// This section defines symbols for receive-only messages

// The following symbol matches all received messages that have a

// CAN ID in the range 300h to 400h and length 5

[RcvSymbol]
ID=300h-400h

Len=5

Sig=BitfieldValue 0
Sig=MotorolaValue 16

Sig=EnumValue 32

// The first two data bytes of the following symbol contain a

// multiplexer. The symbol matches all received messages that

// have CAN ID 111h, length 6, and which have the value 2 in

// data byte 0 and the value 1 in data byte 1 (multiplexer value

// 0102h in Intel format)

[MuxSymbol]
ID=111h
Len=6

Mux=Mux1 0,16 0102h
Sig=FloatValue 16

// The following symbol extends the previous symbol with a new

// multiplexer definition. This definition matches all received

// messages that have CAN ID 111h, length 6, and which have the

// value 3 in data byte 0 and the value 1 in data byte 1

[MuxSymbol]
Len=6

Mux=Mux2 0,16 0103h
Sig=LongValue 16

{SENDRECEIVE}

// This section defines symbols for bidirectional messages

// The following symbol matches all sent and received messages

// that have CAN ID 100h and length 7

[BiDirSymbol]
ID=100h
Len=7

Sig=ByteValue 0
Sig=IntValue 8
Sig=LongValue 24

// The following symbol matches all sent and received CAN FD

// messages that have CAN ID 500h and length 12

[FDSymbol]
ID=500h

Type=FDStandard
Len=12

Sig=UnsignedValue 0

Sig=RawValue 32 /d:r445566778899AABB

See also

Symbols File Example (FormatVersion 3.1)

Symbols File Example (FormatVersion 5.0)


Symbols File Example (FormatVersion 5.0)

Symbols File

// File header with global parameters

FormatVersion=5.0

Title="Sample"

{ENUMS}

// This section defines value lists that can be used to translate

// specific values into understandable text

Enum MyEnum(1="Left", 2="Right", 4="Center")

{SEND}

// This section defines symbols for transmit-only messages

// The following symbol sends a message with CAN ID 222h, length 2

// with a default cycle time of 100 ms

[SendSymbol]
ID=222h

DLC=2

CycleTime=100
Var=CharVar char 0,8
Var=BitVar bit 8,1
Var=HexVar unsigned 10,4 -h

{RECEIVE}

// This section defines symbols for receive-only messages

// The following symbol matches all received messages that have a

// CAN ID in the range 300h to 400h and length 5

[RcvSymbol]
ID=300h-400h

DLC=5

Var=BitfieldVar unsigned 0,16 -b
Var=MotorolaVar signed 16,16 -m

Var=EnumVar unsigned 32,8 /e:MyEnum

// The first two data bytes of the following symbol contain a

// multiplexer. The symbol matches all received messages that

// have CAN ID 111h, length 6, and which have the value 2 in

// data byte 0 and the value 1 in data byte 1 (multiplexer value

// 0102h in Intel format)

[MuxSymbol]
ID=111h
DLC=6

Mux=Mux1 0,16 0102h
Var=FloatVar float 16,32

// The following symbol extends the previous symbol with a new

// multiplexer definition. This definition matches all received

// messages that have CAN ID 111h, length 6, and which have the

// value 3 in data byte 0 and the value 1 in data byte 1

[MuxSymbol]
DLC=6

Mux=Mux2 0,16 0103h
Var=LongVar signed 16,16 -h -m

{SENDRECEIVE}

// This section defines symbols for bidirectional messages

// The following symbol matches all sent and received messages

// that have CAN ID 100h and length 7

[BiDirSymbol]
ID=100h
DLC=7

Var=ByteVar unsigned 0,8 -h /d:123
Var=IntVar signed 8,16 /f:1.5 /o:2.2
Var=LongVar signed 24,32 -t

{VIRTUALVARS}

// This section defines virtual variables, which are not transferred

// via CAN messages

Var=VirtualVar unsigned 16

See also

Symbols File Example (FormatVersion 3.1)

Symbols File Example (FormatVersion 6.0)


Symbols File Example (FormatVersion 3.1)

Symbols File

// File header with global parameters

FormatVersion=3.1

MuxChar=*

DecimalSeparator=.

{ENUMS}

// This section defines value lists that can be used to translate

// specific values into understandable text

Enum MyEnum(1="Left", 2="Right", 4="Center")

{SEND}

// This section defines symbols for transmit-only messages

// The following symbol sends a message with CAN ID 222h, length 2

// with a default cycle time of 100 ms

[SendSymbol]
ID=222h
Period=100
// Byte 0 Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6

// 76543210 76543210 76543210 76543210 76543210 76543210 76543210
Picture=aaaaaaaa --cccc-b
a=CharVar char
b=BitVar bit
c=HexVar unsigned -h

{RECEIVE}

// This section defines symbols for receive-only messages

// The following symbol matches all received messages that have a

// CAN ID in the range 300h to 400h and length 5

[RcvSymbol]
ID=300h-400h
Picture=aaaaaaaa aaaaaaaa bbbbbbbb bbbbbbbb cccccccc
a=BitfieldVar unsigned -b
b=MotorolaVar signed -m

c=EnumVar MyEnum

// The first two data bytes of the following symbol contain a

// multiplexer. The symbol matches all received messages that

// have CAN ID 111h, length 6, and which have the value 2 in

// data byte 0 and the value 1 in data byte 1 (multiplexer value

// 0102h in Intel format)

[MuxSymbol]
ID=111h
Picture=******** ******** aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
*=Mux1 0102h
a=FloatVar float

// The following symbol extends the previous symbol with a new

// multiplexer definition. This definition matches all received

// messages that have CAN ID 111h, length 6, and which have the

// value 3 in data byte 0 and the value 1 in data byte 1

[MuxSymbol]
Picture=******** ******** aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
*=Mux2 0103h
a=LongVar signed -h -m

{SENDRECEIVE}

// This section defines symbols for bidirectional messages

// The following symbol matches all sent and received messages

// that have CAN ID 100h and length 7

[BiDirSymbol]
ID=100h
Picture=aaaaaaaa bbbbbbbb bbbbbbbb cccccccc cccccccc cccccccc cccccccc
a=ByteVar unsigned -h /d:123
b=IntVar signed /f:1.5 /o:2.2
c=LongVar signed -t

{MESSAGEKEYS}

// This section defines function keys that send a CAN message when

// being pressed

F3=101h 3 A1h 02h 03h

{MACROKEYS}

// This section defines function keys that run a macro when being

// pressed

F4=MyMacro

See also

Symbols File Example (FormatVersion 5.0)

Symbols File Example (FormatVersion 6.0)


Standard Macros

Standard Macros

Home Page (Reference)

Standard Macros allow controlled transmit and receive operations. PCAN-Explorer provides a simple instruction set with the most frequently required functionality.

For example, Standard Macros can be used to accomplish the following tasks:

  • Transmission of several messages with one keystroke in order to transmit configuration data to a CAN node

  • Transmit different messages in specific time periods

  • Transmit a response on the reception of a specific message

  • Transmit specific answers at the reception of different data to simulate CAN nodes etc.

Because of the simple instruction set and a restricted functionality, Standard Macros can only be of limited use. For more complex tasks VBScript Macros should be used.

In This Section

Format and Syntax of Standard Macros

Describes the general rules that have to be taken into account when creating Standard Macros.

Standard Macro Keywords

Contains a list of all available keywords that can be used in Standard Macros.

Standard Macro Instructions

Contains a list of all available keywords and instructions that can be used in Standard Macros.

Using Labels

Explains how to use labels to branch the program execution flow.

Related Sections

Error Messages of Standard Macros

Contains all error messages that can occur during handling of Standard Macros.

VBScript Macros

Contains topics about the use of and the reference to VBScript Macros.


Format and Syntax of Standard Macros

Standard Macros must have the file name extension .mcr. The following general rules apply for creating Standard Macros:

  • All characters between a semicolon ';' or a double slash '//' and the end of the line are considered as comment and ignored.

  • Blank lines are ignored.

  • Each Macro instruction must be in a line of its own.

  • Macro instructions are not case-sensitive, only referencing of label names is case-sensitive.

Names of Macros

The names of the Macros, as they are displayed in the drop-down list of the Macros toolbar and the Project Manager, are defined by their file names without the file name extension .mcr.

See also

Standard Macro Instructions

Using Labels


Data Bytes as Parameters

Data bytes as parameters of Standard Macro instructions can be specified decimally, hexadecimally, binary, or as ASCII characters of a string. See Input Syntax of Different Value Formats.

If a value is indicated that is longer than 1 byte, the value can be indicated either in Intel or Motorola format. This is also valid for Symbol files. For further information, see Direct Value Specification in Symbols Files. The Intel format is the default format.

Specifying data bytes with raw data strings

To make it possible to indicate more than 8 data bytes in one value for CAN FD messages, PCAN-Explorer 6 introduces so-called raw data strings for Standard macros. These are prefixed with the lower-case letter 'r' and contain a string of hexadecimal characters (0-9, A-F, a-f). In this way it is possible to specify up to 64 bytes at a time:

Standard Macro

FormatVersion=6.0

Send 1 110h FD 16 r00112233445566778899AABBCCDEEFF

Send 1 111h 8 r001122

The individual bytes are inserted into the data bytes of the CAN messages from left to right, i.e. data byte 0 gets the value 0, data byte 1 the value 11h, and so on.

If the raw data string is not long enough to provide data for all bytes of the message, the rest of the bytes is filled with zeroes. Filling raw data into a CAN message always starts with data byte 0, which means the following macro instructions are equivalent:

Standard Macro

FormatVersion=6.0

Send 1 111h 8 r1122330000000000

Send 1 111h 8 r112233

Specifying data bytes with ASCII characters strings

Data bytes can be also indicated as character strings. The number of ASCII characters in the string must not exceed the number of data bytes in the message, e.g.:

Standard Macro

Send 1 110h 6 "Text 1"

Also, character strings can be inserted in Intel or Motorola format into the data bytes of the message. To assign the ASCII code of the character 'T' on the previous example to data byte 0 of the message, the string must be configured in Motorola format:

Standard Macro

Send 1 110h 6 "Text 1" -m


Using Labels

Labels serve for branching program execution flow.

Labels can be defined by positioning an identifier followed by a colon at the beginning of a line.

Syntax

Label: [Instruction Parameter]

Remarks

Labels can be separately in a line or in front of statements. At the reference to labels by use of the instructions Goto or Call only the identifier without the colon may be given as parameter.

Example
Standard Macro

FormatVersion=6.0

WaitKey

Call Sub

Repeat

Sub: Send 1 100h 2 12h 34h

Return

See also

Call Instruction

Goto Instruction

Return Instruction


Standard Macro Keywords

The following table contains all keywords that can be used in Standard Macros:

Keyword | Description
Bus | Specifies a global Bus number for a Macro file.
FormatVersion | Determines the format of a Standard Macro file.

See also

Standard Macro Instructions


Bus Keyword

Specifies a global Bus number for the Macro file.

The Bus keyword is a simple way to make older Standard Macro files compatible with PCAN-Explorer.

Beginning with PCAN-Explorer 5, the FormatVersion keyword controls how the individual instructions in the file are interpreted. Some changes to the Macro file format were required, since PCAN-Explorer 5 allows connections to multiple CAN buses at the same time. The Standard Macro instructions were originally designed to operate only on a single CAN bus. Therefore, an additional Bus parameter had to be introduced for some instructions, to control on which bus these instructions operate.

If no FormatVersion parameter is specified at the beginning of a Standard Macro file, PCAN-Explorer assumes the Macro file to be in the format that older versions of PCAN-Explorer used. In this case, at least a global Bus parameter must be specified at the beginning of the Macro file, to control on which bus those Macro instructions operate, which now normally require an additional Bus parameter. So you can avoid having to revise the entire macro file.

Syntax

Bus=BusNumber

Parameters

BusNumber

The Bus number (1-16).

Example

The following example uses the global Bus parameter to control on which connection the Macro instructions operate:

Standard Macro

Bus=1

Send 100h 1 AAh

WaitId 0 101h

Loop: Send 102h 2 12h 34h

Wait 200

Goto Loop

See also

FormatVersion Keyword


FormatVersion Keyword

Determines the format of the Standard Macro file.

Beginning with PCAN-Explorer 5, the FormatVersion keyword controls how the individual instructions in the file are interpreted. Some changes to the Macro file format were required, since PCAN-Explorer 5 allows connections to multiple CAN buses at the same time. The Standard Macro instructions were originally designed to operate only on a single bus. An additional Bus parameter had to be introduced for some instructions, to control on which bus these instructions operate.

If a parameter FormatVersion=5.0 or higher is specified at the beginning of a Standard Macro file, the following instructions require specifying of an additional Bus parameter:

Send, WaitData, WaitId, WaitMsg, and WaitRTR.

If no FormatVersion parameter is specified and the Standard Macro is started for the first time, a message prompt is shown, which can be used to assign the Standard Macro file to a single bus. In this case, a global Bus parameter is included at the beginning of the file.

PCAN-Explorer 6 supports Macro file formats up to version 6.0.

Syntax

FormatVersion=5.0

Example

The following example uses FormatVersion 5.0. The Send instruction and the Wait... instructions require an additional Bus parameter:

Standard Macro

FormatVersion=5.0

Send 1 100h 1 AAh

WaitId 0 1 101h

Loop: Send 1 102h 2 12h 34h

Wait 200

Goto Loop

The following example shows the same Macro using the old syntax. The global Bus parameter controls, on which connection the instructions operate:

Standard Macro

Bus=1

Send 100h 1 AAh

WaitId 0 101h

Loop: Send 102h 2 12h 34h

Wait 200

Goto Loop

See also

Bus Keyword


Standard Macro Instructions

The following table contains all instructions that can be used in Standard Macros:

Instruction | Description
Call | Calls a subroutine at the given label.
CheckData | Compares after a successful WaitMsg, WaitId, or WaitData instruction the received data with specific values.
CheckId | Checks the CAN ID of the message that was last received.
CheckMsgType | Checks the type of the message that was last received.
CheckSignal | Compares a signal value to a specific number or string.
ClearOutput | Clears the contents of the Macro Status window.
ClearQueue | Clears the reception queue of the Macro.
DecSignal | Decreases a signal value.
End | Ends the execution of the Macro.
ExecuteCommand | Executes a PCAN-Explorer command.
Goto | Continues the execution of the Macro at the given label.
If | Queries the result flag and invokes a given statement in dependence of the result flag's value.
IncSignal | Increases a signal value.
PauseTrace | Pauses the recording of CAN messages.
Print | Outputs text to the Macro Status window.
PrintSignal | Outputs a signal value to the Macro Status window.
PrintToOutputWindow | Outputs text to the Output window.
Repeat | Continues the execution of the Macro from the beginning.
Return | Ends a subroutine.
Send | Transmits a CAN message.
SetSignal | Sets the value of a signal.
StartTrace | Starts the recording of CAN messages.
StatusOutput | Controls status message output in the Macro Status window.
Stop | Ends the execution of the Macro.
StopTrace | Ends the recording of CAN messages.
Wait | Causes the macro to wait for a specified number of milliseconds.
WaitData | Waits for the reception of a CAN message with specific parameters.
WaitId | Waits for the reception of CAN message with a specified CAN ID.
WaitKey | Waits until any key has been pressed.
WaitMsg | Waits for a message to be received.
WaitRTR | Waits for the reception of a Remote Request frame.
WaitSignal | Waits for a signal to be set.

See also

Standard Macro Keywords


Call Instruction

Calls a subroutine at the specified label.

Syntax

Call Label

Parameters

Label

Specifies the name of the label, at which the execution shall be continued. The Label name is case-sensitive.

Remarks

To leave the called subroutine, the Return instruction must be executed. The execution is then continued with the statement that directly follows the Call statement.

At the execution of this instruction the current program position is put on a stack. The stack can take at most 100 positions. If the stack is full, during runtime of the Macro an according error message is displayed and the Macro execution is stopped.

Example

The following example waits for a keystroke and then calls the subroutine 'Sub':

Standard Macro

FormatVersion=5.0

WaitKey

Call Sub

Repeat

Sub: Send 1 100h 2 12h 34h

Return

See also

Return Instruction

Using Labels


CheckData Instruction

Compares after a successful WaitMsg, WaitId, or WaitData instruction the received data with specific values.

Syntax

CheckData Length DataBytes

Parameters

Length

The number of data bytes you want to check for. CAN messages can have up to 8 bytes, CAN FD messages up to 64 bytes (0-8, 12, 16, 20, 24, 32, 48, 64).

DataBytes

The data bytes with which the received data are to be compared. You can mark data that is not relevant (Don't Care) using the wildcard character '*'. See example below for more information.

Remarks

If the specified values match the received data bytes, the result flag is set to True, otherwise to False.

Examples

The following example waits for a specific CAN message and then compares the received data. If data byte 0 contains the value A0h, it sends a message 101h in response:

Standard Macro

FormatVersion=6.0

WaitId 0 1 100h

// Length Data

CheckData 3 A0h * *

If True

Send 101h 2 12h 34h

Repeat

See also

Data Bytes as Parameters

WaitId Instruction


CheckId Instruction

Checks the CAN ID of the message that was last received.

Syntax

CheckId CAN-ID

or

CheckId Bus Symbol

Parameters

CAN-ID

Specifies the ID of the CAN message you want to wait for. A 3-digit hexadecimal CAN ID to max. 7FFh indicates a Standard Frame (11-bit ID), a hexadecimal CAN ID with more than 3 digits indicates an Extended Frame (29-bit ID). If you specify the CAN ID in decimal, an Extended Frame is only possible for CAN ID 2048 and higher.

Bus

The Bus number (1-16) of a connection that shall be used to decode the following Symbol parameter.

Symbol

The name of the Symbol whose CAN ID you want to check.

Remarks

If the CAN ID of the message that was last received matches the specified value, the result flag is set to True, otherwise to False.

Example

The following example waits to receive a CAN message and then checks with multiple CheckId instructions which message has been received:

Standard Macro

FormatVersion=6.0

WaitMsg Infinite 1

CheckId 100h

If True

Call ID100

CheckId 200h

If True

Call ID200

Repeat

ID100:

// process CAN ID 100h

...

Return

ID200:

// process CAN ID 200h

...

Return

See also

WaitMsg Instruction

CheckMsgType Instruction


CheckMsgType Instruction

Checks the type of the message that was last received.

Syntax

CheckMsgType Type

Parameters

Type

One or more message types to check for. If multiple types are specified, the individual type must be separated by commas.

The following types are possible:

Type | Description
STD | Standard 11-bit message
EXT | Extended 29-bit message
RTR | Remote Transmission Request
FD | CAN FD message
BRS | CAN FD message with Bit Rate Switch enabled
ESI | CAN FD message with Error State Indicator bit set

The evaluation of the specified types is not case-sensitive.

Remarks

If all specified types are present in the checked CAN message, the result flag is set to True, otherwise to False.

Example

The following example waits to receive a CAN message and then investigates its type:

Standard Macro

FormatVersion=6.0

WaitMsg Infinite 1

CheckMsgType EXT,FD

If True

Print "Extended 29-bit and CAN FD"

CheckMsgType STD

If True

Print "Standard 11-bit"

...

See also

WaitMsg Instruction


CheckSignal Instruction

Compares a signal value to a specific number or string.

Syntax

CheckSignal SignalName Operator Value

Parameters

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Operator

Specifies the comparison to be made.

The following operators are supported:

Operator | Description
= | Checks if the signal value is identical with the specified Value. If Value is a string and not a number, the comparison is not case-sensitive.
== | If Value is a string, the comparison is carried out with case-sensitivity. Not applicable if Value is a number.
> | Checks if the signal value is greater than the specified Value.
>= | Checks if the signal value is equal to or greater than the specified Value.
< | Checks if the signal value is smaller than the specified Value.
<= | Checks if the signal value is equal to or smaller than the specified Value.

Value

The operand with which the comparison is made. Can be a number or a string.

Remarks

The result of the comparison is stored in the result flag.

Example

The following example waits for the signal 'MySignal' to be set and then checks its value:

Standard Macro

FormatVersion=6.0

WaitSignal Infinite MySignal

CheckSignal MySignal > 123.45

If True

Print "MySignal is greater than 123.45"

CheckSignal MySignal <= 10

If True

Print "MySignal is <= 10"

The following example sets the signal 'MyStringSignal' to the value 'STEVe' and makes some comparisons:

Standard Macro

FormatVersion=6.0

SetSignal MyStringSignal "STEVe"

CheckSignal MyStringSignal > "STEVE"

If True

Print "STEVe is greater than STEVE"

// Note that the result of the comparison is True because

// the value of 'e' is greater than the value of 'E'

CheckSignal MyStringSignal = "STEVE"

If True

Print "True: STEVe = STEVE"

CheckSignal MyStringSignal == "STEVE"

If False

Print "False: STEVe == STEVE"

See also

If Instruction

SetSignal Instruction

WaitSignal Instruction


ClearOutput Instruction

Clears the contents of the Macro Status window.

Syntax

ClearOutput

Example

The following example clears the contents of the Macro Status window after a CAN message has been received on bus 1:

Standard Macro

FormatVersion=6.0

WaitMsg 0 1

ClearOutput

Print "Message received"

...

See also

Macro Status Window


ClearQueue Instruction

Clears the reception queue of the Macro.

Syntax

ClearQueue

Remarks

If one of the instructions WaitData, WaitId, WaitKey, WaitMsg, or WaitRTR is used in a Macro, the reception filter of the Macro is adjusted so that all required CAN messages are buffered in the reception queue. When one of these Wait functions is executed, the messages in the reception queue are read, beginning with the oldest message, to decide wether a matching CAN message was received or not. As soon as a matching CAN message is found, the reading of the queue is interrupted.

The reception queue of a Standard Macro can hold a maximum of 512 CAN messages. Often it will be useful to clear the reception queue before executing one of the Wait functions, since the reception queue could be filled with irrelevant or obsolete messages.

Example

The following example clears the reception queue before it begins to wait for a requested CAN message:

Standard Macro

FormatVersion=6.0

ClearQueue

Send 1 100h 2 AAh 01h

WaitId 1 1000 101h

...

See also

WaitData Instruction

WaitId Instruction

WaitMsg Instruction

WaitRTR Instruction


DecSignal Instruction

Decreases a signal value.

Syntax

DecSignal SignalName [Value]

Parameters

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Value

(Optional) The value by which the signal value shall be decreased. Only integer values are allowed. If omitted, the signal value is decreased by 1.

Example

The following example decreases a signal value:

Standard Macro

FormatVersion=6.0

SetSignal MySignal 100

DecSignal MySignal

DecSignal MySignal 10

DecSignal SymbolsFile1.MySymbol.MySignal 4

The value of MySignal evaluates to 85 when the macro is finished.

See also

IncSignal Instruction

SetSignal Instruction


End Instruction

Ends the execution of the Macro.

Syntax

End

Example

The following example ends the execution of the Macro after calling the subroutine 'Sub':

Standard Macro

FormatVersion=6.0

WaitKey

Call Sub

End

Sub: Send 1 100h 2 12h 34h

Send 1 101h 1 AAh

Return

See also

Stop Instruction


ExecuteCommand Instruction

Executes a PCAN-Explorer command.

Syntax

ExecuteCommand Command

Parameters

Command

The name of the command that shall be executed.

Example

The following example quits PCAN-Explorer when a message 100h is received:

Standard Macro

FormatVersion=6.0

WaitId 0 1 100h

ExecuteCommand ApplicationExit

See also

PCAN-Explorer Commands


Goto Instruction

Continues the execution of the Macro at the specified label.

Syntax

Goto Label

Parameters

Label

Specifies the name of the label, at which the execution shall be continued. The Label name is case-sensitive.

Example

In the following example a part of the Macro is executed endlessly after reaching the Goto instruction:

Standard Macro

FormatVersion=6.0

Send 1 100h 1 AAh

WaitId 0 1 101h

Loop: Send 1 102h 2 12h 34h

Wait 200

Goto Loop

See also

Using Labels


If Instruction

Queries the result flag and invokes a given statement in dependence of its value.

Syntax

If Flag

Statement

Parameters

Flag

The value of the result flag, on which the test should be done. Possible values are:

  • True: The result of the query is true if the result flag contains the value 'True'.

  • False: The result of the query is true if the result flag contains the value 'False'.

Statement

This instruction is executed if the result of the query is true. If the result is false, this statement is skipped.

Remarks

The result flag is set by the instructions CheckData, CheckId, CheckMsgType, CheckSignal, WaitData, WaitId, WaitKey, WaitMsg, WaitRTR, and WaitSignal.

Attention: The instruction that shall be executed on a true result, must be in the line succeeding the If instruction.

Example

The following example waits for different CAN messages and responds to them:

Standard Macro

FormatVersion=6.0

Send 1 100h 1 AAh

WaitId 1000 1 101h

If False

Stop

Send 1 102h 2 12h 34h

WaitId 1000 1 103h

If True

Send 1 104h 2 12h 34h

Repeat

See also

WaitData Instruction

WaitId Instruction

WaitMsg Instruction

WaitRTR Instruction

WaitSignal Instruction


IncSignal Instruction

Increases a signal value.

Syntax

IncSignal SignalName [Value]

Parameters

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Value

(Optional) The value by which the signal value shall be increased. Only integer values are allowed. If omitted, the signal value is increased by 1.

Example

The following example increases a signal value:

Standard Macro

FormatVersion=6.0

SetSignal MySignal 100

IncSignal MySignal

IncSignal MySignal 10

IncSignal SymbolsFile1.MySymbol.MySignal 4

The value of MySignal evaluates to 115 when the macro is finished.

See also

DecSignal Instruction

SetSignal Instruction


PauseTrace Instruction

Pauses the recording of CAN messages.

Syntax

Pause Trace

Remarks

This instruction only has an effect if a tracer has been started before using the StartTrace instruction.

Example

In the following example the tracer will be paused, when a CAN message with the ID 201h has been received:

Standard Macro

FormatVersion=6.0

StartTrace

Loop: Send 1 101h 3 01h 12h 34h

Wait 100

Send 1 101h 3 02h 56h 78h

Wait 100

Send 1 200h 1 AAh

WaitId 500 1 201h

If False

Goto Loop

PauseTrace

See also

StartTrace Instruction

StopTrace Instruction


Print Instruction

Outputs text to the Macro Status window.

Syntax

Print Text

Parameters

Text

The text to be output. If the text contains spaces, it must be put in double quotes. The maximum length of the text mustn't exceed 30 characters (inclusive of quotation marks).

Remarks

By default, the signal value is displayed in green in the Macro status window. You can customize the color on the Fonts and Colors page in the Options dialog box.

Example

The following example outputs different texts:

Standard Macro

FormatVersion=6.0

Send 1 100h 1 AAh

WaitId 1000 1 101h

If False

Stop

Print "Data transmission..."

Send 1 102h 2 12h 34h

Wait 200

Send 1 103h 2 56h 78h

Wait 200

Send 1 104h 2 90h ABh

Wait 200

Send 1 105h 2 CDh EFh

Print "Finished"

See also

Macro Status Window

PrintToOutputWindow Instruction

ClearOutput Instruction


PrintSignal Instruction

Outputs a signal value to the Macro Status window.

Syntax

PrintSignal SignalName

Parameters

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Remarks

By default, the signal value is displayed in blue in the Macro status window. You can customize the color on the Fonts and Colors page in the Options dialog box.

Example

The following example waits for the signal 'MySignal' to be set and then outputs its current value:

Standard Macro

FormatVersion=6.0

StatusOutput False

WaitSignal Infinite MySignal

ClearOutput

PrintSignal MySignal

Repeat

See also

Macro Status Window

StatusOutput Instruction

WaitSignal Instruction

ClearOutput Instruction


PrintToOutputWindow Instruction

Outputs text to the Output window.

Syntax

PrintToOutputWindow Text

Parameters

Text

The text to be output. The text must be put in double quotes. The maximum length of the text mustn't exceed 30 characters (inclusive of quotation marks).

Remarks

The text is displayed in the Output window on the Macro tab.

Example

The following example prints different texts to the Output window:

Standard Macro

FormatVersion=6.0

Send 1 100h 1 AAh

WaitId 1000 1 101h

If False

Stop

PrintToOutputWindow "Data transmission..."

Send 1 102h 2 12h 34h

Wait 200

Send 1 103h 2 56h 78h

Wait 200

Send 1 104h 2 90h ABh

Wait 200

Send 1 105h 2 CDh EFh

PrintToOutputWindow "Finished"

See also

Output Window

Print Instruction


Repeat Instruction

Continues the execution of the Macro at the beginning.

Syntax

Repeat

Example

In the following example a Macro is executed endlessly using the Repeat instruction:

Standard Macro

FormatVersion=6.0

Send 1 100h 2 12h 34h

Wait 500

Repeat


Return Instruction

Ends a subroutine invoked by means of the Call instruction.

Syntax

Return

Remarks

By execution of the Return instruction the topmost value is fetched from the stack and regarded as a new execution position. If the stack is empty and a new execution position cannot be determined, during runtime of the Macro an according error message is displayed and the Macro execution is stopped.

Example

The following example demonstrates the call of a subroutine:

Standard Macro

FormatVersion=6.0

WaitId 0 1 100h

Call Sub

Repeat

Sub: Send 1 101h 2 12h 34h

Return

See also

Call Instruction


Send Instruction

Transmits a CAN message.

Syntax

Send Bus CAN-ID [Type] Length DataBytes

or

Send Bus Symbol Multiplexer DataBytes

Parameters

Bus

The Bus number (1-16) that identifies the connection, on which the message is transmitted. If the keyword AnyBus is specified, the message will be transmitted on all enabled CAN connections.

CAN-ID

Specifies the ID of the CAN message, that shall be transmitted. A 3-digit CAN ID to max. 7FFh transmits a Standard Frame (11-bit ID), a CAN ID with more than 3 digits transmits an Extended Frame (29-bit ID).

Type

(Optional, FormatVersion 6 or later) Specifies an additional type for the CAN message. The type can be a combination of one or more comma-separated individual values. Possible type values are:

  • FD Sends the message as CAN FD message.

  • BRS Sends the message as CAN FD message with enabled Bit Rate Switch flag. The data fields in a CAN FD frame will be transferred with a higher bit rate if the Bit Rate Switch flag is set.

  • ESI Sends the message as CAN FD message with enabled Error State Indicator flag. The Error State Indicator provides information, whether the sender of the message is in Error Active or Error Passive state.

  • RTR Sends a Remote Request frame.

  • SS Sends the message with the Single Shot Transmission option. See NXP Application Note AN97076 "SJA1000 Stand-alone CAN controller", section 5.4.

Length

Determines the number of data bytes. 0 to 8 bytes for CAN messages, up to 64 bytes for CAN FD messages (0-8, 12, 16, 20, 24, 32, 48, 64).

DataBytes

The data bytes of the message. If a Remote Request frame shall be transmitted, and if RTR was not set using the Type parameter, the keyword RTR must be specified here.

Symbol

The name of a Symbol that shall be transmitted. So that a Macro, which contains names of Symbols and Multiplexers, can be executed, a Symbols File must be activated for the specified bus, which defines these Symbols and Multiplexers.

Multiplexer

The name of a Multiplexer that is defined for the Symbol. If a Symbol shall be transmitted, for which no Multiplexer is defined, the value '<Empty>' must be specified as the Multiplexer name.

Example

The following example shows the different possibilities to transmit CAN messages:

Standard Macro

FormatVersion=6.0

// Standard frame

Send 1 100h 1 AAh

// Extended frame

Send 1 1234h 3 11h 22h 33h

// CAN FD frame

Send 1 100h FD,BRS 12 r001122334455667799AABB

// Transmission with Symbol declaration

Send 1 DataService Init A1h

// Transmit data records

Send 1 DataService Data 01h 12h 34h

Send 1 DataService Data 02h 56h 78h

Send 1 DataService Data 03h 90h 00h

Send 1 DataService Complete A1h

// Symbol2 has no Multiplexer

Send 1 Symbol2 <Empty> AAh BBh

// RTR message

Send 1 200h RTR 3

// Transmit on all busses

Send AnyBus 300h 2 12h 34h

See also

Data Bytes as Parameter


SetSignal Instruction

Sets the value of a signal.

Syntax

SetSignal SignalName Value

Parameters

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Value

The new value for the signal. To specify floating point values, use a point as the decimal separator. To specify a string value that contains blanks, enclose the string in double quotes.

Example

The following example sets different signal values:

Standard Macro

FormatVersion=6.0

SetSignal MySignal 123

SetSignal MySignal 1.23

SetSignal StringSignal Hello

SetSignal StringSignal "Test 1"

SetSignal SymbolsFile1.MySymbol.UniversalAnswer 42

See also

IncSignal Instruction

DecSignal Instruction


StartTrace Instruction

Starts the recording of CAN messages.

Syntax

StartTrace [FileName]

Parameters

FileName

(Optional) The name of an already opened trace file that shall be used for recording. If no file name is specified, or if no trace file with the specified name is already open, a new tracer is started.

Example

In the following example the tracer is started when a CAN message with the ID 101h is received:

Standard Macro

FormatVersion=5.0

Send 1 100h 1 AAh

WaitId 1000 1 101h

If False

Stop

StartTrace

Send 1 101h 3 01h 12h 34h

Wait 100

Send 1 101h 3 02h 56h 78h

Wait 100

StopTrace

See also

StopTrace Instruction


StatusOutput Instruction

Controls status message output in the Macro Status window.

Syntax

StatusOutput Value

Parameters

Value

  • True: Status messages are output in the Macro Status window.

  • False: No status messages are output in the Macro Status window.

Remarks

The StatusOutput instruction has no effect on status messages of the WaitKey instruction, output of the Print instruction, and output of error messages.

Example

The following example initially turns off status messages in the Macro Status window so that the first WaitMsg instruction does not create an entry "Waiting for next message on bus 1...", and then on again:

Standard Macro

FormatVersion=6.0

StatusOutput False

WaitMsg 0 1

Print "Message received"

StatusOutput True

WaitMsg 0 1

Print "Another message received"

...

See also

Macro Status Window


Stop Instruction

Ends the execution of the Macro.

Syntax

Stop

Example

The following example ends the execution of the Macro after calling the subroutine 'Sub':

Standard Macro

FormatVersion=6.0

WaitKey

Call Sub

Stop

Sub: Send 1 100h 2 12h 34h

Send 1 101h 1 AAh

Return

See also

End Instruction


StopTrace Instruction

Ends the recording of CAN messages.

Syntax

StopTrace

Remarks

This instruction only has an effect if a tracer has been started before using the StartTrace statement.

Example

In the following example the tracer is stopped when a CAN message ID 201h is received on bus 1:

Standard Macro

FormatVersion=6.0

StartTrace

Loop: Send 1 101h 3 01h 12h 34h

Wait 100

Send 1 101h 3 02h 56h 78h

Wait 100

Send 1 200h 1 AAh

WaitId 500 1 201h

If False

Goto Loop

StopTrace

See also

StartTrace Instruction

PauseTrace Instruction


Wait Instruction

Causes the macro to wait (temporarily cease execution) for the specified number of milliseconds.

Syntax

Wait Time

Parameters

Time

The amount of time to wait, in Milliseconds.

Example

In the following example a CAN message is transmitted continuously in the interval of 500 ms:

Standard Macro

FormatVersion=6.0

Send 1 100h 2 12h 34h

Wait 500

Repeat


WaitData Instruction

Waits for the reception of a CAN message with the specified parameters.

Syntax

WaitData Time Bus CAN-ID [Type] Length DataBytes

or

WaitData Time Bus Symbol Multiplexer DataBytes

Parameters

Time

The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

Bus

The Bus number (1-16) identifies the connection, on which you await the message. If you specify the keyword AnyBus, messages from all enabled CAN connections can trigger a WaitData success.

CAN-ID

Specifies the ID of the CAN message you want to wait for. A 3-digit CAN ID to max. 7 FFh determines a Standard Frame (11-bit ID), a CAN ID with more than 3 digits determines an Extended Frame (29-bit ID).

Type

(Optional, FormatVersion 6 or later) Specifies an additional type of data. Possible types are:

  • FD Waits for a CAN FD message.

Length

The number of data bytes you want to wait for. 0-8 bytes for CAN messages, up to 64 bytes for CAN FD messages (0-8, 12, 16, 20, 24, 32, 48, 64).

DataBytes

The data of the message. You can mark data that is not relevant (Don't Care) using the wildcard character '*'. See examples below for more information.

Symbol

The name of a Symbol you want to wait for. To make sure a Macro can be executed that contains names of Symbols and Multiplexers, assign a Symbols File to the connection you are using in your macro.

Multiplexer

The name of a Multiplexer that is defined for the specified Symbol. If no Multiplexer is defined for the Symbol, specify the value '<Empty>'.

Remarks

If a matching message was received within the waiting time, the result flag is set to True, otherwise to False.

Often it will be useful to clear the reception queue before beginning to wait for a CAN message. If the reception queue holds irrelevant or obsolete messages, this could lead to unexpected results. See ClearQueue instruction.

Examples

The following example waits for a specific CAN message before data is transmitted:

Standard Macro

FormatVersion=6.0

Send 1 100h 1 AAh

// Time Bus ID Length Data

WaitData 1000 1 101h 3 BBh CCh DDh

If False

Stop

// begin data transfer

Send 1 DataService Data 12h 34h

WaitData 1000 1 DataService DataControl FFh

If True

Send 104h 2 56h 78h

The following example waits for a CAN FD message:

Standard Macro

FormatVersion=6.0

// Time Bus ID Type Length Data

WaitData 1000 1 101h FD 12 r00112233445566778899AABB

The following example uses Don't Care markers to specify that only data byte 1 is relevant:

Standard Macro

FormatVersion=6.0

// Time Bus ID Length Data

WaitData 0 AnyBus 101h 3 * CCh *

Don't Care markers can also be used in hexadecimal or binary values:

Standard Macro

FormatVersion=6.0

// Time Bus ID Length Data

WaitData 0 1 101h 1 C*h

WaitData 0 1 102h 1 0*011**0b

WaitData 0 1 103h 3 *Fh 0*011**0b *

WaitData 0 1 104h 8 r00**223344556677

See also

Data Bytes as Parameters

WaitMsg Instruction

WaitId Instruction

WaitRTR Instruction

ClearQueue Instruction

CheckData Instruction


WaitId Instruction

Waits for the reception of CAN message with a specified CAN ID.

Syntax

WaitId Time Bus CAN-ID

or

WaitId Time Bus Symbol

Parameters

Time

The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

Bus

The Bus number (1-16) identifies the connection, on which you await the message. If you specify the keyword AnyBus, messages from all enabled CAN connections can trigger a WaitId success.

CAN-ID

Specifies the ID of the CAN message you want to wait for. A 3-digit hexadecimal CAN ID to max. 7FFh indicates a Standard Frame (11-bit ID), a hexadecimal CAN ID with more than 3 digits indicates an Extended Frame (29-bit ID). If you specify the CAN ID in decimal, an Extended Frame is only possible for CAN ID 2048 and higher.

Symbol

The name of a Symbol you want to wait for. To make sure a Macro can be executed that contains names of Symbols and Multiplexers, assign a Symbols File to the connection you are using in your macro.

Remarks

If a matching message has been received within the waiting time, the result flag is set to True, otherwise to False.

Often it will be useful to clear the reception queue before beginning to wait for a CAN message. If the reception queue holds irrelevant or obsolete messages, this could lead to unexpected results. See ClearQueue instruction.

Example

The following example waits for a CAN message with a specific CAN ID before data is transmitted:

Standard Macro

FormatVersion=6.0

Send 1 100h 2 AAh 01h

WaitId 1000 1 101h

If False

Stop

// begin data transfer

Send 1 DataService Data 12h 34h

Send 1 DataService Data 56h 78h

...

See also

WaitMsg Instruction

WaitData Instruction

WaitRTR Instruction

ClearQueue Instruction


WaitKey Instruction

Waits until any key has been pressed.

Syntax

WaitKey [Time]

Parameters

Time

(Optional) The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

Remarks

If a waiting time is specified, and a message was received within the waiting time, the result flag is set to True, otherwise to False.

Example

The following example transmits a CAN message after pressing a key:

Standard Macro

FormatVersion=6.0

WaitKey

Send 1 100h 2 12h 34h

Repeat

See also

Send Instruction

Repeat Instruction


WaitMsg Instruction

Waits for a message to be received.

Syntax

WaitMsg Time Bus

Parameters

Time

The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

Bus

The Bus number (1-16) identifies the connection, on which you await the message. If you specify the keyword AnyBus, messages from all enabled CAN connections can trigger a WaitMsg success.

Remarks

If a message was received within the waiting time, the result flag is set to True, otherwise to False.

Often it will be useful to clear the reception queue before beginning to wait for a CAN message. If the reception queue holds irrelevant or obsolete messages, this could lead to unexpected results. See ClearQueue instruction.

Example

The following example waits several times for a CAN message:

Standard Macro

FormatVersion=6.0

Send 1 100h 2 01h AAh

WaitMsg 1000 1

If False

Stop

Send 1 100h 2 02h ABh

WaitMsg 1000

If False

Stop

Send 1 100h 2 03h ACh

...

See also

WaitId Instruction

WaitData Instruction

WaitRTR Instruction

ClearQueue Instruction


WaitRTR Instruction

Waits for the reception of a Remote Request frame.

Syntax

WaitRTR Time Bus CAN-ID [Length]

or

WaitRTR Time Bus Symbol [Length]

Parameters

Time

The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

Bus

The Bus number (1-16) identifies the connection, on which you await the message. If you specify the keyword AnyBus, messages from all enabled CAN connections can trigger a WaitRTR success.

CAN-ID

Specifies the ID of the CAN message you want to wait for. A 3-digit CAN ID to max. 7FFh indicates a Standard Frame (11-bit ID), a CAN ID with more than 3 digits indicates an Extended Frame (29-bit ID).

Symbol

The name of a Symbol you want to wait for. To make sure a Macro can be executed that contains names of Symbols and Multiplexers, assign a Symbols File to the connection you are using in your macro.

Length

(Optional) The number of data bytes (0-8) of the CAN message you want to wait for.

If this parameter is omitted, every possible data length (0..8) triggers a wait success.

If this parameter is specified, the project option Ignore Data Length Code in the Project Settings dialog box on the CAN page determines, whether the Macro waits for a Remote Request frame whose Data Length Code corresponds to the parameter Length.

Remarks

If a matching message has been received within the waiting time, the result flag is set to True, otherwise to False.

Often it will be useful to clear the reception queue before beginning to wait for a CAN message. If the reception queue holds irrelevant or obsolete messages, this could lead to unexpected results. See ClearQueue instruction.

Example

The following example waits several times for a Remote Request frame:

Standard Macro

FormatVersion=6.0

Send 1 100h 2 AAh 01h

WaitRTR 1000 1 101h 3

If True

Send 1 101h 3 11h 22h 33h

WaitRTR 500 1 DataService Data

If True

Send 1 DataService 3 01h 02h 03h

See also

WaitMsg Instruction

WaitId Instruction

WaitData Instruction

ClearQueue Instruction


WaitSignal Instruction

Waits for a signal to be set.

Syntax

WaitSignal Time SignalName

Parameters

Time

The amount of time to wait, in Milliseconds. The value 0 or the keyword Infinite causes infinite waiting.

SignalName

The name of the signal. You can specify the fully qualified name or the short name of the signal.

Remarks

If the signal has been set within the waiting time, the result flag is set to True, otherwise to False.

Example

The following example waits for the signal 'MySignal' to be set and then checks its value:

Standard Macro

FormatVersion=6.0

WaitSignal Infinite MySignal

CheckSignal MySignal > 12.5

If True

// Do something

See also

CheckSignal Instruction


Error Messages

Error Messages

Home Page (Reference)

This section enumerates all error messages that can occur when working with Symbol Files, Standard Macros, and during transmit and receive operations.

In This Section

Error Messages of Symbol Files

Contains all error messages that can occur during handling of Symbol Files.

Error Messages of Standard Macros

Contains all error messages that can occur during handling of standard Macros.

Hardware Status

Describes the status messages of PCAN hardware that can occur at transmission or reception of CAN messages.

Related Sections

VBScript Errors

Contains all error messages that can occur during execution of a VBScript Macro or during the compilation.

User Interface

Contains reference topics for the various dialog boxes and windows of PCAN-Explorer.

PCAN-Explorer Commands

Contains a description of the predefined PCAN-Explorer commands.


Error Messages of Symbols Files

Error messages of Symbols Files are displayed in the Output window on the tab Messages. When an error occurs, the Output window is automatically shown if it hasn't been visible yet. An error number and a short description is always given.

Following errors can be displayed:

No. Displayed Text Description

1

Syntax error

At the cursor position is an error in the syntax of the Symbols File.

2

Keyword expected

At the indicated position a keyword is expected.

3

Unknown keyword

The highlighted keyword does not exist.

4

Keyword not allowed at this point

The keyword used is not allowed at the indicated position.

5

'=' expected

At the indicated position the '=' character is expected.

6

':' expected

At the indicated position a colon is expected.

7

Integer value expected

At the indicated position an integer value is expected.

8

String expected

At the indicated position a string is expected.

9

CAN ID expected

At the indicated position a CAN ID is expected.

10

Identifier too long

The highlighted identifier has more than 30 characters.

11

Identifier expected

At the indicated position a name for the object to be defined (symbol, multiplexer, variable, signal) is expected.

12

Keyword not allowed at this point

The highlighted keyword may not be used as name of a symbol, multiplexer or a variable.

13

Symbol file format not supported.

It has been tried to read a newer Symbol File format that is not yet supported in this version of PCAN-Explorer.

15

Missing value of parameter...

At the cursor position the value of the given parameter is missing.

16

Invalid value

The marked text does not yield a valid value.

20

CAN ID already in use by...

The specified CAN ID is already used by another definition of a receive-only symbol or bidirectional symbol.

A CAN ID, which has been assigned to a symbol in either the {RECEIVE} or the {SENDRECEIVE} sections, can only be used once. Otherwise, when receiving a CAN message with this CAN ID, it would be impossible for PCAN-Explorer to find out and display the correct symbol. However, within the {SEND} section you can assign the same CAN ID to more than one symbol.

21

CAN ID ranges are allowed only for receive-only Symbols

Specifying a range of CAN ID's in the ID parameter of the symbol definition is only allowed for symbols that are defined in the {RECEIVE} section.

22

Timeouts not allowed for send Symbols

Specifying a Timeout parameter is only allowed for symbols that are not defined in the {RECEIVE} section.

23

CAN ID not specified

A CAN ID has not been specified in the symbol definition.

24

The Symbol's CAN ID was already defined as ... in a previous Symbol/Multiplexer definition

The CAN ID specified is different from that of a previous multiplexer definition of the same symbol. A CAN ID parameter is required only in the first definition of the symbol.

25

Type does not match the specified Extended CAN ID

A 29-bit Extended CAN ID was specified in the ID parameter, but the value of the Type parameter tries to define the ID as an 11-bit Standard CAN ID.

32

Bits not within byte boundaries

The highlighted bit group of the Picture parameter does not contain exactly 8 bits.

33

Invalid variable marker character

An invalid placeholder has been used for a variable. Permitted placeholders are the characters 'a'..'z', 'A'..'Z', '0'..'9', '%' and '&'.

34

Bit group ... not defined in picture

The bit group with the given placeholder hasn't been defined in the Picture parameter.

35

Error in bit group ... Check Motorola/Intel format

The order of the bits in the Picture parameter does not match the definition of the variables. Perhaps the Motorola or Intel format hasn't been respected at the definition of the bit group. See also Bit Sequence in Variables.

40

Value too large for 8 bits

The given value is too big and doesn't fit into 8 bits or a byte respectively.

41

Value not within range. Allowed value range is ... to ...

It has been tried to assign a value to variable, the binary representation of which contains more bits than the variable can take.

42

Incorrect number of characters in string

The string parameter does not contain the demanded number of ASCII characters. When specifying a string for the data bytes of a CAN message e.g. in the {MESSAGEKEYS} section, the length of the character string must not exceed the number of data bytes of the message.

43

Raw data string too long for ... bits

The highlighted raw data string contains too many bytes and cannot be assigned to the variable/signal.

50

Unknown data type

The data type specified in the variable definition is unknown.

51

Too many bits in variable

The length of the variable does not match the specified data type.

52

Not enough bits for data type 'Signed'

It has been tried to assign the data type Signed to a single bit. The minimum length of Signed variables is 2 bits.

53

Too many bits for data type 'Bit'

The data type Bit has been assigned to a bit group with more than one bit.

54

Incorrect number of bits for data type 'Char'

The data type Char has been assigned to a bit group, although the bit group does not consist of exactly 8 bits.

55

Incorrect number of bits for data type 'String'

The data type String has been assigned to a bit group, although the length of the bit group does not consist of the multiple of 8 bits.

56

Incorrect number of bits for data type 'Float'

The data type Float has been assigned to a bit group, although the bit group does not consist of exactly 32 bits. See also Data Types Float and Double.

57

Incorrect number of bits for data type 'Double'

The data type Double has been assigned to a bit group, although the bit group does not consist of exactly 64 bits. See also Data Types Float and Double.

58

Factor value 0 will cause division by zero. Check Decimal Separator setting

A factor value of 0 has been specified. This will result in a division by zero when converting the variable value using factor and offset, and is therefore not permitted. The reason for this error can also be the use of a wrong decimal separator character, especially if the integer part of the specified factor value is 0.

59

Variable not within byte boundaries

Variables that have one of the types Double, String, or Raw must always be aligned to data byte boundaries.

60

Invalid display format

An invalid display format has been assigned to a multiplexer or a variable.
Valid values for the multiplexer display format are:

-o (no display),

-v (display of the value),

-a (display of the name).

Valid values for the variable display format are:

-o (no display),

-v (display of the value),

-a (identifier and value).

61

Redefinition of variable marker character

The placeholder for the variable at the cursor position has already been used within the Picture parameter in another place.

62

Redefinition of variable name

The highlighted variable name is already in use.

64

Unit too long

The specified variable unit is longer than 10 characters (FormatVersion 3.1) or 16 characters (FormatVersion 5.0 or newer).

65

Long Name too long (max. 128 characters)

The specified Long Name has more than 128 characters.

66

Variables cannot be shorter than 1 bit

Variables must have a minimum length of 1 bit.

67

Enum assignment not allowed

Enums can only be assigned to Variables of type Bit, Signed, or Unsigned.

68

Variable definition 'Var=...' expected

In the {VIRTUALVARS} section only variable definitions in the form 'Var=...' are allowed.

70

Multiplexer name already in use

Another multiplexer with the same name has already been defined for this symbol.

71

Multiplexer value already in use

Another multiplexer with the same value has already been defined for this symbol.

72

Redefinition of Multiplexer length for Symbol ...

The bit group of the multiplexer has already been defined with another length for this symbol. All multiplexers of a symbol must have the same length.

73

Redefinition of Multiplexer start for Symbol ...

The position of the bit group of the multiplexer has already been defined differently for this symbol. All multiplexers of a symbol must be in the same position.

74

Symbol first defined in section {...}

It has been tried to define a new multiplexer for a symbol, which has been defined originally in a different section. All multiplexers of a symbol must be defined in the same section.

75

Redefinition of Multiplexer byte order for Symbol ...

The byte order of the multiplexer has already been defined differently in the given symbol before (Intel/Motorola). See also Bit Sequence in Multiplexers.

76

The minimum data length of this Symbol is ... bytes

At least one multiplexer has been defined for the symbol. If the number of data bytes is not at least the same as the displayed value, the multiplexer bit group would be located partially or completely outside the valid data bytes.

77

Multiplexer bit group not specified in Picture parameter, or Multiplexer definition is missing

At least one multiplexer was already defined for the symbol. But either the multiplexer bit group wasn't specified once more in the Picture parameter, or the assignment of name and value to this multiplexer is missing (e.g. '*=name value').

78

Multiplexer bit group not specified in Picture parameter

At least one multiplexer has been defined for the symbol, but the multiplexer bit group hasn't been indicated in the Picture parameter.

79

A Symbol with the same Data Length Code is already defined

Multiple definitions for a symbol that has no multiplexer bit group are only allowed if every definition has a different Data Length Code.

80

Keyword 'Enum' expected

The keyword Enum is expected at the indicated position.

81

Enum name expected

The name of the enumeration to be defined is expected at the indicated position.

82

Enum redefinition

The highlighted enumeration already exists.

83

'(' expected

The character '(' is expected at the indicated position.

84

Comma or ')' expected

Either a comma or the character ')' is expected at the indicated position.

90

Invalid Data Length Code

The indicated Data Length Code of a CAN message is not in the valid range 0-8.

91

Function key already assigned

The given function key is already assigned.

92

Unknown Symbol

The highlighted symbol hasn't been defined anywhere.

93

Symbol ... is a receive-only Symbol

The given symbol is only defined for reception.

94

Multiplexer name expected

At the indicated position the name of a multiplexer is expected.

95

Multiplexer is not a member of this Symbol

The highlighted multiplexer hasn't been defined for the symbol indicated before.

96

Variable is not a member of this Multiplexer

The highlighted variable hasn't been defined for the multiplexer indicated before.

97

Macro not found

The highlighted Macro does not exist in the list of the loaded Macros.

110

Variable marker character expected

At the indicated position a placeholder for a variable is expected.

111

Variable name expected

At the indicated position the name of a variable is expected.

112

Data type expected

At the indicated position the indication of a data type is expected.

113

Option switch expected

At the indicated position an optional switch is expected.

114

Parameter identifier expected

At the indicated position a character is expected that identifies an optional parameter. Valid optional parameters are for example /d /f /m /o and /u.

120

'}' expected

The character '}' is expected at the indicated position.

121

Invalid section specifier

An invalid section specifier was specified.

122

']' expected

The character ']' is expected at the indicated position.

131

Comma expected

A comma is expected at the indicated position.

132

Data type no longer supported when using FormatVersion 5 or newer

The specified data type is no longer supported.

133

Only single CAN-IDs can be assigned to J1939 Parameter Groups

CAN-ID ranges are not allowed for symbols of type J1939PG.

134

Parent Symbol is not a J1939 Parameter Group

SPNs can only be defined for variables in symbols of type J1939PG.

135

Incorrect number of bits for data type 'Raw'

The length of variables that have the Raw data type must be a multiple of 8 bits.

136

Multiplexer definition Mux=... is missing

At least one multiplexer was already defined for the symbol, but the line Mux=... wasn't specified in a new multiplexer definition.

140

Bit start of variable cannot be higher than 63

All variables of a symbol, which is of the type Standard or Extended, must be located within the first 64 data bits.

141

Variable out of 64-bit bounds

All variables of a symbol, which is of the type Standard or Extended, must be located within the first 64 data bits.

145

This parameter requires an ANSI character, multi-byte characters are not allowed

The character code of the indicated character can only have a length of one byte.

146

Invalid Data Length

The specified data length is not possible.

147

Invalid CAN FD Data Length

The specified CAN FD data length is not possible. Possible data lengths for CAN FD are 0-8,12, 16, 20, 24, 32, 48, and 64 bytes.

148

A Symbol with the same Data Length is already defined

Multiple definitions for a symbol that has no multiplexer bit group are only possible if at least the data length is different in each symbol definition.

150

Keyword 'Sig' expected

Every signal definition in the {SIGNALS} must be in the form 'Sig=...'.

151

Signal name expected

The name of a signal is expected at the indicated position.

152

Signal name already in use

The highlighted signal name is already in use by another signal definition.

153

Signals cannot be shorter than 1 bit

Signals must have a minimum length of 1 bit.

154

Too many bits in signal

The length of the signal does not match the specified data type.

160

Integer value is not within the permitted range

The integer value is not within the permitted range of -2147483648 to 2147483647 (32-bit signed integer).

161

Hexadecimal value is not within the permitted range

The hexadecimal value is not within the permitted range of 0 to FFFFFFFFh (32-bit).

See also

Error Messages of Standard Macros


Error Messages of Standard Macros

Error messages of standard Macros are displayed in the Output window on the tab Messages. When an error occurs, the Output window is automatically shown if it hasn't been visible yet. An error number and a short description is always given.

Following errors can be displayed:

No. | Displayed Text | Description
201 | Missing value | At the indicated position a value is expected.
202 | Unknown keyword | The highlighted identifier does not represent a valid keyword or macro instruction.
203 | No Symbols available | A Symbol identifier has been used although no Symbols File is loaded at the present time.
204 | Argument must be 'True' or 'False' | The argument of an IF instruction may only be 'True' or 'False'.
205 | No 'IF' after 'IF' allowed | Directly after an IF instruction mustn't be any further IF instruction.
206 | Unknown label | The specified label hasn't been defined anywhere.
207 | Macro file format not supported | PCAN-Explorer 6 supports standard macro files up to the format 6.0.
208 | Too many arguments for macro instruction | The maximum number of allowed arguments for the indicated macro instruction has been exceeded.
210 | Invalid value | The highlighted passage does not produce a valid value.
211 | Value too long | The highlighted value exceeds the maximum length of 30 characters.
212 | String not terminated | The string value at the indicated cursor position has no terminating double quote character.
220 | Value too large for 8 bits | The given value is too big and doesn't fit into 8 bits or a byte respectively.
221 | Incorrect number of characters in string | The string parameter does not contain the demanded number of ASCII characters. At the declaration of data bytes of a Send instruction as a string, the number of characters in the string must tally with the number of data bytes.
222 | Value too large | The highlighted hex value contains too many bits.
223 | Decimal values not allowed for parameters larger than 4 bytes | It has been tried to assign a decimal value to a parameter although a value bigger than4 bytes is expected. This is not permitted. Such values must be indicated in hexadecimal format.
224 | Invalid binary value | Binary values must consist only of zeroes and ones.
225 | Invalid character in Raw data | Raw data strings must consist of hexadecimal characters: 0..9, A..F, a..f.
230 | DLC too large | The specified DLC value is too large. The highest allowed DLC value is 8.
231 | Invalid Data Length | The specified data length is too high. The highest possible data length of CAN messages is 8.
232 | Invalid CAN FD Data Length | The specified data length cannot be used with CAN FD. Valid data lengths for CAN FD are: 0..8, 12, 16, 20, 24, 32, 48, 64.
235 | Invalid operator | The highlighted text could not be identified as a valid operator for the CheckSignal instruction.
240 | Unknown symbol | The highlighted Symbol hasn't been defined anywhere.
241 | Multiplexer not a member of this Symbol | The highlighted multiplexer hasn't been defined for the Symbol indicated before.
242 | Unknown signal | A signal with the specified name does not exist.
250 | Invalid bus number | The specified bus number is too high. The highest allowed bus number is 16.
251 | Unknown connection | A connection with the specified name does not exist.
252 | Specifying 'AnyBus' is not allowed here | Specify a bus number between 1 and 16 when using symbolic messages.
253 | No default bus specified | For macro file formats older than version 5.0, specify a default bus using a Bus=... parameter. See also Bus Keyword.

See also

Error Messages of Symbol Files


Hardware Status

The status of a PCAN hardware can either be displayed in the Connections window or in Trace windows

The following tables describe the status indicators, which, depending on the used CAN hardware and the installed PCAN driver may occur.

The following status indicators can occur if a PCAN driver with a version number 4 or later is installed for the used CAN hardware, and if PCAN-Explorer is connected to another CAN hardware as a PCAN-USB, PCAN-USB Pro, or PCAN-USB Hub:

Status Description

OK

The CAN controller is in the "Error Active" state, i.e. all error counters are below the threshold 128.

Error Passive

The CAN controller is in the "Error Passive" state, i.e. at least one error counter reached the threshold 128.

Possible causes: the hardware is not connected correctly to the CAN bus, or an incorrect bit rate was selected.

Warning

One of the error counters reached the threshold for "Error Warning Limit", which is at 96 by default.

Bus-Off

The CAN controller has entered the "Bus-Off" state because a serious and continuous error exists on the bus (255 error points have been exceeded).

A possible cause can be a short circuit on the bus.

OVERRUN

The CAN controller receives so many messages that not all of the triggered hardware interrupts can be processed.

QOVERRUN

The reception queue is full.

The internal processing speed of the application is not high enough that all messages can be processed, which were written in the application's receive queue by the device driver.

QXMTFULL

The transmit queue is full.

The device driver is not able to send all messages to the CAN controller that were written into its transmit queue. Possible causes can be a low bit rate, high bus load, or an error on the bus. This error occurs with delay, since the transmit queue has to be filled completely first. The transmit queue has a size of 32767 messages.

The following status indicators can occur if a PCAN driver with a version number smaller than 4 is installed for the used CAN hardware, or if PCAN-Explorer is connected to a PCAN-USB, PCAN-USB Pro, or PCAN-USB Hub:

Status Description

BUSLIGHT

Bus error: one of the error counters of the CAN controller reached the "light" limit (more than 0 error points).

BUSHEAVY

Bus error: one of the error counters of the CAN controller reached the "heavy" limit (at least 96 error points).

Possible causes: the hardware is not connected correctly to the CAN bus, or an incorrect bit rate was selected.

Bus-Off

The CAN controller has entered the "Bus-Off" state because a serious and continuous error exists on the bus (255 error points have been exceeded).

A possible cause can be a short circuit on the bus.

OVERRUN

The CAN controller receives so many messages that not all of the triggered hardware interrupts can be processed.

QOVERRUN

The reception queue is full.

The internal processing speed of the application is not high enough that all messages can be processed, which were written in the application's receive queue by the device driver.

QXMTFULL

The transmit queue is full.

The device driver is not able to send all messages to the CAN controller that were written into its transmit queue. Possible causes can be a low bit rate, high bus load, or an error on the bus. This error occurs with delay, since the transmit queue has to be filled completely first. The transmit queue has a size of 32767 messages.

See also

Receiving and Transmitting CAN Messages


Argument Macros

Argument macros are variables that PCAN-Explorer supplies values for when

  • an external tool is launched from the Tools menu

  • a file is opened by an Add-in or a VBScript Macro using the Open method

  • a file is saved by an Add-in or a VBScript Macro using the Save method.

Argument Macros, whose result is a directory name, are also called Directory Macros in this documentation.

PCAN-Explorer provides the argument macros shown in the following table:

Name | Argument | Is expanded to a text with this contents
Current Directory | $(CurDir) | The current working directory (defined as drive+path).
File Directory | $(FileDir) | The directory of the active document (defined as drive+path); blank if no document is active.
File Extension | $(FileExt) | The filename extension of the active document; blank if no document is active.
File Name | $(FileName) | The filename of the active document (defined as filename); blank if no document is active.
File Path | $(FilePath) | The complete file name of the active document (defined as drive+path+filename); blank if no document is active.
Project File | $(PrjFile) | The name of the active Project file (defined as filename); blank if no Project is currently opened.
Project Directory | $(PrjDir) | The directory of the active Project file (defined as drive+path); blank if no Project is currently opened.
Project Path | $(PrjPath) | The complete file name of the active Project file (defined as drive+path+filename); blank if no Project is currently active.
Default Projects Directory | $(DefPrjDir) | The directory that is defined as the root directory for PCAN-Explorer Projects (see Library, Options Dialog Box).
Library Directory | $(LibDir) | The root directory of the PCAN-Explorer Library (see Library, Options Dialog Box).
Symbols Files Library Directory | $(LibSymDir) | The Library directory for Symbol Files (see Library, Options Dialog Box).
Macros Library Directory | $(LibMacroDir) | The Library directory for Standard Macros (see Library, Options Dialog Box).
VBS Macros Library Directory | $(LibVBSMacroDir) | The Library directory for VBS Macro files (see Library, Options Dialog Box).
Transmit Lists Library Directory | $(LibXmtDir) | The Library directory for Transmit Lists (see Library, Options Dialog Box).
Trace Files Library Directory | $(LibTraceDir) | The Library directory for Trace Files (see Library, Options Dialog Box).
Desktop Directory | $(Desktop) | The Desktop directory of the current user.
My Documents Directory | $(MyDocsDir) | The "My Documents" directory of the current user.
Common Documents Directory | $(CommonDocsDir) | The documents directory that all users can access, usually: \Documents and Settings\All Users\Documents\ for Windows XP, \Users\Public\Documents\ for Windows Vista and later.
Application Directory | $(AppDir) | The directory, into which PCAN-Explorer is installed.
Note

Macro recognition is not case sensitive. All Directory Macros do not end in a backslash (\).

See also

Arguments for External Tools


How Add-ins are notified when sending Messages

Home Page (Add-ins) | Overview | How do I ...? | Reference

If an Add-in wants to be notified when messages are sent, it must expose a TransmitCallback object and register a pointer to its COM interface at the TransmitMessages collection.

TransmitCallback Object

An Add-in must expose a TransmitCallback object, if it wants to be notified when messages are sent. PCAN-Explorer uses the TransmitCallback object to notify the Add-in before and after it sends messages by calling the OnBeforeTransmit and OnAfterTransmit methods.

An Add-in exposes a TransmitCallback object by implementing the COM interface IPETransmitCallback, and by calling the RegisterCallback method to register the object for the corresponding notifications.


OnMessageReceived Event

Applies to: J1939Node object

Occurs after a J1939 message has been received.

Attention

Do not use this event in VBS macros. It has turned out that it does not work reliably in this context and no solution can be provided.
Syntax

object_OnMessageReceived ( node, count )

Parameters

object

An expression that evaluates to a J1939Node object.

node

The J1939Node object that triggers this event.

count

A Long that specifies the number of messages that are currently in the node's receive queue.


NotificationOnSessionEvents Property

Applies to: J1939Node object

Sets or returns whether the J1939Node object triggers session events.

Syntax

object.NotificationOnSessionEvents [=value]

Parameters

object

An expression that evaluates to a J1939Node object.

value

A Boolean that specifies the new value of the property.

Property value

A Boolean value that specifies whether the J1939Node object triggers session events. If True, events are triggered. If False (the default), events are not triggered.

Remarks

If activated, the J1939Node object triggers OnReadSessionBegin, OnWriteSessionEnd, and OnSessionAbort events.


Symbols in the Receive List

If a Symbols File is assigned to a connection, the Symbol column of the Receive List can show the names of the Symbols that are compatible with the messages in the List.

The following columns are displayed by default:

Bus

The bus number of the connection from which a message was received (1-16).

CAN-ID

The CAN-ID of the message in hexadecimal representation. 11-bit CAN messages are displayed with a 3-digit CAN-ID (0-7FFh), 29-bit CAN messages according to CAN protocol 2.0B are displayed with a 8-digit CAN-ID (0 - 1FFFFFFFh).

Length

The number of data bytes of the message.

Symbol

The name of the Symbol that is compatible with the message.

If also a Multiplexer was defined for the Symbol and the contents of the message's data bytes match to a Multiplexer, the Symbol name is displayed in the form Symbol.Multiplexer.

Data

The names of the variables and their current values.

If more than one variable was defined for the Symbol or Multiplexer, then the Plus icon [image] is shown. You can expand the line by either clicking on the Plus icon using the mouse, or by selecting the line and pressing the right cursor key. Collapsing the variables can be done accordingly by selecting the Minus icon or by pressing of the left cursor key. To expand or collapse all Symbols in the list simultaneously, press the key combinations [Shift+Arrow-right] or [Shift+Arrow-left].

Timeouts

The number of the timeouts that have occurred for the Symbol/Multiplexer since the last time the Reset command was executed.

Cycle Time

The time interval between the last two reception events of the message, in Milliseconds.

Count

The number of received messages since the last time the Reset command has been executed.

See also

Receive List

Symbols in Transmit Lists


Symbols in Transmit Lists

Just like in the Receive List, the Symbol column in Transmit Lists can show the names of the Symbols that are compatible with the messages in the list, if a Symbols File is assigned to a connection.

The following columns are displayed by default:

Bus

The bus number of the connection on which the message is transmitted (1-16).

CAN-ID

The CAN-ID of the message in hexadecimal representation. 11-bit CAN messages are displayed with a 3-digit CAN-ID (0-7FFh), 29-bit CAN messages according to CAN protocol 2.0B are displayed with a 8-digit CAN-ID (0 - 1FFFFFFFh).

Length

The number data bytes of the message.

Symbol

The name of the Symbol that is compatible with the message.

If also a Multiplexer was defined for the Symbol and the contents of the message's data bytes match to a Multiplexer, the Symbol name is displayed in the form Symbol.Multiplexer.

Data

The names of the variables and their current values.

If more than one variable was defined for the Symbol or Multiplexer, then the Plus icon [image] is shown. You can expand the line by either clicking on the Plus icon using the mouse, or by selecting the line and pressing the right cursor key. Collapsing the variables can be done accordingly by selecting the Minus icon or by pressing of the left cursor key. To expand or collapse all Symbols in the list simultaneously, press the key combinations [Shift+Arrow-right] or [Shift+Arrow-left].

Cycle Time

The time interval, in which a message is sent periodically. If the cycle time is set to 0 ms, then the text Wait is shown. This means the message will be sent only manually.

Count

The number of transmitted messages since the last time the Reset command was executed.

Trigger

The reason for the last sending of the message. The following reasons for sending a message can be displayed:

  • Manual The message was sent by the user manually.

  • Time The message was sent because of the defined cycle time.

  • RTR The message was sent in response to a received Remote Request Frame.

  • Macro The message was sent by a Standard Macro.

  • Automation The message was sent by a VBS Macro, or by an external program that runs PCAN-Explorer as an Automation server.

  • RQST: The message was sent as a response to a J1939 Request (PGN 59904).

Creator

This column identifies the creator of a message.

See also

Default Transmit List

Working with Transmit Lists

Symbols in the Receive List


Registering PCAN-Explorer

Home Page (Reference)

If you have installed a trial version of PCAN-Explorer, the program will cease to work after the evaluation period has expired. When trying to start the program, only a dialog with a corresponding message is displayed.

To make PCAN-Explorer work again, consider purchasing the software. To purchase the software, either contact PEAK-System Technik GmbH or your local distributor.

When you have received your purchased copy of the software, it is recommended first to uninstall the evaluation version and then to install the software you have received on CD, or by downloading it.

In exceptional cases it is also possible to extend the trial period, which is carried out via the button Update License.

See also

License Update Dialog Box


Customize Dialog Box

The Customize dialog box allows you to customize the toolbars of PCAN-Explorer. To access the Customize dialog box, select Customize from the Tools menu.

The following topics provide detailed information about tasks that can be performed in the Customize dialog box.

To | See
Show or hide toolbars | Toolbars, Customize Dialog Box
Create a new toolbar | Toolbars, Customize Dialog Box
Change the commands displayed on a toolbar | Commands, Customize Dialog Box
Reset a toolbar to its default configuration | Toolbars, Customize Dialog Box
Show large icons on toolbars | Options, Customize Dialog Box
Change menu animations | Options, Customize Dialog Box

See also

User Interface


Commands, Customize Dialog Box

The Commands tab displays the commands you can drag and drop onto a toolbar or menu.

Categories

Lists the available command categories, such as File and Edit.

Commands

Lists all the available commands for the category selected in the Categories list box. The icon to the left of the command is the button that will appear on the toolbar or in a menu item.

Description

Displays a short description for the selected command.

See also

Customize Dialog Box


Options, Customize Dialog Box

The Options tab allows you to customize several options of menus and toolbars.

Large Icons

Increases the size of toolbar icons so that they are easier to see.

Show ToolTips on toolbars

Displays tooltips for toolbar buttons when you move the mouse over the button.

Show shortcut keys in ToolTips

Displays any toolbar button shortcut keys in the tooltip text.

Menu animations

Selects an animation effect, which is used to display menus.

See also

Customize Dialog Box


Toolbars, Customize Dialog Box

The Toolbars tab lists the toolbars you can show, hide, and reset. You can access this tab by selecting Customize on the Tools menu, and then choosing Toolbars.

Toolbars

Shows all available default toolbars, and all toolbars of Add-ins. If a toolbar is displayed, a check mark appears besides the name.

Show ToolTips

If this option is activated, short hint texts are shown at the mouse cursor when it is positioned on toolbar buttons.

Reset

Returns any selected toolbar to its default configuration.

See also

Customize Dialog Box


License Update Dialog Box

If you use a retail version of PCAN-Explorer, you can use the License Update Dialog box to modify your PCAN-Explorer license if no Internet connection is available, or if you use a portable license with a copy protection dongle.

If you have a trial version of PCAN-Explorer installed, you can use the License Update Dialog box to modify your PCAN-Explorer license without having to install a new license file.

Modifying the PCAN-Explorer license requires contacting the PEAK customer support team.

User Code 1/2

If the license modification has been approved by the our customer support team, you must submit these codes to the customer support, along with your License ID. The customer support team then returns two registration codes, which you then enter in the following Registration Code fields.

After you have submitted the User Codes, you can close the dialog box or even exit the application while you wait for a response of the customer support. The next time you open up the dialog box, the same codes will be displayed. The User Codes will not change until the license update process is completed.

Registration Code 1/2

You receive these codes from PEAK customer support after the license modification has been approved. Enter the codes in the corresponding fields and press OK.

Attention

If you enter more than 3 times incorrect registration codes, the displayed User Codes are invalid. The next time you open the dialog box, new User Codes are displayed and you have to re-submit the User Codes to the PEAK customer support to repeat the procedure.


Export Trace Data Dialog Box

Use the Export Trace Data dialog box to export data from recorded CAN messages to Text or CSV files. To display the Export Trace Data dialog box, activate a Trace window, then select the Export command from in the File menu.

Path

Determines the path and the name of the file, into which the data is exported. The drop-down list contains path names of the most recently used files. Use the ... button next to the drop-down list to open a dialog box where you can browse for a file path.

Time stamps

Selects the format of the time stamps. Available options are:

Option Description

Relative in Milliseconds

Saves time stamps of the recorded CAN messages as time offsets relative to the beginning of the recording, in Milliseconds.

Relative in Seconds

Saves time stamps of the recorded CAN messages as time offsets relative to the beginning of the recording, in Seconds.

Absolute - formatted

Saves time stamps of the recorded CAN messages as absolute times. The time values are formatted according to the Format of absolute timestamps setting in the Options dialog box.

Absolute - raw values

Saves absolute time stamps as floating point values. The integral part of such a value is the number of days that have passed since December 30, 1899. The fractional part is the fraction of a 24-hour day that has elapsed.

Microsoft Excel can natively understand these values by formatting a cell containing the value as Date or Time, or a combination of both.

Text Tab

If you select this tab, trace data will be exported to a text file. Use the options on this tab to adjust the text output according to your requirements.

Write As

Option | Description
Hex | Saves all recorded messages into the file. CAN-IDs and data bytes are saved as hexadecimal values.
Symbolic | Saves only those messages, for which a symbolic representation is available due to an activated Symbols File.
Hex + Symbolic | Saves all recorded messages into the file. If a symbolic representation is available for a message due to an activated Symbols File, the symbolic output is used. Otherwise, messages are saved in hexadecimal representation.

Options

Option | Description
Include Header | Inserts a file header with details on the creation date, active buses, saving location, and column descriptions at the beginning of the log file.
All variables in same row | Aligns all Variables of a Symbol next to each other, without line breaks, in one row.
New Line after Multiplexer | Writes a line break after the Multiplexer name, so that the Variables and their values appear on a new line. The first Variable is left-aligned with the Multiplexer name.
All variables in same column | Aligns all Variables of a Symbol one below the other, in one column.
Only marked variables | Writes only those Variables into the log file that have an enabled Trace switch.

Columns

These options determine the columns that are written into the file. Depending on whether a Symbols File is active or not, the following columns are available:

Column | Description
Number of message | Contains a continuous numbering of the messages.
Time / Time offset | The time stamps of the messages (see Time stamps setting above).
Type of event | The types of messages, e.g. Rx, Tx, Warning, Error.
Message ID | The CAN-IDs of the messages.
Data Length Code | The Data Length Codes of the messages.
Message Data | The data bytes of the messages, as hexadecimal values.
Symbol / ID | If the data is exported symbolically, this column contains either the CAN ID's of the messages or the names of the Symbols.
Multiplexer / DLC | If the data is exported symbolically, this column contains either the Data Length Codes of the messages, or the names of the Multiplexers that match to the corresponding messages.
Variables / Data | If the data is exported symbolically, this column contains either the data bytes of the messages, or the Variables defined for them and their current values.

CSV Tab

If you select this tab, trace data will be exported to a CSV file. If you press OK and this tab is active, PCAN-Explorer first searches the selected trace file for Signal information, and then opens a dialog box where you can select the signals you would like to export.

Decimal Separator

Determines the decimal separator that is used for the values in the file. If the Automatic setting is selected, the decimal separator is determined by the Region and Number format setting in the Windows Control Panel.

Column Separator

Determines the character that is used to separate the individual columns in the file.

If the Automatic setting is selected, the column separator depends on the decimal separator:

  • If the decimal separator is a Point, the column separator will be a Comma.

  • If the decimal separator is a Comma, the column separator will be a Semicolon.

Time Column

Determines how timestamps of signals are stored in the file:

  • Individual Columns for each Signal: Each signal gets two columns in the file, which contain the value pairs of timestamp and signal value.

  • Common column for all Signals: The first column in the file is a common time column. The other columns contain only the values of signals at the respective time.

See also

Exporting Recorded Data