EasyManua.ls Logo

Nidec Unidrive M700 - Reading the Parameter Value

Nidec Unidrive M700
216 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SI-Ethernet User Guide 157
Issue: 3
Safety
information
Introduction
Mechanical
installation
Electrical
installation
Getting started Parameters
Key features
and Protocols
PC Tools
Applications
Security Diagnostics
Glossary of
terms
Index
7.4.5 Reading the parameter value
The required parameter value is read from two signed 16-bit values, these two values must then
be correctly merged to form the correct 32-bit value.
Base address + 5 (LSW)
The least significant word of the parameter value is read and converted from a signed 16-bit value
and stored in a 32-bit variable, this value is then bitwise ANDed with the hexadecimal value
0x0000FFFF.
If an error is indicated in the status value then this value will identify the cause of the error.
Base address + 6 (MSW)
The most significant word of the parameter value is read and converted from a signed 16-bit value
and stored in a 32-bit variable by bitwise shifting it 16 places left and bitwise ANDing the result with
the hexadecimal value 0x0000FFFF.
The actual value is then calculated by bitwise ORing the two words together.
If the source parameter was a 16-bit parameter and the most significant bit (b15) was set to 1
(indicating a negative number) then the decimal value 65536 is subtracted.
As an example, the following code may be used in the user program:
// Read complete
// Get the LSW value
Address% = BaseAddress% + 5
LSW% = #Address%
// Get the MSW value
Address% = BaseAddress% + 6
MSW% = #Address%
Value% = (LSW% & 0x0000FFFF) | ((MSW% << 16) & 0xFFFF0000)
// Correct for 16bit -ive values
IF Bit32% = 0 THEN
// 16 bit
IF Value%.15 = 1 THEN
// Correct for negative number
Value% = Value% - 65536
ENDIF
ENDIF
BaseAddress% is the parameter specified in S.02.036.
Bit32% specifies the source parameter as 16-bit or 32-bit (0 = 16-bit. 1 = 32-bit).
NOTE

Table of Contents

Other manuals for Nidec Unidrive M700

Related product manuals