- Reference
- Script reference
- Fields and registers
GetRegister
Get the value of a register
Description#
GetRegister( deviceno, registerno, {type} )Fetches the value of a register
Parameters#
deviceno | Device number (1-40) |
registerno | Which register to fetch |
type | (optional) a variable that will be set to the register type (NULL/UINT/INT/FLOAT) |
Return value#
The value of the register
Example usage#
new x, type;
AllocateRegisters(3, 8); // Allocate eight registers for device 3
SetRegister(3, 1, 1234, INT); // Set register 1 on device 3 to the value 1234
x = GetRegister(3, 1);
// x is now 1234
x = GetRegister(3, 1, type);
// type will be INT
Last updated Aug 14, 2020