Save_Para.Integrated_flux[0]=s_bsPort.txdBuf[39]=(u8)((((water1.Cumulant_Int/10000000000)/10)<<4)| \
((water1.Cumulant_Int/10000000000)%10)); //
Save_Para.Integrated_flux[1]=s_bsPort.txdBuf[40]=(u8)((((water1.Cumulant_Int%10000000000)/1000000000)<<4)| \
((water1.Cumulant_Int%10000000000/100000000)%10)); ; //
Save_Para.Integrated_flux[2]=s_bsPort.txdBuf[41]=(u8)((((water1.Cumulant_Int%100000000)/10000000)<<4)| \
((water1.Cumulant_Int%100000000/1000000)%10));
Save_Para.Integrated_flux[3]=s_bsPort.txdBuf[42]=(u8)((((water1.Cumulant_Int%1000000)/100000)<<4)| \
(((water1.Cumulant_Int%1000000)/10000)%10));
Save_Para.Integrated_flux[4]=s_bsPort.txdBuf[43]=(u8)((((water1.Cumulant_Int%10000)/1000)<<4)|(water1.Cumulant_Int%10000/100%10));
做的水表电表,以上代码是我写的一部分。
water1.Cumulant_Int表示累积流量。s_bsPort.txdBuf是发送缓冲区,Save_Para.Integrated_flux是用来保存的。
现在还要写把历史数据读出来 |