Newbie Question about switch..

This is the English forum for all topics related to IO-Warrior. Please post in English only

Moderator: Guido Körber

Post Reply
Thewhistler
Posts: 5
Joined: Fri Jul 06, 2007 12:32 pm

Newbie Question about switch..

Post by Thewhistler »

Hi !

I just wondered if any1 could answer this question...

All i want to do is to connect a hardware switch to the io warrior.
The switch has three states. 1,2 and 3
Then i want to read these states in some bit of C# code on my windows
PC.

Would this be easy to do with the I/O warrior, or even better has anyone done this and in that case could post some info about it ?

Best Regards
Tor-Erik
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

Three states do not fit into a bit, a bit can have only two states, not three. Depending on the physical topology of your switch you will need to use two or three input pins on the IO-Warrior. And this is a very easy thing to do.
Thewhistler
Posts: 5
Joined: Fri Jul 06, 2007 12:32 pm

Post by Thewhistler »

Great news !

Gonna order some units for prototyping then.
i guess an IOwarrior24 starter kit would do the trick then.

If this work out okay i gonna need alott more units. This gonna
be a part of a simulator system in our company :)
Thewhistler
Posts: 5
Joined: Fri Jul 06, 2007 12:32 pm

Post by Thewhistler »

Okay three states of my swithc is kinda wrong. sorry for my bad language :)
The swith has only to main states wich is state1 and state2 (up and down)
and the third isnt used and that is center.

So if i understand this correctly all i have to do is to connect
the center position to common ground. Then i connect the "up state"
from the switch to Pin1 on the IOW24 and then i connect the "down state"
to pin2 on the IOW24 ?
This will set 0 or 1 bit on the two different ports of the iow24 i guess. so then i just read ou those ports via some C# code.

Thanks again for your reply...

Best Regards
Tor-Erik
Guido Körber
Site Admin
Posts: 2856
Joined: Tue Nov 25, 2003 10:25 pm
Location: Germany/Berlin
Contact:

Post by Guido Körber »

Yes, correct.
Post Reply