Skip to main contentOpen topic with navigation
CAPL Functions » VT System » SerialReceive
SerialReceive
Valid for: CANoe DE • CANoe:lite DE
Note: The function can only be called on system variable namespaces of channels that represent an external power supply in a power module VT7001 respectively the system variable namespace that represents functionality common for the entire VT7001 module.
Method Syntax
long SysVarNamespace.SerialReceive( byte buffer[], dword size);
Description
Starts receiving blocks of bytes from the serial port of the specified VT7001 channel. Received data is copied to the specified buffer. The data can only be accessed in the OnSerialReceive callback.
- The operation works continuous if issued once
- If another receive operation will be given, the result buffer will change to that one given by the last receive operation.
- A callback handler has to be set for notification when data has been received. See SerialSetOnReceiveHandler.
- Another callback handler can be set to notify of errors in later stages of the send operation. See SerialSetOnErrorHandler.
The used serial port has to be opened first.
Parameters
- buffer: An array of bytes where received data is copied to. The buffer is only valid within the OnSerialReceive callback.
- number: Maximum number of Bytes which can be received at a time. Must have a value > 0 and < 65.
Return Values
- 0: Successful call
- -1: Non-specific error
- -2: The namespace on which the command was called does not exist, is not a valid VT System namespace or does not support this command.
- -3: One of the parameters has an invalid value.
- -5: Serial port is not open.
Example
See example SerialConfigure