| aBus_ReadPadChar | Index |
Definition:
Parameters:
| cModule | - | The address of the remote module you want to read a value from. |
| cIndex | - | The index of the char to be retrieved from the remote scratch pad. |
Return Value:
Description:
This routine retrieves a char value from the scratch pad. An char takes up one byte in the scratch pad. The index cIndex is the address of that byte.
The scratch pad is accessible by all processes and reflexes. It provides a convenient means for parameter passing between processes and reflexes and is more efficient than using semaphores. It is the user's responsibility to keep track of scratch pad locations and prevent overwriting of data.
The GP 1.0 module has 32 bytes of scratch pad RAM. It can store up to 16 int values. Because an int is 2 bytes, valid indexes for storing and retrieving an int are 0-30. The index does not have to be an even number. (Some firmware versions may require an even index. )
When the desired scratchpad is on the Brainstem that is running the routine, it is more efficient to use the aPad_ReadChar routine.
| Note: | This routine is available in builds later than build 60323. |
Example:
c = aBus_ReadPadChar(2,0);
This would read one byte on module 2 scratchpad and store into value c.
Related: