12 example of lrc calculations – TOHO ELECTRONICS TTX-700 User Manual

Page 33

Advertising
background image

6.11.8 Changing the settings (SV or SV2) by communications during auto-tuning

Even if the settings (SV or SV2) used in control for auto-tuning are changed by communications,
the changes (SV or SV2) will not be changed until the auto-tuning ends.


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.




















33

Advertising