update new protocol and new hardware
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
#define ADC_RES (4096) // ADC resolution: 12 bits
|
||||
#define NR_OF_ADCS ANPI_eInNumberOfInputs // number of internal adc channels
|
||||
|
||||
#define INT_ADC_REF (3.2968f)// int. reference voltage for conversion
|
||||
#define INT_ADC_REF (3.3f)// int. reference voltage for conversion
|
||||
|
||||
#define BUFFER_SIZE NR_OF_ADCS * 2
|
||||
#define BUFFER_HALF_SIZE NR_OF_ADCS
|
||||
@@ -108,7 +108,7 @@ LOCAL osMutexId_t m_pstMutexID = NULL;
|
||||
LOCAL CONST FLOAT m_aflConversionFactor[ANPI_eInNumberOfInputs] =
|
||||
{
|
||||
10, // 01 ANPI_eSupplyVoltage24V
|
||||
-5, // 02 ANPI_eSupplyCurrent24V
|
||||
5, // 02 ANPI_eSupplyCurrent24V
|
||||
10, // 03 ANPI_eOutputVoltage
|
||||
5, // 04 ANPI_eOutputCurrent
|
||||
};
|
||||
@@ -117,9 +117,9 @@ LOCAL CONST FLOAT m_aflConversionFactor[ANPI_eInNumberOfInputs] =
|
||||
LOCAL CONST FLOAT m_aflOffset[ANPI_eInNumberOfInputs] =
|
||||
{
|
||||
0.0f, // 01 ANPI_eSupplyVoltage24V
|
||||
2.5f, // 02 ANPI_eSupplyCurrent24V
|
||||
4.5f, // 03 ANPI_eOutputVoltage
|
||||
2.5f, // 04 ANPI_eOutputCurrent
|
||||
8.25f, // 02 ANPI_eSupplyCurrent24V
|
||||
14.85f, // 03 ANPI_eOutputVoltage
|
||||
8.25f, // 04 ANPI_eOutputCurrent
|
||||
};
|
||||
|
||||
// inputs are connected to the following ADCs
|
||||
@@ -248,7 +248,7 @@ VOID vTask( PVOID arg )
|
||||
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eSupply_U, aflValues[ANPI_eSupplyVoltage24V] );
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eSupply_I, aflValues[ANPI_eSupplyCurrent24V] );
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eSupply_P, aflValues[ANPI_eSupplyVoltage24V] * aflValues[ANPI_eSupplyCurrent24V] );
|
||||
VARH_vSetVariableDataFromSystemFloat( VARH_eSupply_P, aflValues[ANPI_eSupplyVoltage24V] * (aflValues[ANPI_eSupplyCurrent24V]) );
|
||||
|
||||
osMutexRelease( m_pstMutexID ); // release mutex
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user