// T332AI message handlers
void T332AI::Initial_RegisterList()
{
#if 1
	SN_LOW	=	0	;
	SN_HI	=	2	;
	EPROM_VER_NUMBER	=	4	;
	FIRMWARE_VER_NUMBER	=	5	;
	MODBUS_ID	=	6	;
	PRODUCT_MODEL	=	7	;
	HARDWARE_VER_NUMBER	=	8	;
	PIC_VER_NUMBER	=	9	;
	CALIBRATION_OUTPUTS	=	13	;
	BAUDRATE	=	15	;
	RESPONSE_DELAY	=	19	;
	INPUT1	=	100	;
	INPUT2	=	101	;
	INPUT3	=	102	;
	INPUT4	=	103	;
	INPUT5	=	104	;
	INPUT6	=	105	;
	INPUT7	=	106	;
	INPUT8	=	107	;
	INPUT9	=	108	;
	INPUT10	=	109	;
	INPUT11	=	110	;
	INPUT12	=	111	;
	INPUT13	=	112	;
	INPUT14	=	113	;
	INPUT15	=	114	;
	INPUT16	=	115	;
	INPUT17	=	116	;
	INPUT18	=	117	;
	INPUT19	=	118	;
	INPUT20	=	119	;
	INPUT21	=	120	;
	INPUT22	=	121	;
	INPUT23	=	122	;
	INPUT24	=	123	;
	INPUT25	=	124	;
	INPUT26	=	125	;
	INPUT27	=	126	;
	INPUT28	=	127	;
	INPUT29	=	128	;
	INPUT30	=	129	;
	INPUT31	=	130	;
	INPUT32	=	131	;

#endif
	T3Register temp;
	CADO m_ado;
	m_ado.OnInitADOConn();
#if 1
	CString SQL = _T("select * from T3_RegisterList");
	m_ado.m_pRecordset = m_ado.OpenRecordset(SQL);
	_variant_t vartemp;
	while(!m_ado.m_pRecordset->EndOfFile)
	{
		temp.regID=m_ado.m_pRecordset->GetCollect(_T("RegID"));
		vartemp =m_ado.m_pRecordset->GetCollect(_T("T3-32AI"));
		if (vartemp.vt==VT_NULL)
			temp.regName=_T("");
		else
			temp.regName =vartemp;
		m_ado.m_pRecordset->MoveNext();
		m_vecT3Register.push_back(temp);
	}
	m_ado.CloseRecordset();
	m_ado.CloseConn();
#endif 


#if 1
	SN_LOW	=	Get_RegID(_T("	SN_LOW	"))	;
	SN_HI	=	Get_RegID(_T("	SN_HI	"))	;
	EPROM_VER_NUMBER	=	Get_RegID(_T("	EPROM_VER_NUMBER	"))	;
	FIRMWARE_VER_NUMBER	=	Get_RegID(_T("	FIRMWARE_VER_NUMBER	"))	;
	MODBUS_ID	=	Get_RegID(_T("	MODBUS_ID	"))	;
	PRODUCT_MODEL	=	Get_RegID(_T("	PRODUCT_MODEL	"))	;
	HARDWARE_VER_NUMBER	=	Get_RegID(_T("	HARDWARE_VER_NUMBER	"))	;
	PIC_VER_NUMBER	=	Get_RegID(_T("	PIC_VER_NUMBER	"))	;
	CALIBRATION_OUTPUTS	=	Get_RegID(_T("	CALIBRATION_OUTPUTS	"))	;
	BAUDRATE	=	Get_RegID(_T("	BAUDRATE	"))	;
	RESPONSE_DELAY	=	Get_RegID(_T("	RESPONSE_DELAY	"))	;
	INPUT1	=	Get_RegID(_T("	INPUT1	"))	;
	INPUT2	=	Get_RegID(_T("	INPUT2	"))	;
	INPUT3	=	Get_RegID(_T("	INPUT3	"))	;
	INPUT4	=	Get_RegID(_T("	INPUT4	"))	;
	INPUT5	=	Get_RegID(_T("	INPUT5	"))	;
	INPUT6	=	Get_RegID(_T("	INPUT6	"))	;
	INPUT7	=	Get_RegID(_T("	INPUT7	"))	;
	INPUT8	=	Get_RegID(_T("	INPUT8	"))	;
	INPUT9	=	Get_RegID(_T("	INPUT9	"))	;
	INPUT10	=	Get_RegID(_T("	INPUT10	"))	;
	INPUT11	=	Get_RegID(_T("	INPUT11	"))	;
	INPUT12	=	Get_RegID(_T("	INPUT12	"))	;
	INPUT13	=	Get_RegID(_T("	INPUT13	"))	;
	INPUT14	=	Get_RegID(_T("	INPUT14	"))	;
	INPUT15	=	Get_RegID(_T("	INPUT15	"))	;
	INPUT16	=	Get_RegID(_T("	INPUT16	"))	;
	INPUT17	=	Get_RegID(_T("	INPUT17	"))	;
	INPUT18	=	Get_RegID(_T("	INPUT18	"))	;
	INPUT19	=	Get_RegID(_T("	INPUT19	"))	;
	INPUT20	=	Get_RegID(_T("	INPUT20	"))	;
	INPUT21	=	Get_RegID(_T("	INPUT21	"))	;
	INPUT22	=	Get_RegID(_T("	INPUT22	"))	;
	INPUT23	=	Get_RegID(_T("	INPUT23	"))	;
	INPUT24	=	Get_RegID(_T("	INPUT24	"))	;
	INPUT25	=	Get_RegID(_T("	INPUT25	"))	;
	INPUT26	=	Get_RegID(_T("	INPUT26	"))	;
	INPUT27	=	Get_RegID(_T("	INPUT27	"))	;
	INPUT28	=	Get_RegID(_T("	INPUT28	"))	;
	INPUT29	=	Get_RegID(_T("	INPUT29	"))	;
	INPUT30	=	Get_RegID(_T("	INPUT30	"))	;
	INPUT31	=	Get_RegID(_T("	INPUT31	"))	;
	INPUT32	=	Get_RegID(_T("	INPUT32	"))	;

	Range1	=	Get_RegID(_T("	Range1		"))	;
	Range2	=	Get_RegID(_T("	Range2		"))	;
	Range3	=	Get_RegID(_T("	Range3		"))	;
	Range4	=	Get_RegID(_T("	Range4		"))	;
	Range5	=	Get_RegID(_T("	Range5		"))	;
	Range6	=	Get_RegID(_T("	Range6		"))	;
	Range7	=	Get_RegID(_T("	Range7		"))	;
	Range8	=	Get_RegID(_T("	Range8		"))	;
	Range9	=	Get_RegID(_T("	Range9		"))	;
	Range10	=	Get_RegID(_T("	Range10	"))	;
	Range11	=	Get_RegID(_T("	Range11	"))	;
	Range12	=	Get_RegID(_T("	Range12	"))	;
	Range13	=	Get_RegID(_T("	Range13	"))	;
	Range14	=	Get_RegID(_T("	Range14	"))	;
	Range15	=	Get_RegID(_T("	Range15	"))	;
	Range16	=	Get_RegID(_T("	Range16	"))	;
	Range17	=	Get_RegID(_T("	Range17	"))	;
	Range18	=	Get_RegID(_T("	Range18	"))	;
	Range19	=	Get_RegID(_T("	Range19	"))	;
	Range20	=	Get_RegID(_T("	Range20	"))	;
	Range21	=	Get_RegID(_T("	Range21	"))	;
	Range22	=	Get_RegID(_T("	Range22	"))	;
	Range23	=	Get_RegID(_T("	Range23	"))	;
	Range24	=	Get_RegID(_T("	Range24	"))	;
	Range25	=	Get_RegID(_T("	Range25	"))	;
	Range26	=	Get_RegID(_T("	Range26	"))	;
	Range27	=	Get_RegID(_T("	Range27	"))	;
	Range28	=	Get_RegID(_T("	Range28	"))	;
	Range29	=	Get_RegID(_T("	Range29	"))	;
	Range30	=	Get_RegID(_T("	Range30	"))	;
	Range31	=	Get_RegID(_T("	Range31	"))	;
	Range32	=	Get_RegID(_T("	Range32	"))	;
			 
	Filter1	=	Get_RegID(_T("	Filter1		"))	;
	Filter2	=	Get_RegID(_T("	Filter2		"))	;
	Filter3	=	Get_RegID(_T("	Filter3		"))	;
	Filter4	=	Get_RegID(_T("	Filter4		"))	;
	Filter5	=	Get_RegID(_T("	Filter5		"))	;
	Filter6	=	Get_RegID(_T("	Filter6		"))	;
	Filter7	=	Get_RegID(_T("	Filter7		"))	;
	Filter8	=	Get_RegID(_T("	Filter8		"))	;
	Filter9	=	Get_RegID(_T("	Filter9		"))	;
	Filter10	=	Get_RegID(_T("	Filter10	"))	;
	Filter11	=	Get_RegID(_T("	Filter11	"))	;
	Filter12	=	Get_RegID(_T("	Filter12	"))	;
	Filter13	=	Get_RegID(_T("	Filter13	"))	;
	Filter14	=	Get_RegID(_T("	Filter14	"))	;
	Filter15	=	Get_RegID(_T("	Filter15	"))	;
	Filter16	=	Get_RegID(_T("	Filter16	"))	;
	Filter17	=	Get_RegID(_T("	Filter17	"))	;
	Filter18	=	Get_RegID(_T("	Filter18	"))	;
	Filter19	=	Get_RegID(_T("	Filter19	"))	;
	Filter20	=	Get_RegID(_T("	Filter20	"))	;
	Filter21	=	Get_RegID(_T("	Filter21	"))	;
	Filter22	=	Get_RegID(_T("	Filter22	"))	;
	Filter23	=	Get_RegID(_T("	Filter23	"))	;
	Filter24	=	Get_RegID(_T("	Filter24	"))	;
	Filter25	=	Get_RegID(_T("	Filter25	"))	;
	Filter26	=	Get_RegID(_T("	Filter26	"))	;
	Filter27	=	Get_RegID(_T("	Filter27	"))	;
	Filter28	=	Get_RegID(_T("	Filter28	"))	;
	Filter29	=	Get_RegID(_T("	Filter29	"))	;
	Filter30	=	Get_RegID(_T("	Filter30	"))	;
	Filter31	=	Get_RegID(_T("	Filter31	"))	;
	Filter32	=	Get_RegID(_T("	Filter32	"))	;

#endif





}
void T38AI8AO::InitialRegister(){
    T3Register temp;
	g_VectorT3Register.clear();
	CADO m_ado;
	m_ado.OnInitADOConn();
#if 1
	CString SQL = _T("select * from T3_RegisterList");
	m_ado.m_pRecordset = m_ado.OpenRecordset(SQL);
	_variant_t vartemp;
	while(!m_ado.m_pRecordset->EndOfFile)
	{
		temp.regID=m_ado.m_pRecordset->GetCollect(_T("RegID"));
		vartemp =m_ado.m_pRecordset->GetCollect(_T("T3-8IOA"));
		if (vartemp.vt==VT_NULL)
			temp.regName=_T("");
		else
			temp.regName =vartemp;
		m_ado.m_pRecordset->MoveNext();
		g_VectorT3Register.push_back(temp);
	}
	m_ado.CloseRecordset();
	m_ado.CloseConn();
	SN_LOW=Get_RegID(_T("SN_LOW"))	;
	SN_HI=Get_RegID(_T("SN_HI"))	;
	EPROM_VER_NUMBER=Get_RegID(_T("EPROM_VER_NUMBER"))	;
	FIRMWARE_VER_NUMBER=Get_RegID(_T("FIRMWARE_VER_NUMBER"))	;
	MODBUS_ID=Get_RegID(_T("MODBUS_ID"))	;
	PRODUCT_MODEL	=Get_RegID(_T("PRODUCT_MODEL"));
	HARDWARE_VER_NUMBER=Get_RegID(_T("HARDWARE_VER_NUMBER"))	;
	PIC_VER_NUMBER=Get_RegID(_T("PIC_VER_NUMBER"))	;
	CALIBRATION_OUTPUTS	=Get_RegID(_T("CALIBRATION_OUTPUTS"));
	BAUDRATE=Get_RegID(_T("BAUDRATE"))	;
	RESPONSE_DELAY	=Get_RegID(_T("RESPONSE_DELAY"));

	OUTPUT1	=Get_RegID(_T("OUTPUT1	"));
	OUTPUT2	=Get_RegID(_T("OUTPUT2	"));
	OUTPUT3	=Get_RegID(_T("OUTPUT3	"));
	OUTPUT4	=Get_RegID(_T("OUTPUT4	"));
	OUTPUT5	=Get_RegID(_T("OUTPUT5	"));
	OUTPUT6	=Get_RegID(_T("OUTPUT6	"));
	OUTPUT7	=Get_RegID(_T("OUTPUT7	"));
	OUTPUT8	=Get_RegID(_T("OUTPUT8	"));
	INPUT1	=Get_RegID(_T("INPUT1	"));
	INPUT2	=Get_RegID(_T("INPUT2	"));
	INPUT3	=Get_RegID(_T("INPUT3	"));
	INPUT4	=Get_RegID(_T("INPUT4	"));
	INPUT5	=Get_RegID(_T("INPUT5	"));
	INPUT6	=Get_RegID(_T("INPUT6	"));
	INPUT7	=Get_RegID(_T("INPUT7	"));
	INPUT8	=Get_RegID(_T("INPUT8	"));
	SWITCH1_STATUS=Get_RegID(_T("SWITCH1_STATUS"))	;
	SWITCH2_STATUS=Get_RegID(_T("SWITCH2_STATUS"))	;
	RANGE_INPUT1	=Get_RegID(_T("RANGE_INPUT1	"));
	RANGE_INPUT2	=Get_RegID(_T("RANGE_INPUT2	"));
	RANGE_INPUT3	=Get_RegID(_T("RANGE_INPUT3	"));
	RANGE_INPUT4	=Get_RegID(_T("RANGE_INPUT4	"));
	RANGE_INPUT5	=Get_RegID(_T("RANGE_INPUT5	"));
	RANGE_INPUT6	=Get_RegID(_T("RANGE_INPUT6	"));
	RANGE_INPUT7	=Get_RegID(_T("RANGE_INPUT7	"));
	RANGE_INPUT8	=Get_RegID(_T("RANGE_INPUT8	"));
	FILTER_INPUT1	=Get_RegID(_T("FILTER_INPUT1	"));
	FILTER_INPUT2	=Get_RegID(_T("FILTER_INPUT2	"));
	FILTER_INPUT3	=Get_RegID(_T("FILTER_INPUT3	"));
	FILTER_INPUT4	=Get_RegID(_T("FILTER_INPUT4	"));
	FILTER_INPUT5	=Get_RegID(_T("FILTER_INPUT5	"));
	FILTER_INPUT6	=Get_RegID(_T("FILTER_INPUT6	"));
	FILTER_INPUT7	=Get_RegID(_T("FILTER_INPUT7	"));
	FILTER_INPUT8	=Get_RegID(_T("FILTER_INPUT8	"));
#endif 
}
void T38AI8AO::InitialRegister(){
    T3Register temp;
	g_VectorT3Register.clear();
	CppSQLite3DB SqliteDBT3000;
	CppSQLite3Table table;
	CppSQLite3Query q;
	SqliteDBT3000.open((UTF8MBSTR)g_strDatabasefilepath);
#if 1
	CString SQL = _T("select * from T3_RegisterList");
	q = SqliteDBT3000.execQuery((UTF8MBSTR)SQL);
	_variant_t vartemp;
	while(!q.eof())
	{
		temp.regID=q.getIntField("RegID");
		temp.regName =q.getValuebyName(L"T3_8AI8AO");
		q.nextRow();
		g_VectorT3Register.push_back(temp);
	}
	SqliteDBT3000.closedb();
	SN_LOW=Get_RegID(_T("SN_LOW"))	;
	SN_HI=Get_RegID(_T("SN_HI"))	;
	EPROM_VER_NUMBER=Get_RegID(_T("EPROM_VER_NUMBER"))	;
	FIRMWARE_VER_NUMBER=Get_RegID(_T("FIRMWARE_VER_NUMBER"))	;
	MODBUS_ID=Get_RegID(_T("MODBUS_ID"))	;
	PRODUCT_MODEL	=Get_RegID(_T("PRODUCT_MODEL"));
	HARDWARE_VER_NUMBER=Get_RegID(_T("HARDWARE_VER_NUMBER"))	;
	PIC_VER_NUMBER=Get_RegID(_T("PIC_VER_NUMBER"))	;
	CALIBRATION_OUTPUTS	=Get_RegID(_T("CALIBRATION_OUTPUTS"));
	BAUDRATE=Get_RegID(_T("BAUDRATE"))	;
	RESPONSE_DELAY	=Get_RegID(_T("RESPONSE_DELAY"));

	OUTPUT1	=Get_RegID(_T("OUTPUT1	"));
	OUTPUT2	=Get_RegID(_T("OUTPUT2	"));
	OUTPUT3	=Get_RegID(_T("OUTPUT3	"));
	OUTPUT4	=Get_RegID(_T("OUTPUT4	"));
	OUTPUT5	=Get_RegID(_T("OUTPUT5	"));
	OUTPUT6	=Get_RegID(_T("OUTPUT6	"));
	OUTPUT7	=Get_RegID(_T("OUTPUT7	"));
	OUTPUT8	=Get_RegID(_T("OUTPUT8	"));
	INPUT1	=Get_RegID(_T("INPUT1	"));
	INPUT2	=Get_RegID(_T("INPUT2	"));
	INPUT3	=Get_RegID(_T("INPUT3	"));
	INPUT4	=Get_RegID(_T("INPUT4	"));
	INPUT5	=Get_RegID(_T("INPUT5	"));
	INPUT6	=Get_RegID(_T("INPUT6	"));
	INPUT7	=Get_RegID(_T("INPUT7	"));
	INPUT8	=Get_RegID(_T("INPUT8	"));
	SWITCH1_STATUS=Get_RegID(_T("SWITCH1_STATUS"))	;
	SWITCH2_STATUS=Get_RegID(_T("SWITCH2_STATUS"))	;
	RANGE_INPUT1	=Get_RegID(_T("RANGE_INPUT1	"));
	RANGE_INPUT2	=Get_RegID(_T("RANGE_INPUT2	"));
	RANGE_INPUT3	=Get_RegID(_T("RANGE_INPUT3	"));
	RANGE_INPUT4	=Get_RegID(_T("RANGE_INPUT4	"));
	RANGE_INPUT5	=Get_RegID(_T("RANGE_INPUT5	"));
	RANGE_INPUT6	=Get_RegID(_T("RANGE_INPUT6	"));
	RANGE_INPUT7	=Get_RegID(_T("RANGE_INPUT7	"));
	RANGE_INPUT8	=Get_RegID(_T("RANGE_INPUT8	"));
	FILTER_INPUT1	=Get_RegID(_T("FILTER_INPUT1	"));
	FILTER_INPUT2	=Get_RegID(_T("FILTER_INPUT2	"));
	FILTER_INPUT3	=Get_RegID(_T("FILTER_INPUT3	"));
	FILTER_INPUT4	=Get_RegID(_T("FILTER_INPUT4	"));
	FILTER_INPUT5	=Get_RegID(_T("FILTER_INPUT5	"));
	FILTER_INPUT6	=Get_RegID(_T("FILTER_INPUT6	"));
	FILTER_INPUT7	=Get_RegID(_T("FILTER_INPUT7	"));
	FILTER_INPUT8	=Get_RegID(_T("FILTER_INPUT8	"));
#endif 
}