public Form1() { InitializeComponent(); int iIdx; m_iCom = 4; // using COM4 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4080D; // the sample is for ADAM-4080D m_iChTotal = Counter.GetChannelTotal(m_Adam4000Type); for (iIdx = 0; iIdx < m_iChTotal; iIdx++) { cbxChannel.Items.Add(iIdx.ToString()); } adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); // LED source cbxLedSource.Items.Add("Channel 0"); cbxLedSource.Items.Add("Channel 1"); cbxLedSource.Items.Add("External input"); }
public Form1() { InitializeComponent(); m_iCom = 4; // using COM4 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4021; // the sample is for ADAM-4021 adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); }
public Form1() { InitializeComponent(); m_iCom = 4; // using COM1 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4018M; // the sample is for ADAM-4018M m_iChTotal = AnalogInput.GetChannelTotal(m_Adam4000Type); m_bCh = new bool[m_iChTotal]; adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); }
public Form1() { InitializeComponent(); m_iCom = 4; // using COM4 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_AsciiProtocol = true; // the protocol is Advantech ASCII m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4022T; // the sample is for ADAM-4022T adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); m_pv1LblHigh = new float[2]; m_pv1LblLow = new float[2]; m_pv2LblHigh = new float[2]; m_pv2LblLow = new float[2]; m_dVals = new float[3]; // for SV, PV, MV }
public VoltageController(VM_MSConfig msConfig) { Config = msConfig; m_iCom = 3; // using COM4 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4019P; // the sample is for ADAM-4019P m_iChTotal = AnalogInput.GetChannelTotal(m_Adam4000Type); m_byRange = new byte[m_iChTotal]; adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum Module = m_Adam4000Type.ToString(); if (adamCom.OpenComPort()) { // set COM port state, 9600,N,8,1 adamCom.SetComPortState(Baudrate.Baud_9600, Databits.Eight, Parity.None, Stopbits.One); // set COM port timeout adamCom.SetComPortTimeout(500, 500, 0, 500, 0); m_iCount = 0; // reset the reading counter // get module config if (!adamCom.Configuration(m_iAddr).GetModuleConfig(out m_adamConfig)) { adamCom.CloseComPort(); LogHelper.WriteErrorLog("Failed to get module config!"); return; } // RefreshChannelEnable(); RefreshChannelRange(); // m_bStart = true; // starting flag } else { LogHelper.WriteErrorLog("Failed to open COM port!"); } }
public Form1() { InitializeComponent(); int iIdx; m_iCom = 4; // using COM2 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4024; // the sample is for ADAM-4024 m_iChTotal = AnalogOutput.GetChannelTotal(m_Adam4000Type); m_byRange = new byte[m_iChTotal]; for (iIdx = 0; iIdx < m_iChTotal; iIdx++) { cbxChannel.Items.Add(iIdx.ToString()); } adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); }
public Form1() { InitializeComponent(); m_iCom = 4; // using COM4 m_iAddr = 19; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_DOStatus = new bool[2]; m_bStart = false; m_Adam4000Type = Adam4000Type.Adam4011; // the sample is for ADAM-4011 //m_Adam4000Type = Adam4000Type.Adam4011D; // the sample is for ADAM-4011D //m_Adam4000Type = Adam4000Type.Adam4012; // the sample is for ADAM-4012 //m_Adam4000Type = Adam4000Type.Adam4013; // the sample is for ADAM-4013 adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disable checksum txtModule.Text = m_Adam4000Type.ToString(); if (m_Adam4000Type == Adam4000Type.Adam4013) { panelEvent.Visible = false; panelAlarm.Visible = false; } }
public Form1() { InitializeComponent(); m_iCom = 4; // using COM4 m_iAddr = 1; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; //m_Adam4000Type = Adam4000Type.Adam4050; // the sample is for ADAM-4050 //m_Adam4000Type = Adam4000Type.Adam4051; // the sample is for ADAM-4051 //m_Adam4000Type = Adam4000Type.Adam4052; // the sample is for ADAM-4052 //m_Adam4000Type = Adam4000Type.Adam4053; // the sample is for ADAM-4053 m_Adam4000Type = Adam4000Type.Adam4055; // the sample is for ADAM-4055 //m_Adam4000Type = Adam4000Type.Adam4056S; // the sample is for ADAM-4056S //m_Adam4000Type = Adam4000Type.Adam4056SO; // the sample is for ADAM-4056SO //m_Adam4000Type = Adam4000Type.Adam4060; // the sample is for ADAM-4060 //m_Adam4000Type = Adam4000Type.Adam4068; // the sample is for ADAM-4068 //m_Adam4000Type = Adam4000Type.Adam4069; // the sample is for ADAM-4069 m_iDITotal = DigitalInput.GetChannelTotal(m_Adam4000Type); m_iDOTotal = DigitalOutput.GetChannelTotal(m_Adam4000Type); if (m_Adam4000Type == Adam4000Type.Adam4050) { InitAdam4050(); } else if (m_Adam4000Type == Adam4000Type.Adam4051) { InitAdam4051(); } else if (m_Adam4000Type == Adam4000Type.Adam4052) { InitAdam4052(); } else if (m_Adam4000Type == Adam4000Type.Adam4053) { InitAdam4053(); } else if (m_Adam4000Type == Adam4000Type.Adam4055) { InitAdam4055(); } else if (m_Adam4000Type == Adam4000Type.Adam4056S) { InitAdam4056S(); } else if (m_Adam4000Type == Adam4000Type.Adam4056SO) { InitAdam4056SO(); } else if (m_Adam4000Type == Adam4000Type.Adam4060) { InitAdam4060(); } else if (m_Adam4000Type == Adam4000Type.Adam4068) { InitAdam4068(); } else if (m_Adam4000Type == Adam4000Type.Adam4069) { InitAdam4069(); } adamCom = new AdamCom(m_iCom); adamCom.Checksum = false; // disbale checksum txtModule.Text = m_Adam4000Type.ToString(); }
public Form1() { InitializeComponent(); m_szIP = "172.18.3.69"; m_Port = 1025; m_iAddr = 2; // the slave address is 1 m_iCount = 0; // the counting start from 0 m_bStart = false; //m_Adam4000Type = Adam4000Type.Adam4050; // the sample is for ADAM-4050 //m_Adam4000Type = Adam4000Type.Adam4051; // the sample is for ADAM-4051 //m_Adam4000Type = Adam4000Type.Adam4052; // the sample is for ADAM-4052 //m_Adam4000Type = Adam4000Type.Adam4053; // the sample is for ADAM-4053 //m_Adam4000Type = Adam4000Type.Adam4055; // the sample is for ADAM-4055 //m_Adam4000Type = Adam4000Type.Adam4056S; // the sample is for ADAM-4056S //m_Adam4000Type = Adam4000Type.Adam4056SO; // the sample is for ADAM-4056SO //m_Adam4000Type = Adam4000Type.Adam4060; // the sample is for ADAM-4060 m_Adam4000Type = Adam4000Type.Adam4068; // the sample is for ADAM-4068 //m_Adam4000Type = Adam4000Type.Adam4069; // the sample is for ADAM-4069 m_iDITotal = DigitalInput.GetChannelTotal(m_Adam4000Type); m_iDOTotal = DigitalOutput.GetChannelTotal(m_Adam4000Type); if (m_Adam4000Type == Adam4000Type.Adam4050) { InitAdam4050(); } else if (m_Adam4000Type == Adam4000Type.Adam4051) { InitAdam4051(); } else if (m_Adam4000Type == Adam4000Type.Adam4052) { InitAdam4052(); } else if (m_Adam4000Type == Adam4000Type.Adam4053) { InitAdam4053(); } else if (m_Adam4000Type == Adam4000Type.Adam4055) { InitAdam4055(); } else if (m_Adam4000Type == Adam4000Type.Adam4056S) { InitAdam4056S(); } else if (m_Adam4000Type == Adam4000Type.Adam4056SO) { InitAdam4056SO(); } else if (m_Adam4000Type == Adam4000Type.Adam4060) { InitAdam4060(); } else if (m_Adam4000Type == Adam4000Type.Adam4068) { InitAdam4068(); } else if (m_Adam4000Type == Adam4000Type.Adam4069) { InitAdam4069(); } adamSocket = new AdamSocket(); txtModule.Text = m_Adam4000Type.ToString(); }