123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef __DTSD1352_H__
- #define __DTSD1352_H__
- #include "misc.h"
- #include "chan.h"
- #define DTSD1352_NBR_MAX 8
- struct dtsd1352_t{
- int bEn;
- char szinfo[32];
- char szaddr[16];
- int chanresetcnt;
- double polltotalcnt;
- double polltotaltime;
- double pollave;
- double pollmax;
- int cmd;
- struct comm_t comm;
- struct statemachine_t sm;
- double com_active_e;
- double com_active_p;
- double pos_active_e;
- double pos_active_dem;
- double neg_active_e;
- double pwr_factor;
- int PT;
- int CT;
- double ua;
- double ub;
- double uc;
- double ia;
- double ib;
- double ic;
- double freq;
- /*
- 分相电压电流总畸变率H =data*0.01 data 为通讯中的谐波含量,
- 计算值单位为%,谐波含量是谐波/基波,所以有几率数值会大于 1
- */
- double THDUa;
- double THDUb;
- double THDUc;
- double THDIa;
- double THDIb;
- double THDIc;
- double total_fund_ap; //总基波有功功率
- double total_fund_rp; // 总基波无功功率
- double total_harm_ap; // 总谐波有功功率
- double total_harm_rp; // 总谐波无功功率
- };
- extern struct dtsd1352_t dtsd1352[DTSD1352_NBR_MAX + 1];
- int dtsd1352_init();
- int dtsd1352_get_cmd( int idx );
- void dtsd1352_reset_cmd(int idx);
- int dtsd1352_get_state( int idx);
- char* dtsd1352_get_state_string( int idx);
- int dtsd1352_chk_state_all( int stat);
- int dtsd1352_send_sm_cmd( int idx, int val );
- int dtsd1352_chk_state( int stat);
- int dtsd1352_send_sm_cmd_all( int val );
- int dtsd1352_get_com_ap( int idx );
- double dtsd1352_get_com_ae( int idx );
- double dtsd1352_get_pos_ae( int idx );
- double dtsd1352_get_neg_ae( int idx );
- double dtsd1352_get_ua( int idx );
- double dtsd1352_get_ub( int idx );
- double dtsd1352_get_uc( int idx );
- double dtsd1352_get_ia( int idx );
- double dtsd1352_get_ib( int idx );
- double dtsd1352_get_ic( int idx );
- double dtsd1352_get_pwrfct( int idx );
- int dtsd1352_get_comm_st(int idx);
- void dtsd1352_set_dac_param_en(int idx, int val);
- double dtsd1352_get_THDUa( int idx );
- double dtsd1352_get_THDUb( int idx );
- double dtsd1352_get_THDUc( int idx );
- double dtsd1352_get_THDIa( int idx );
- double dtsd1352_get_THDIb( int idx );
- double dtsd1352_get_THDIc( int idx );
- double dtsd1352_get_total_fund_ap( int idx );
- double dtsd1352_get_total_harm_ap( int idx );
- double dtsd1352_get_total_fund_rp( int idx );
- double dtsd1352_get_total_harm_rp( int idx );
- char* dtsd1352_get_info_str(int idx);
- int dtsd1352_get_sm_step(int idx);
- char* dtsd1352_get_sm_err_str(int idx);
- int dtsd1352_get_chan_idx(int idx);
- int dtsd1352_get_adr(int idx);
- int dtsd1352_get_tick(int idx);
- char* dtsd1352_get_comm_state_str(int idx);
- int dtsd1352_get_PT(int idx);
- int dtsd1352_get_CT(int idx);
- double dtsd1352_get_freq( int idx );
- int dtsd1352_get_nbr();
- int dtsd1352_get_tool_data(int idx,char* buf);
- int dtsd1352_get_tbmqtt_data(int idx,char* buf);
- int dtsd1352_get_cloud_data(int ctn_idx,int idx,char* buf);
- int dtsd1352_get_bkds_data(int idx,char* buf);
- #endif
|