How to close Interface kit 8/8/8 outputs

Supporting Visual Studio on Windows
Laura
Fresh meat
Posts: 3
Joined: Fri Feb 15, 2013 2:38 am
Contact:

How to close Interface kit 8/8/8 outputs

Postby Laura » Fri Feb 15, 2013 3:03 am

Hi,

It's just my first program en C# with Phidgets and I can't close the outputs of the Interface kit 8/8/8. I use the library Phidget21.NET, and I call the function ifkit.close() just like that:
ifKit.close();
ifKit = null;
But after running this code, my outputs are still ON, and when I start again the code, the outputs remenber the last configuration. The only way I found to reset the KitInterface is to disconnect it from the usb...but I can't do this each time!!

Please, I need help :cry:

User avatar
Patrick
Lead Developer
Posts: 3091
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: How to close Interface kit 8/8/8 outputs

Postby Patrick » Fri Feb 15, 2013 9:27 am

You need to switch the outputs off in your code, the interfacekit will not reset it's state on it's own.

-Patrick

Laura
Fresh meat
Posts: 3
Joined: Fri Feb 15, 2013 2:38 am
Contact:

Re: How to close Interface kit 8/8/8 outputs

Postby Laura » Mon Feb 18, 2013 12:58 am

Hi,

Thanks for your answer. Can you tell me which function I have to use, please?

User avatar
mparadis
Site Admin
Posts: 644
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: How to close Interface kit 8/8/8 outputs

Postby mparadis » Tue Feb 19, 2013 9:03 am

To turn off all digital outputs, you could use a loop like this:

Code: Select all

for (int i = 0; i < ifKit.outputs.Count; i++)
{
     ifKit.outputs[i] = false;
}

Laura
Fresh meat
Posts: 3
Joined: Fri Feb 15, 2013 2:38 am
Contact:

Re: How to close Interface kit 8/8/8 outputs

Postby Laura » Tue Feb 19, 2013 9:05 am

I've just tried it and it works :)

Thanks!!!


Return to “C#.NET”

Who is online

Users browsing this forum: No registered users and 1 guest