private static bool loadProbe(ref bool[] bResult) { bool bRet = false; CASDK2.CASDK2Discovery.SearchAllUSBDevices(ref pDeviceData); for (int ca = 0; ca < nPgNum; ca++) { if (pDeviceData[ca] != null) { objCa200.SetConfiguration(ca + 1, "1", pDeviceData[ca].lPortNo, 38400, 0); bRet = true; } } if (!bRet) { return(false); } objCa200.get_Cas(ref objCas); for (int ca = 0; ca < nPgNum; ca++) { if (pDeviceData[ca] == null) { continue; } objCas.get_Item(ca + 1, ref objCa[ca]); //objCas에 저장된 프로브들의 정보를 각각의 objCa에 입력 함. objCa[ca].get_Probes(ref objProbes[ca]); objCa[ca].get_OutputProbes(ref objOutputProbes[ca]); objCa[ca].get_Memory(ref objMemory[ca]); objCa[ca].put_NegativeValue(0); objCa[ca].put_DisplayMode(0); objCa[ca].put_SyncMode(2); // 0 : NTSC, 2 : EXT objCa[ca].put_AveragingMode(1); // 1 : FAST, 2 : LTD.AUTO objProbes[ca].get_Item(1, ref objProbe[ca]); objOutputProbes[ca].AddAll(); objOutputProbes[ca].get_Item(1, ref objProbe[ca]); bResult[ca] = true; } for (int ca = 0; ca < nPgNum; ca++) { if (pDeviceData[ca] != null && !bResult[ca]) { return(false); } } return(true); }
public static bool connect_CA() { initialize(); const int ca_port = 5;//CA Port Must be "COM5"; bool IsConnectionValid = ShowCAErrorMsg(objCa200.SetConfiguration(1, "1", ca_port, 38400, 1)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objCa200.get_Cas(ref objCas)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objCas.get_Item(0 + 1, ref objCa)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objCa.get_Probes(ref objProbes)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objCa.get_OutputProbes(ref objOutputProbes)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objCa.get_Memory(ref objMemory)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objProbes.get_Item(1, ref objProbe)); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objOutputProbes.AddAll()); if (IsConnectionValid == false) { return(false); } IsConnectionValid = ShowCAErrorMsg(objOutputProbes.get_Item(1, ref objProbe)); if (IsConnectionValid == false) { return(false); } Is_CA_Connected = true; if (Is_CA_Connected) { CA_Setting_After_CA_Connect(); } return(Is_CA_Connected); }