canFilterCreateOnce (Function) |
Top Previous Next |
This will create a receive filter similar to canFilterCreate but with automatic destruction after the first valid message has been received (one shot). When a filter has been successfully created, the function returns an ID for the filter. This ID can be used to check the status of the filter with canFilterStatus. It is recommended to check if a filter is still active (no valid message received) before creating it again. When using multiple one shot filters, it is mandatory to destroy the filter with canFilterDestroy before creating the filter again. If one is only using a single one shot filter, it is optional to destroy it. Note: the filter created with this function will add the received message both to the internal buffer and to the Logger.
Please see the canFilterCreate function for more information on working with receive filters.
Input: port : SINT (1/2) (default 1) The port of the CAN bus.
xtd : BOOL Filter for standard or extended identifiers. Set to TRUE for extended identifiers.
startID : DINT (16#0...16#1FFF_FFFF) The first identifier that is accepted.
length : DINT (16#1...16#2000_0000) The length of the range of identifiers that are accepted. For a single identifier, the length should only be set to 1.
Returns: SINT
Declaration: FUNCTION canFilterCreateOnce : SINT;
Example: INCLUDE rtcu.inc |