RIEVTECH — RIEVTECH STUDIO SOFTWARE MANUAL(2.0 Version).docx

RIEVTECH STUDIO SOFTWARE MANUAL In this example, power_on is the alias of LB0, so the function GetBit will read the bit value from LB2 and return to a BOOL variable power. 6.2.1.2 Read Word Register: GetWord unsigned short GetWord( @Address Alias@, Address Offset ): Read one word from specified register address. @Address Alias@ : Select a word address register Address Offset: An unsigned integer, Read Address=The address specified by @Address Alias@+Address Offset Return Value : Unsigned Short Type, the value of the word which was read Error Infomation:Get the error code using GetError() function. int error=GetError(); Example : unsigned short speed=GetWord( @Speed@,3 ):

The Alias @Speed@ represents the register LW0 in this example, so the target word register is LW3 (LW0+3), the value of LW3 is returned to an Unsigned Short variable named "speed". short speed = (short) GetWord(@Speed@,3): //If use signed number, you can use force conversion. 6.2.1.3 Read Double Word Register: GetDWord unsignedintGetDWord( @Address Alias@, Address Offset ): Read a double word from a specified register address. @Address Alias@ : Select an address register (word or double word). Address Offset: An unsigned integer, Read Address=The address specified by @Address Alias@+Address Offset. Return Value : unsignedint type, the value of the double word which was read.

If the address is word type, the function will return two consecutive words. 580