A bit of background, I have a Kuka and a machine with multipul programs.
The Kuka has 2 differant tools.
What is happening is the machine sends a signal , i am ready input 5
The machine also sends a program number to the robot Inputs 1 2 3 4 (Binary)
I am using Input 1 to signal to use tool 2 also
My code looks like this
If $IN[5] and not $IN[1] then cup 1
If $IN[5] and $IN[1] then cup 2.
Problem is every once in awhile it will pickup cup 1 when its suppose to get cup 2.
I thought I should add
If $IN[1] and or $IN[2] and or $IN[3] and or $IN[4] then $flag 20=True
This would ensure the program from the machine was read first
Then I could add to the Cup program
If $flag[20] and $IN[5] and not $IN[1] then cup 1
If $flag[20] and $IN[5] and $IN[1] then cup 2.
I tried it but am getting errors. How can I ensure that the program is being read Inputs 1 to 4
before The I am ready signal is being read.