xPCGetLoadTimeOut - Return timeout value for communication between host PC and target PC

Prototype

int xPCGetLoadTimeOut(int port);

Arguments

port

Enter the value returned by either the function xPCOpenSerialPort or the function xPCOpenTcpIpPort.

Return

The xPCGetLoadTimeOut function returns the number of seconds allowed for the communication between the host PC and target application. If there is an error, this function returns -1.

Description

The xPCGetLoadTimeOut function returns the number of seconds allowed for the communication between the host PC and the target application. When an xPC Target API function initiates communication between the host PC and target PC, it waits for a certain amount of time before checking to see if the communication is complete. In the case where communication with the target PC is not complete, the function returns a timeout error.

For example, when you load a new target application onto the target PC, the function xPCLoadApp waits for a certain amount of time before checking to see if the initialization of the target application is complete. In the case where initialization of the target application is not complete, the function xPCLoadApp returns a timeout error. By default, xPCLoadApp checks for the readiness of the target PC for up to 5 seconds. However, in the case of larger models or models requiring longer initialization (for example, those with thermocouple boards), the default of about 5 seconds might not be sufficient and a spurious timeout is generated. Other functions that communicate with the target PC will wait for timeOut seconds before declaring a timeout event. The function xPCSetLoadTimeOut sets the timeout to a different number.

Use the xPCGetLoadTimeOut function if you suspect that the current number of seconds (the timeout value) is too short. Then use the xPCSetLoadTimeOut function to set the timeout to a higher number.

See Also

API functions xPCLoadApp, xPCSetLoadTimeOut,

xPCUnloadApp

Increasing the Time-Out Value in the Getting Started withxPC Target documentation.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS