Page 1 of 1

Simple C# programming help needed!

Posted: Sun Oct 28, 2018 5:26 am
by bprion
I have a PhidgetInterfaceKit 0/0/4 and am using it to ring a bell for shift changes in my shop.

I will use a Windows 10 computer and make use of a scheduled task to accomplish this. I need to create an executable program that will close a contact for 3 seconds then open it.

I installed the proper libraries and can control the 0/0/4 manually with the Phidget Control Panel but now need to write an executable that can be called by a scheduled Windows task.

I have Visual Studio installed and am able to open the programming examples from the Phidgets website but they are all much more than I need for my simple project and I am not a programmer.

Would someone please give me the code needed to open , delay 3 seconds, then close a contact on my 0/0/4 board? Ideally this would be in C# since I have access to a developer who knows that language and could help with other general things.

Any help is greatly appreciated!

Re: Simple C# programming help needed!

Posted: Mon Oct 29, 2018 10:19 am
by fraser
Assuming you've opened the channels and they're attached, you can use something like this:

Code: Select all

        Phidget22.DigitalOutput[] Relays = new DigitalOutput[4];
        private void PerformTask(int RelayIndex)
        {
            Relays[RelayIndex].State = false;

            System.Threading.Thread.Sleep(3000);

            Relays[RelayIndex].State = true;
        }

Re: Simple C# programming help needed!

Posted: Thu Nov 01, 2018 5:46 am
by bprion
Fraser,

Thanks very much for your reply.

Unfortunately, even with the code you provided, the demands of this project exceed my programming capabilities.

I am willing to pay you or another programmer to provide me with an executable program that I can call from Windows 10 Task Scheduler to ring the bell in my shop.

Are you interested in doing this?