![Beckhoff EL33-00 Series Скачать руководство пользователя страница 184](http://html1.mh-extra.com/html/beckhoff/el33-00-series/el33-00-series_documentation_2719563184.webp)
Appendix
EL33xx-00x0
184
Version: 4.2
// THIS CODE IS ONLY AN EXAMPLE - YOU HAVE TO CHECK APTITUDE FOR YOUR APPLICATION
PROGRAM MAIN
VAR
nBuffer_INT : INT; // Buffer for reading or writing values from/to CoE objects
aTCElement : ARRAY[0..9] OF REAL := // Type K µV entries in 10°C Steps:
[-1156, -778, -392, 0, 397, 798, 1203, 1612, 2023, 2436];
nTabIndex : INT; // Index of node in table
nT_start : INT := -300; // -30°C for 0.1°C resolution
nT_ResTab : REAL := 100; // 10°C resultion of table (for 0.1°C resolution of values)
// Variables for calculation:
// ---------------------------
nDiff_U_node2node : REAL; // Voltage difference of two nodes
nDiff_U_node2U_TC : REAL; // Voltage difference of node and U TC
nSlope : REAL; // Slope for 1st interpolation (temperature to voltage)
nResidual : REAL; // Residual value for interpolation
nRelation : REAL; // Relation for 2nd interpolation (voltage to temperature)
// ===========================
nU_TC : REAL; // Voltage of temperature inkl. CJC
nT_CJ : REAL; // Cold junction temperature
nU_CJ : REAL; // Corresponding voltage of CJ
nT_Result : INT; // Resulting Temperatur (resolution 0.1°C)
END_VAR
Ausführungsteil (nState=100):
// Cold junction temperature by CoE:
nT_CJ := INT_TO_REAL(nBuffer_INT);
// 1. Convert temperature to voltage:
// ========================================================================
// Determinate index of table:
nTabIndex := TRUNC_INT((nT_CJ - nT_start)/nT_ResTab);
// Calculate difference of two values with real value between them:
nDiff_U_node2node := (aTCElement[nT1]-aTCElement[nTabIndex]);
// Get residual value of real value with integer value:
nResidual := nT_CJ - (nTabIndex * nT_ nT_start);
// Calculate slope nSlope = DY / DX:
nSlope := nDiff_U_node2node/nT_ResTab;
// Calculate interpolated voltage of the cold junction (m*x+b):
nU_CJ := nSlope * nRe aTCElement[nTabIndex];
// ========================================================================
// 2. Add this value to the PDO value:
nU_TC := INT_TO_REAL(nTC_Inputs_Value) + nU_CJ;
// ========================================================================
// 3. Convert calculated voltage to temperature:
// ========================================================================
// Search index of higher target node:
nTabIndex := 0;
// Loop as long U TC is greater than a node:
WHILE nU_TC > aTCElement[nTabIndex] DO
nTabIndex := nTa 1;
END_WHILE
// Loop ended with resulting nTabIndex
IF nTabIndex = 0 THEN
// Temperature is below first table entry: end here
nT_Result := nT_start;
ELSE
// Voltage difference between U_TC and lower target node
nDiff_U_node2U_TC := nU_TC - aTCElement[nTabIndex-1];
// Voltage difference between two target nodes with U_TC nested between them:
nDiff_U_node2node := aTCElement[nTabIndex]-aTCElement[nTabIndex-1];
// Relation of the two differencies:
nRelation := nDiff_U_node2U_TC/nDiff_U_node2node;
// Resulting temperature in 0.1°C resoltion:
nT_Result := REAL_TO_INT(nT (nRnTabIndex-1) * nT_ResTab);
END_IF
Содержание EL33-00 Series
Страница 2: ......
Страница 6: ...Table of contents EL33xx 00x0 6 Version 4 2...
Страница 17: ...Product overview EL33xx 00x0 17 Version 4 2 Fig 10 EL3312 Fig 11 EL3314...
Страница 18: ...Product overview EL33xx 00x0 18 Version 4 2 Fig 12 EL3314 0002 Fig 13 EL3314 0010...
Страница 60: ...Mounting and wiring EL33xx 00x0 60 Version 4 2 4 12 3 EL3314 EL3314 00xx LEDs Fig 43 EL3314 Fig 44 EL3314 0002...
Страница 61: ...Mounting and wiring EL33xx 00x0 61 Version 4 2 Fig 45 EL3314 0010 Fig 46 EL3314 0090...
Страница 66: ...Mounting and wiring EL33xx 00x0 66 Version 4 2 4 13 3 EL3314 00x0 Connection Fig 50 EL3314 Fig 51 EL3314 0002...
Страница 103: ...Commissioning EL33xx 00x0 103 Version 4 2 Fig 100 Incorrect driver settings for the Ethernet port...
Страница 114: ...Commissioning EL33xx 00x0 114 Version 4 2 Fig 119 EtherCAT terminal in the TwinCAT tree left TwinCAT 2 right TwinCAT 3...