High Country Tek DVC80 User Manual

Page 79

Advertising
background image

P/N: 021-00154, Rev. A.6 - updated for V4.7 Tools

Page | 79

else

Valvecoil2.Enable = 0

end

if

If the value is true, or ‘2’ in this example, then an internal bit can be set or
reset.

Analog values, using more than one bit:
Using a value that is other than on/off will need to be transferred also. The DVC
controllers use a 10 bit number. The information transmitted in 1 byte is 8 bits
in length. For this reason, and to transmit / receive the highest resolution, 2
words will need to be used, see the code below on format.
data_to_dvc7a.a_ana_in1_low = (Analog_In1

and

0xff)

data_to_dvc7a.a_ana_in1_high = (Analog_In1 / 256)

The value of ‘analog_In1’ is moved into a 8 bit word, data_to_dvc7a.a_ana_in1_low.
Analog_In1 is then divided by 256, this will move the upper 8 bits into the lower
8 bits. That value is then moved into a 8 bit word, data_to_dvc7a.a_ana_in1_high.
To reverse the process, follow this format
Valvecoil1 = ((data_from_dvc7.a_OG1_PWM_low)+(data_from_dvc7.a_OG1_PWM_high *
256))

The 8 bit word, data_from_dvc7.a_OG1_PWM_high is multiplied by 256, this moved the
information from the lower 8 bits to the upper 8 bits. This value is added to the
8 bit word, data_from_dvc7.a_OG1_PWM_low, to give a 16 bit variable, Valvecoil1.

Advertising
This manual is related to the following products: