Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
OpCanAc2 Monitor
Block
Mask
Description
The OpCanAc2 Monitor probes all messages, both transmitted and received, on a CanAc2 port.
Parameters
Controller ID | ControllerID refers to the OpCanAc2 Ctl block where the Can-Ac2 port configuration is provided. |
---|---|
Maximum number of packet | The maximum number of packets that could be received in a single calculation step. It is advised to make this number a little bigger than what is actually expected. Otherwise, exceeding packets will not be saved for the following steps. |
Data unpacking | This option allows to format data unpacking for compatibility with other devices. 2 notions are implied. The first specifies if the unpacking of the signal should be started from the start or end of the packet. If Signal 1 to N is selected, the packing will start from the less significant bits of the first transmitted byte. If Signal N to 1 is selected, unpacking will start from the most significant bits of the last transmitted byte and progress backward into the packet. The second specifies if groups of 8, 16 or 32 bits must be permuted within the packet with respect to its middle boundary. Swapping is performed before extracting signals. |
'Signal 1 to N - No swapping' | corresponds to the Intel format while'Signal N to 1 - Swap 8-bit' corresponds to the Motorola format. |
Create log file | When this option is checked, all messages are logged into a mat file, which is written at runtime by a low priority thread. This option is not supported in XHP mode. |
The following parameters are used only when the Create log file option is checked: | |
Log memory buffer size | Number of entries that the application can log into memory before placing data into the file. Since an RT-LABmodel is executed real-time, writing into a file has to be done by a lower priority thread to avoid overruns. This thread writes data when time is available and in case of time be missing, it is important to have a memory buffer large enough to keep messages in memory until the time is available to write to the file. This value should never be less than twice the Number of samples between writes or twice the sum of Packets Before and after Trigger when using trigger model. It should be much larger than those limits to prevent data loss. The mat file contains 1 variable in which each column represents one message and rows contain the following values:
|
Log file name | Name of the file, including the path. If no path is selected, the file will be placed in the model directory on the target node. The file name must have the extension '.mat'. |
Static file name | This option allows the user to dynamically change the mat file log during model execution. Selecting this option makes a new inport appear. The user must use it to input an ID that will be used to create the name of the mat file log. The name of the mat file log follows the pattern: <Log file name parameter value without extension>_<ID input by the user>.mat A change in the ID input triggers the closing of the current log file and the opening of a new log file. The name of the new log file is based on the new ID. At the end of the simulation, after model reset, all log files will be transferred to the host. The user may individually transfer one or more log files to the host for further analysis, before the end of the simulation. By default, this feature is not available. |
Note: when this option is activated, the ID affects also the Log variable name that will be constructed following the pattern described below:
<Log variable name>_<ID input by the user>
Log variable name | Name of the Matlab variable created for the Mat file. |
---|---|
Number of samples between writes | The minimum number of log entries(packets) that are cumulated into memory before writing to a file. This number should be smaller than half of Log memory buffer size. |
Maximum file size (Mb) | Maximum size of the log file. When this size is reached, file logging stops and file-logging overrun messages may appear in the RT-LAB display. |
Use trigger | This option allows the user to trigger when the logging starts and end. Selecting this option make a block inport appear. Logging to the file then starts when a rising edge (0 to 1) is detected at the inport. This allows users to narrow the file logging around some desired time value, and thus save disk space. |
Packets to save before trigger | Specifies the number packets that came in before the trigger signal that is to be saved into the log file. The logging may not start at the exact step when the trigger was requested so it is safer to set this value large enough to obtain packets for several steps before the trigger. |
Packets to save after trigger | Specifies the number packets that came in after the trigger signal that is to be saved into the log file. The logging may not start at the exact step when the trigger was requested. |
Inputs
This block has no inports.
Outputs
Number of packet | The number of messages received since the last block execution. |
---|---|
Packet X | As many Packet outputs are created as the number specified in the Maximum number of packet parameter. These outports have a width of 8 signals and are used to output the data from each message. |
IDs | The outport returns the identifiers of the received messages. This outport has a width equal to the Maximum number of packets parameter. |
Timestamps | This outport returns the timestamps of the messages. Its width is equal to the Maximum number of packets parameter. |
DLCs | This outport returns the DLCs from the received messages. Its width is equal to the Maximum number of packets parameter. |
Error | Specifies if an error occurred. Possible values are:
|
Characteristics and Limitations
When using file logging, it is possible that, if the hard drive is running out of space (maybe 300 Mb or less), writing to the file may take more time than expected (as continuous free blocks are getting scarcely available on disk) and file data may be lost. A logging buffer overrun then occurs and a message appears in the RT-LAB display.
Also, should the hard drive get full, model overruns may occur during actual accesses to the file.
CanAc2 Host Simulation
CanAc2 blocks now support execution of user-specific code duringWin32 target simulation. For more information, please refer to the CanAc2 Host Simulationdocumentation
CanAc2 Monitor Data Decoding
CanAc2 Monitor block has been conceived to monitor all message's types transmitted over the bus, therefore there is no message structure associated with this block. In spite of this behavior, it is still possible to decode signal values embedded within the 8-value vector reported in PacketX outport. Click here to access the decodification process.
Direct Feedthrough | No |
---|---|
Discrete sample time | No |
XHP support | Yes. File logging not supported. |
Work offline | No |
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter