Exemplo n.º 1
0
T = 0	# Температура 8 бит бит/градус

# температурный коэффициент
corrected_mult = 4.9 * 5 * 1e-3	# V/oC

# поправка
mult = 4.9/1000*5*4000.0/4.6	# V/oC положительная!
delta_U = mult*T	# deltaU V

# конкретное значение смещения
hexWord = '0F99'
Usm_src = hexWordToInt( hexWord ) 
Usm_src -= delta_U	# вычитание вот здесь!

# Report
'''
msg = 'T oC :'
ui.plot(msg, T)
msg = 'mult V/oC :'
ui.plot(msg, mult)
msg = 'deltaU, ue LH:'
ui.plotWord(msg, delta_U)
msg = 'deltaU ue :'
ui.plot(msg, delta_U)
msg = 'Usm src, ue LH:'
ui.plotWord(msg, Usm_src)
msg = 'Usm src, ue float32:'
ui.plot(msg, Usm_src)
ui.rout()'''

Exemplo n.º 2
0
import math

def hexWordToInt( hexWord ):
	sum = 0
	for pos in range( 0, len( hexWord ) ):
		oneIt =  tc.hex2int( hexWord[ pos ] )*math.pow( 16, len( hexWord )-pos-1 )
		sum += oneIt
	return sum
	
def intWordToHex( intWord ):
	sum = ''

# Расчет для УКВ ЧМ
T = 26	# Температура 8 бит бит/градус
msg = 'T oC :'
ui.plot(msg, T)

# температурный коэффициент
mult = 4.9/1000*5*4000.0/4.6	# V/oC положительная!
msg = 'mult V/oC :'
ui.plot(msg, mult)

# поправка
delta_U = mult*T	# deltaU V
msg = 'deltaU, ue LH:'
ui.plotWord(msg, delta_U)
msg = 'deltaU ue :'
ui.plot(msg, delta_U)

# конкретное значение смещения
hexWord = '0F99'