I authored a program that we use in several pieces of equipment. The program is generic in nature, and can run on many different versions of our machines.
As I add features to the same basic program, I find I needed to add three IO cards in the expansion slots to support the new features. I want the program to be backwards and forward compatable, so I leave existing IO assignments as they are.
Heres my problem:
I'm using the same program in many machines, Some machines only use the on board IO, some use one of the IO expansion, and some use both the IO.
I set up the IO Configuration manually so that the same Xs and Ys are assigned to a particular slot. In this case:
Slot 0 is Automatic (I put an analog in this one, sometimes)
Slot 1 is X100 Y100
Slot 2 is X120 Y120
Slot 3 is X140 Y140
Example:
I use X140 (its in slot 3) to look at a tach pulse to see if a long shaft is OK (the belt hasn't broke, etc). In my program, If I don't see this pulse, I raise an alarm to check the shaft belt.
On some machines, I don't use this feature (solid shaft, no belt) In this case, I simply connect the X140 input to the regular tach so they both get pulsed by the same sensor.
What I would like to do, is check and see if this card is installed in Slot 3, if it isn't, then ignore (open contact) the requirement for the X140 tach pulse input.
QUESTION - Is there a way to tell, programatically, if an IO card is installed in a slot? This would make my life very easy.
John