private void tmrReadInputs_Tick(object eventSender, System.EventArgs eventArgs) /* Handles tmrReadInputs.Tick */ { tmrReadInputs.Stop(); // read FirstPortA digital input and display // Parameters: // PortNum :the input port // DataValue :the value read from the port short DataValue = 0; MccDaq.ErrorInfo ULStat = DaqBoard.DIn(PortNum, out DataValue); // display the value collected from the port lblPortRead.Text = DataValue.ToString("0"); // parse DataValue into bit values to indicate on/off status for (int i = 0; i <= 7; ++i) { if ((DataValue & (1 << i)) != 0) { lblBitVal[i].Text = "1"; } else { lblBitVal[i].Text = "0"; } } tmrReadInputs.Start(); }
private void tmrReadInputs_Tick(object eventSender, System.EventArgs eventArgs) { tmrReadInputs.Stop(); ushort DataValue; MccDaq.ErrorInfo ULStat = DaqBoard.DIn(PortNum, out DataValue); lblShowPortVal.Text = DataValue.ToString("0"); tmrReadInputs.Start(); }
private void tmrReadInputs_Tick(object eventSender, System.EventArgs eventArgs) /* Handles tmrReadInputs.Tick */ { tmrReadInputs.Stop(); ushort DataValue; MccDaq.ErrorInfo ULStat = DaqBoard.DIn(PortNum, out DataValue); lblPortVal.Text = "Value read at auxillary digital inputs:"; lblShowPortVal.Text = DataValue.ToString("0"); tmrReadInputs.Start(); }