Exemple #1
0
        public int SetDigitalOutput(int channel, bool State)
        {
            if (_cardsDiscovered != VM167DLL.Connected())
            {
                throw new Exception("Card not present, reconnect and restart program");
            }

            if (State)
            {
                VM167DLL.SetDigitalChannel(_cardAddress, channel);
            }
            else
            {
                VM167DLL.ClearDigitalChannel(_cardAddress, channel);
            }
            return(1);
        }
Exemple #2
0
        public int SendSignal(int channel, int HoldMS)
        {
            if (_cardsDiscovered != VM167DLL.Connected())
            {
                throw new Exception("Card not present, reconnect and restart program");
            }

            if (_offTimer == null)
            {
                _offTimer = new System.Timers.Timer();
            }
            if (_offTimer.Enabled)
            {
                return(0);
            }
            _offTimerChannel = channel;

            _offTimer.Elapsed += _offTimer_Elapsed;
            _offTimer.Interval = HoldMS;
            VM167DLL.ClearDigitalChannel(_cardAddress, _offTimerChannel);

            _offTimer.Start();
            return(1);
        }