Nick, you are correct and i thought my memory was better than it was. The only thing i was not sure of was how to post the code rather than uploading the file. Still reading and still learning.
As for the way in which things are wired, i followed the wiring example i found on an Aduino web site, since that time i have found other sites that show slight differences in wiring. So with that being said I will tell you what i have and how it is wired.
The base of course is Arduino Uno with the atmel 328. On top of that is a relay input sheild by Velleman part number VMA05.
Here is the link to the data sheet on it:
http://www.vellemanusa.com/downloads/0/modules/usermanual_vma05.pdf
Now as to the wiring if i understand what is being said correctly there is all the way on the right a +5 and a ground, then you have 6 inputs which are normally high and have a diode that you take to gnd to activate the input. And there is a ground to right after the inputs. this ground if i am reading correctly is the common for the inputs and should be tied to the ground for the +5. So i have that done. then i have a push on push off toggle switch connected between the grounds and input 2, i also have a toggle switch connected between input 5 and ground. When i turn on input 5 outputs 9 and 12 turns on. Ouput 12 follows input 5 so when 5 is on 12 is on and when 5 is off 12 is off. 9 on the other hand is like a latch when it is turned on it should wait for the edge of input 2. When the edge of input 2 is detected it will reset output 9.
Now the reason i used interupts is because when i started working with this device I was doing research and found that the interupts can be set for edge sensitive which is what i require.
When i place this in service the toggle switches will be replaced with thru beam sensors so it will be a positive make break. But first i need it to function properly all the time.
Here is a break down of the application, a piece is detected and inspected, if the piece is good it passes. If the piece is failed it will trigger input 5. Output 9 is connect to an actuator that will open a divert slot. The sensor connected to input 2 is just before the divert slot. So now when the piece drops down in the divert slot after the tail end of it has cleared the sensor it will reset the output turning it off and closing the divert slot. This all of course happens internally in the Arduino.
The other part is an application that is being written that i can send and receive data to and from the Arduino. I have tested the serial connection and it works fine.
As a test just to see if it is the USB/Serial communications causing the issues with the ISR routine. I did the following two test.
Test 1, disconnected the USB/Serial cable between PC and Arduino and the problem still presented itself.
Test 2, rewrote the application with just the inputs and outputs and took out all the serial communications. The problem still presented itself.
So to be it could be either i am using the Input output shield incorrectly, or i have the wiring wrong or there is something wrong with the shield, or there is some noise comming from somewhere. That is why i am here to ask the experts who have been doing the Arduino for a long period of time check over what i have and tell me if something other than my poor writing skills is causing the issues with the arduino not doing the edge detect properly all the time.
Thanks again and have a great day.