Commissioning – Lenze SMVector RS-485 LECOM User Manual
Page 13

11
CMVLC401A
Commissioning
5.3
Code Number (C1, C2)
5.3.1 Standard Addressing
The meaning of the code numbers and the assigned parameters can be obtained from the code table (in section 9) and
the SMV Operating Instructions Manual (SV01, section10). When transmitting data, the code number is coded as follows:
The following calculation determines the two ASCII digits from the code number (value range: 0 ... 6229) (value range:
48
dec
...127
dec
):
C1 = INTEGER((REMAINDER(code number/790)Y10)+48
dec
C2 = REMAINDER(REMAINDER(code number/790)/10) + INTEGER(code number/790) x 10 + 48
dec
The INTEGER is the digit before the decimal point, the REMAINDER is an integer.
Example:
13/5 = 2 remainder 3
INTEGER(13/5) = 2
REMAINDER(13/5) = 3
Example: Convert code number 1002 in ASCII code C1 and C2:
C1
ASCII
=
INTEGER((REMAINDER(1002/790/10) + 48 =
INTEGER(212/10) + 48 =
21 + 48 = 69 = 45hex = “E”
ASCII
C2
ASCII
=
REMAINDER(REMAINDER(1002/790)/10) + INTEGER(1002/790) x 10 + 48 =
REMAINDER(212/10) + 1 x 10 + 48 = 2 + 10 + 48 = 60 = 3C
hex
= “<”
ASCII
The code number C1002 is converted into the ASCII string “E<”, if they are transmitted to the controller by a host.
5.3.2 Addressing via Code Bank
With previous LECOM-A/B drivers, only code numbers in the range from 0 to 255 could have been addressed, since
these drivers used only one byte as code number. To achieve the addressing of the wider code-number range with
these drivers, use the code banking. The code-number range 0...255 is displayed as a window over the whole code-
number range. This is controlled via the code C0249 (code bank). Code C0249 can always be accessed via number
249, independent of the currently set code bank.
Table 7: Code Bank Assignment
Code bank Code offset
Code-number range
0
0
0 - 255
1
250
250 - 505
2
500
500 - 755
3
750
750 - 1005
4
1000
1000 - 1255
5
1250
1250 - 1505
6
1500
1500 - 1755
7
1750
1750 - 2005
NOTE
Code banking is only active when the standard addressing is being used. If the selected code numbers are
higher than 255, the code-number range increases correspondingly. Only the corresponding code-number
offset is selected by means of the code bank.
Example:
Set the code bank INTEGER(1002/250) =4 in C0249 to address the code number 1002. C1002 is then accessed via
the code number C02.