156
SI-Ethernet User Guide
Issue: 3
Base a 6 (MSW)
The most significant word of the parameter value is converted to a signed 16-bit value stored in a
32-bit variable by bitwise shifting it 16 places right and bitwise ANDing the result with the
hexadecimal value 0x00007FFF, then subtracting the decimal value 32768 if the most significant
bit is set to 1.
Examples:
As an example, the following code may be used in the user program:
// Writing
// Calculate the value to write LSW
LSW% = Value% & 0x00007FFF
//
Handle the casting from 32bit variable to 16bit parameter
IF
Value%.15 = True%
THEN
// Subtract 32768
LSW% = LSW% - 32768
ENDIF
// Write it to the correct parameter
Address% = BaseAddress% + 5
#Address% = LSW%
//Calculate the value to write MSW
MSW% = (Value% >> 16) & 0x00007FFF
// Handle the casting from 32bit variable to 16bit parameter
IF
Value%.31 = True%
THEN
// Subtract 32768
MSW% = MSW% - 32768
ENDIF
// Write it to the correct parameter
Address% = BaseAddress% + 6
#Address% = ValueMSW%
Value to write
MSW
LSW
Decimal
Hex
Decimal
Hex
3515
0
00000000
3515
00000DBB
123456
1
00000001
-7616
FFFFE240
-123456
-2
FFFFFFFE
7616
00001DC0
-678900
-11
FFFFFFF5
-23540
FFFFA40C
BaseAddress% is the parameter specified in
S.02.036
NOTE
Содержание Unidrive M600
Страница 1: ...User Guide SI Ethernet and Unidrive M Onboard Ethernet Part Number 0478 0137 03 Issue 3 ...
Страница 16: ...16 SI Ethernet User Guide Issue 3 Figure 4 3 Typical network topologies ...
Страница 215: ......
Страница 216: ...0478 0137 03 ...