From: kyz Date: Sun, 1 Dec 2024 06:37:56 +0000 (+0800) Subject: 修改谐波含有量上报按3位小数计算 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=5d1e9d6afc28d76249d2e794db8e7a5c1de2fc4a;p=zd%2Fzd-mcu.git 修改谐波含有量上报按3位小数计算 --- diff --git a/STM32/code/mcu_com/mcu_com_energy.c b/STM32/code/mcu_com/mcu_com_energy.c index 80d4a152..65ee3a59 100644 --- a/STM32/code/mcu_com/mcu_com_energy.c +++ b/STM32/code/mcu_com/mcu_com_energy.c @@ -244,14 +244,14 @@ void Mcu_Energy_Get_power_info(void) void Mcu_Energy_Get_harmonic_info(void) { //A/B/C µçѹг²¨º¬ÓÐÂÊ int32 СÊýµãºó3λ - g_energy.harm.ThdU_D3[0] = swap_u32( rn_harm_data.HarmonicThdU[0] ); - g_energy.harm.ThdU_D3[1] = swap_u32( rn_harm_data.HarmonicThdU[1] ); - g_energy.harm.ThdU_D3[2] = swap_u32( rn_harm_data.HarmonicThdU[2] ); + g_energy.harm.ThdU_D3[0] = swap_u32( rn_harm_data.HarmonicThdU[0] *10 ); + g_energy.harm.ThdU_D3[1] = swap_u32( rn_harm_data.HarmonicThdU[1] *10 ); + g_energy.harm.ThdU_D3[2] = swap_u32( rn_harm_data.HarmonicThdU[2] *10 ); //A/B/C µçÁ÷г²¨º¬ÓÐÂÊ int32 СÊýµãºó3λ - g_energy.harm.ThdI_D3[0] = swap_u32( rn_harm_data.HarmonicThdI[0] ); - g_energy.harm.ThdI_D3[1] = swap_u32( rn_harm_data.HarmonicThdI[1] ); - g_energy.harm.ThdI_D3[2] = swap_u32( rn_harm_data.HarmonicThdI[2] ); + g_energy.harm.ThdI_D3[0] = swap_u32( rn_harm_data.HarmonicThdI[0] *10 ); + g_energy.harm.ThdI_D3[1] = swap_u32( rn_harm_data.HarmonicThdI[1] *10 ); + g_energy.harm.ThdI_D3[2] = swap_u32( rn_harm_data.HarmonicThdI[2] *10 ); //A/B/C µçѹг²¨×ܺ¬Á¿ int32 СÊýµãºó3λ g_energy.harm.ThdUrms_D3[0] = swap_u32( rn_harm_data.HarmonicThdUrms[0] ); @@ -521,7 +521,7 @@ void McuCom_Send_Energy(void) UART_Tx_One_Frame(PORT_UART_HOST, (uint8_t*)&g_energy.unbalance, sizeof(g_energy.unbalance)); HAL_Delay(5); - //·â×°²¢·¢Ëͼäг²¨Êý¾Ý°ü + //·â×°²¢·¢ËÍÉÁ±ä²¨Êý¾Ý°ü Mcu_Energy_Get_flick_info(); g_energy.flick.packet_head.head = MCU_ARM_COM_HEAD; g_energy.flick.packet_head.type = 0x41;