SetRegisterType
Set the type of a register and attempt to retain the value
Description
SetRegisterType( deviceNo, registerNo, newtype )
Tries to set the value of a register without changing the value.
Parameters
deviceNo | Device number |
registerNo | Register number |
newtype | Desired type, NULL, INT or FLOAT |
If the desired type is NULL, the register will be set to the value 0.
If converted from INT to FLOAT, the value is retained.
If converted from FLOAT to INT, the value will be rounded to the nearest integer.
If there is no change of type, the value is untouched.
Return value
No meaningful return value
Example usage
SetRegister( 1, 1, 12.34, FLOAT ); // The register value is 12.34 SetRegisterType( 1, 1, INT ); // The register value is now 12, and the type is INT.