SIMulation Workbench Documentation SIMulation Workbench Documentation

EB5100 board access API
[SimWB RT functions]

Collaboration diagram for EB5100 board access API:

Functions

int ccurEB5100_outputQueueMap (int init)
int ccurEB5100_outputQPut (EB5100OutQElement *e, int nElements, void *str, int length)
int ccurEB5100_outputQGet (EB5100OutQElement *e, int *nElements, void *str, int *length)
int ccurEB5100_startCommunication (int boardNum)
int ccurEB5100_stopCommunication (int boardNum)
int ccurEB5100_commitFrame (int boardNum, int frameIndex)
int ccurEB5100_enableSendFrame (int boardNum, int frameIndex)
int ccurEB5100_disableSendFrame (int boardNum, int frameIndex, int frameType, int nRepetitions)
int ccurEB5100_getLastError (int boardNum)

Detailed Description

This API is used by program running on the Real-Time host to access th EB5100 board output queue and start and stop FlexRay communication on the board.
Programs wishing to use this library must link agains the libccur_IOUtil.a library.
Before using any of the routines described here, the program must first map the output queue by calling ccurEB5100_outputQueueMap(0).


Function Documentation

int ccurEB5100_outputQueueMap ( int  init  ) 

Map the EB5100 output queue into the user process.

Parameters:
init Set to 1 to initialize the queue. Use 0 just to map the queue without initializing it.
The EB5100 output process initializes the queue, so user processes should never call this function with init == 1 .
Return values:
0 on Success < 0 if there was an error mapping the queue.
int ccurEB5100_outputQPut ( EB5100OutQElement *  e,
int  nElements,
void *  str,
int  length 
)

Place an element in the output queue.
The put and get routines are used internally by the eb5100 I/O processes and should not be used by user programs.

Parameters:
e An array of EB5100OutQElement to place in the queue.
nElements The number of elements in the array.
str If the value to put in the queue is a string variable, str points to the string variable value. For scalar variable, the value is placed in the qElement.doubleValue and str should be NULL.
length The length of the string variable if str is present. The EB5100 output process initializes the queue, so user processes should never call this function with init == 1 .
Return values:
0 on Success < 0 if the queue was full .
int ccurEB5100_outputQGet ( EB5100OutQElement *  e,
int *  nElements,
void *  str,
int *  length 
)

Get the top element from the output queue.
The put and get routines are used internally by the eb5100 I/O processes and should not be used by user programs.

Parameters:
e An array of EB5100OutQElement to place in the queue.
nElements The number of elements in the array.
str If the value in the queue is a string variable, str points to the string variable value where the data is stored. For scalar variable, the value is placed in the qElement.doubleValue and str should be NULL.
length Pointer to an integer where the number of bytes of data in the string variables is placed. The EB5100 output process initializes the queue, so user processes should never call this function with init == 1 .
Return values:
0 if the queue is empty. 1 if the element corresponds to a scalar value. 2 if the element corresponds to a string variable. In this case str is filled with the data and len is updated with the number of bytes returned in str. < 0 if the queue was full .
int ccurEB5100_startCommunication ( int  boardNum  ) 

Start the FlexRay communication on the specified eb5100 board.

Parameters:
boardNum the board number on which to start the communication. The first board in the system is board number 1.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queueis full.
int ccurEB5100_stopCommunication ( int  boardNum  ) 

Stop the FlexRay communication on the specified eb5100 board.

Parameters:
boardNum the board number on which to start the communication. The first board in the system is board number 1.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queue is full.
int ccurEB5100_commitFrame ( int  boardNum,
int  frameIndex 
)

Commit the Flexray frame whose index is given.

Parameters:
boardNum The board number on which to commit the frame . The first board in the system is board number 1.
frameIndex The index of the frame to commit.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queue is full.
int ccurEB5100_enableSendFrame ( int  boardNum,
int  frameIndex 
)

Enable sending of the Flexray frame whose index is given.

Parameters:
boardNum The board number on which to commit the frame . The first board in the system is board number 1.
frameIndex The index of the frame to enable.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queue is full.
int ccurEB5100_disableSendFrame ( int  boardNum,
int  frameIndex,
int  frameType,
int  nRepetitions 
)

Disable sending of the Flexray frame whose index is given and for a number of repetitions.

Parameters:
boardNum The board number on which to commit the frame . The first board in the system is board number 1.
frameIndex The index of the frame to enable.
frameType The type of frame so send: 0 to send a NULL frame instead , 1 to remove the frame from the bus altogether.
nRepetitions The number of cycles to disable the frame. A value of 0 means repeat forever.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queue is full.
int ccurEB5100_getLastError ( int  boardNum  ) 

Retrieve last error from EB5100 firmware. The error string is place in the RTDB _EB_ErrorString variable

Parameters:
boardNum The board number on which to commit the frame . The first board in the system is board number 1.
Return values:
0 on Success < 0 if the EB5100 asynchronous output queue is full.