13.07.2015 Views

VCI - Virtual CAN Interface - Ixxat

VCI - Virtual CAN Interface - Ixxat

VCI - Virtual CAN Interface - Ixxat

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Interface</strong> description4.3.2.11 canChannelReadMessageThe function reads the next <strong>CAN</strong> message from the receive buffer of a messagechannel. The complete syntax of the function is:HRESULT canChannelReadMessage(HANDLE hChannel,UINT32 dwMsTimeout,P<strong>CAN</strong>MSG pCanMsg );Parameters:hChannel[in] Handle of the opened message channel.dwMsTimeoutMaximum waiting time in milliseconds. The function returns to the callerwith the error code <strong>VCI</strong>_E_TIMEOUT if no message was read or receivedwithin the specified time. With the value INFINITE (0xFFFFFFFF), the functionwaits until a message has been read.pCanMsg[out] Pointer to a structure of type <strong>CAN</strong>MSG. If run successfully, thefunction saves the read <strong>CAN</strong> message in the memory area specified here.Return value:If run successfully, the function returns the value <strong>VCI</strong>_OK. If the time periodspecified in the parameter dwMsTimeout has elapsed without a messagehaving been received, the function returns the error code <strong>VCI</strong>_E_TIMEOUT. Inthe event of an error, the function returns an error code not equal to <strong>VCI</strong>_OKor <strong>VCI</strong>_E_TIMEOUT. Further information on the error code is provided by thefunction vciFormatError.If the value ZERO is specified in the parameter pCanMsg, the function removesthe next <strong>CAN</strong> message from the receive buffer.Comments:If the handle specified in hChannel is closed from another thread, the functionends the current function control and returns with a return value not equal to<strong>VCI</strong>_OK.68Copyright IXXAT Automation GmbH C-API Programming Manual, Version 1.5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!