I HAVE DONE simple prog of PICK_CONROD but still runs the priority program
for example, even though the DI signal 22 (INFEED_1 is OFF ) still jumps to the LBL 101 and runs prog PICK_CR_1
and same thing happening for all the rest jump LBLs
I HAVE DONE simple prog of PICK_CONROD but still runs the priority program
for example, even though the DI signal 22 (INFEED_1 is OFF ) still jumps to the LBL 101 and runs prog PICK_CR_1
and same thing happening for all the rest jump LBLs
The simplest solution for your code is to place an END statement or a JMP LBL[100] between line 3 and 4 of your PICK_CONROD program.
.. still jumps to the LBL 101..
No, it doesn't jump to the LBL 101, it executes all lines from 1 till 3, and after line 3 it executes the LBL 101.
Therefore the solution from DS186 will work.
The simplest solution for your code is to place an END statement or a JMP LBL[100] between line 3 and 4 of your PICK_CONROD program.
My main issue is that it runs without any satisfied condition it's running the sub program
And DS186 told you the solution.
May be it's better to insert a jmp 50, and insert a LBL 50 at the beginning of the program, depends on what you want to achieve.
Multiple solutions have been provided. If all your inputs are off, the program will execute label 101. Put a jump label 100 after your three conditional statements.
Also, learn to use the step button.
I personally hate the way Fanuc TP programming forces you to jump around like a monkey on a bungee and quite often can be confusing, although they can deliver the required results too, this is just my personal opinion of mine by the way.
Robot executes exactly what you code in.
If the condition evaluation result does not match the argument, then it will shoot through as you are not asking the robot to look for it (I refer to this as shoot through, it's not a Fanuc term).
So straight away looking at your signal state monitoring, unless one of the signals is in the state you're looking for it will shoot through.
Many solutions to this problem exist, but the main thing to understand is 'why' this is happening, then you can decide on appropriate solutions that you can also understand too.
If I was new to programming and Fanuc syntax, I would explore other solutions available, solutions that I can easily recall, understand, and find easier to read to should I need to 'refresh my mind'.
For example, I like the SELECT as it's much like a menu choice based on the value.
Assign the 3 DI's to a GI[x] in the input allocation.
Then you can read the result of all 3 DI's as a binary value which ranges from 0 - 6 (seven values) simply by:
R[x] = GI[x]
SELECT R[x] = [value1] [action]= [value2] [action]= [value4] [action] ELSE [action]
This then simply looks at the individual states, any other state the ELSE action applies.
Therefore this actions what I want to action per input, and if there are inputs not in the correct state due to malfunction etc, I catch it with the ELSE action which as already mentioned could be to a JMP LBL at the beginning of the program.
The advantage of this is that you could then use other binary values by simply adding them to the SELECT instruction.
Again, many solutions available, so I would explore them further before just applying the first thing that works.
A good direct reference is the branching instructions in the manual.
You need to be a member in order to leave a comment