AnalogChannel analogChannel=ichannelInterface as AnalogChannel; if (analogChannel==null) return; int channelNumber = analogChannel.ChannelNumber;