Quote:
Originally Posted by z2daj
Now here is where things get interesting. We have read and tried all of the above solutions AND the reason why we posted the code was so that you could better understand our situtation. Just because we had 3 conditions for a boolean operation does not constitute snotty remarks. It is very eaasy to ignore the third condition as that is not our main problem. I think it is you that must read our responses to the solutions posted. Thank you Mr. Lim and those of you who posted solutions, we have tried all of them , but failure seems too proud to leave us this day.
|
This will be my last post on this thread.
You originally said that you had two limit switches wired to DI 4 on the digital sidecar.
You then posted a code fragment with this:
Dig1 = new DigitalInput(1, 1);
which is an example of code that can not possible work. Why? The Analog I/O module must be in slot #1.
I replied that the code fragment should have been
Dig1 = new DigitalInput(4, 4);
assuming the digital I/O module is plugged into slot 4 of the cRIO.
You then replied that you had "tried all of the possible solutions" and I asked you to tell us exactly how the switches are wired.
You did not.
The discussion of three conditions came about because you asked. I merely said that you had more than one issue... I also asked you to tell us what you were trying to accomplish. You did not.
The discussion of normally open versus normally closed was especially pertinent as we still do not know how the
TWO switches are wired.
Since you will not tell us how things are wired we have to guess... Two normally open switches, wired in series and operated one at a time will never close a circuit and always return a 1 in your code... This is an example of why limit switches are almost always wired as normally closed.
You were asked to explain your wiring. You did not...
You posted code which could not work and you knew that it could not work because you are addressing the analog module...
And somehow you infer that we are to blame because we can not read your mind...
I am done here...
Good luck
Mike