private void btnPlayOneProgram_Click(object sender, EventArgs e) { int ret = 0; int[] strPrg = new int[256]; strPrg[0] = Convert.ToInt32(m_edtSelProgram.Text); strPrg[1] = 0; if (1 == InitComm()) { if (0 == m_nCommType) { ret = CP5200.CP5200_RS232_PlaySelectedPrg(m_nCardID, strPrg, 1, 0); } else { ret = CP5200.CP5200_Net_PlaySelectedPrg(m_nCardID, strPrg, 1, 0); } if (0 <= ret) { MessageBox.Show("Successful"); } else { MessageBox.Show("Fail"); } } }
private void btnPlayProgram_Click(object sender, System.EventArgs e) { InitComm(); int nRet = 0; int[] nProNo = new int[2]; nProNo[0] = Convert.ToInt32(m_txtProNo.Text); nProNo[1] = 0; if (m_nCommType == 1) //網口 { nRet = CP5200.CP5200_Net_PlaySelectedPrg(Convert.ToByte(m_cmbCardID.SelectedIndex + 1), nProNo, 1, 0); } else //串口 { nRet = CP5200.CP5200_RS232_PlaySelectedPrg(Convert.ToByte(m_cmbCardID.SelectedIndex + 1), nProNo, 1, 0); } if (nRet >= 0) { MessageBox.Show("Successful"); } else { MessageBox.Show("Fail"); } }