| aBus_WritePadInt | Index |
Definition:
Parameters:
| cModule | - | The address of the remote module you want to write a value to. |
| cIndex | - | The index of the scratchpad for storing the int value. |
| nData | - | The value to be stored. |
Return Value:
Description:
This routine writes a int value into the scratch pad on a remote module specified by cModule. The bytes are stored in high-byte low-byte order. An int takes up two values in the scratch pad. The index cIndex is the scratchpad address of the high 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_WriteInt routine.
| Note: | This routine is available in builds later than build 60323. |
Example:
aBus_WritePadInt(2,0,1234);
This would write the char value 7 on module 2 scratchpad location 0. This would write the int value 1234 into module 2's scratchpad bytes 0 and 1. (Technically, module 2's scratchpad 0 will store the byte 4 and scratchpad 1 will store the byte 210. When these are combined they for a 16 bit word of 1234.)
Related: