热电偶转换C语言知识学习程序
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include
#include
#define ERROR -100
#define uchar unsigned char
float tmp = 0;
// S型温度转电压系数
float code Var_TtoV_S[3][9]=
{
{0, 5.40313309/1e3, 1.25934290/1e5, -2.32477969/1e8, 3.22028823/1e11, -3.31465196/1e14, 2.55744252/1e17, -1.25068871/1e20, 2.71443176/1e24},
{1.32900444, 3.34509311/1e3, 6.54805193/1e6, -1.64856259/1e9,
1.29989605/1e14, 0, 0, 0, 0},
{1.46628233e2, -2.58430517/1e1, 1.63693575/1e4, -3.30439047/1e8,
-9.43223691/1e15, 0, 0, 0, 0}
};
// R型温度转电压系数
float code Var_TtoV_R[3][10]=
{
{0, 5.28961730/1e3, 1.39166590/1e5, -2.38855693/1e8, 3.56916001/1e11,
-4.62347666/1e14, 5.00777441/1e17, -3.73105886/1e20, 1.57716482/1e23,
-2.81038625/1e27},
{2.95157925, -2.52061251/1e3, 1.59564502/1e5, -7.64085948/1e9,
2.05305291/1e12, -2.93359668/1e16},
{1.52232118e2, -2.68819889/1e1, 1.71280280/1e4, -3.45895706/1e8,
-9.34633971/1e15}
};
// B型温度转电压系数
float code Var_TtoV_B[2][9]=
{
{0, -2.46508183/1e4, 5.90404212/1e6, -1.32579316/1e9, 1.56682919/1e12,
-1.69445292/1e15,6.29903471/1e19},
{-3.89381686, 2.85717475/1e2, -8.48851048/1e5, 1.57852802/1e7,
-1.68353449/1e10, 1.11097940/1e13, -4.45154310/1e17, 9.89756408/1e21,
-9.37913303/1e25}
};
// K型温度转电压系数
float code Var_TtoV_K[3][11]=
{
{0, 3.9450128025/1e2, 2.3622373598/1e5, -3.2858906784/1e7, -4.9904828777/1e9, -6.7509059173/1e11, -5.7410327428/1e13, -3.1088872894/1e15,
-1.0451609365/1e17, -1.9889266878/1e20, -1.6322697486/1e23},
{-1.7600413686/1e2, 3.8921204975/1e2, 1.8558770032/1e5, -9.9457592874/1e8,
3.1840945719/1e10, -5.6072844889/1e13, 5.6075059059/1e16,
-3.2020720003/1e19, 9.7151147152/1e23, -1.2104721275/1e26},
{1.185976/1e1,-1.183432/1e4}
};
// N型温度转电压系数
float code Var_TtoV_N[2][11]=
{
{0, 2.61591060/1e2, 1.09574842/1e5, -9.38411116/1e8, -4.64120398/1e11,
-2.63033577/1e12, -2.26534380/1e14, -7.60893008/1e17, -9.34196678/1e20}, {0, 2.59293946/1e2, 1.57101419/1e5, 4.38256272/1e8, -2.52611698/1e10,
6.43118193/1e13, -1.00634715/1e15, 9.97453390/1e19,-6.08632456/1e22, 2.08492293/1e25, -3.06821962/1e29}
};
// E型温度转电压系数
float code Var_TtoV_E[2][14]=
{
{0, 5.8665508708/1e2, 4.5410977124/1e5, -7.7998048686/1e7,
-2.5800160843/1e8, -5.9452583057/1e10, -9.3214058667/1e12,
-1.028*******/1e13, -8.0370123621/1e16, -4.3979497391/1e18,
-1.6414776355/1e20, -3.9673619516/1e23, -5.5827328721/1e26,
-3.4657842013/1e29},
{0, 5.8665508710/1e2, 4.5032275582/1e5, 2.8908407212/1e8,