Toho-electronics TTM000 Bedienungsanleitung Seite 34

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 42
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 33
34
6.12 Example of LRC calculations
Following is an example of calculating LRC with VisualBasic6.0.
Variables are declared as shown below.
VisualBasic6.0 cannot use code-free variables. It therefore uses code-equipped 16-bit integer
variables as data. Similarly, the LRC calculation results are entered into code-equipped 16-bit
integer variables.
Dim LRC As Integer
Dim i, arry_count As Integer
Dim lrc_arry(128) As Integer
Then enter calculable data into the 1rc_arry(), and enter the number of data items
into the arry_count
After that, run the following program to cause the calculation results to enter the LRC.
For i = 0 To arry_count
LRC = (LRC + lrc_arry(i)) And &HFF
Next
LRC = ((Not LRC) + 1) And &HFF
If the error code is calculated as 12H as an example, affix a "1" or "2" at the end of the message.
Seitenansicht 33
1 2 ... 29 30 31 32 33 34 35 36 37 38 39 40 41 42

Kommentare zu diesen Handbüchern

Keine Kommentare