Hi guys! Connected the PC to the Fanuc via Modbus. Flag and DI have been configured for Rack 96. I set up the group logic GI1 responds from 1 to 8 DI and GI2 responds from 9 to 16 DI. Question: I can't write logic so that there are 4 commands: Start, stop, general stop and reset. Help please.
Bg Logic
-
Coldstart -
April 18, 2024 at 12:07 PM -
Thread is Unresolved
-
-
Hi,
Based on your other thread (about the same issue...), what exactly is it that you want to achieve? And why do you insist on using BG Logic for this -
The task is to enable the program via Owen OPC server, where the data type is Word. For example, IF (10) THEN F [PNS1]= ON . For the life of me, I can't write logic, I'm confused....
-
You must use UOP signals.
If you can map to DIs then you might as well just map to UIs instead and control it directly without using BG Logic.
-
I understand that there are ways not to use Bg Logic.
But this is exactly the task because at the enterprise we can connect to the robot only in this way. But I can't determine the order of writing the program in the presence of my data...
-
Let's break it down for you.
In order to start the robot remotely, you need to use the UOP-signals. First you need to enable the use of UOP signals and also change from local to remote (MENU->0 NEXT->System->Config).
Now the robot will only start program execution in AUTO with an input to the UOP input for START.
The UOP-signals can be mapped to either Digital Inputs or Flags.
When starting remotely, you can choose from a few different start methods, either PNS (Program Number Selection), RSR (Robot Service Request) or Other (where you specify a specific TP program as the entry point).
For PNS and RSR methods, your TP programs must be named in a certain way, with a prefix in the beginning of the program's name.
Then you will send which program number to start along with your START input.
If you chose "Other" as program start method (MENU->Setup->Program start) you don't need to send these numbers, the system will always start the specified program (for instance one named "MAIN"). Then inside this MAIN-program you can have logic that will call the correct subprogram depending on certain conditions of your choosing.
I would recommend you to have a look in the operator's manual for the robot controller in question, contact your local FANUC representative and ask for it.
Maybe you would also benefit from some training to get a hang of the syntax used in programming TP programs. Or you can find dozens of tutorials on youtube.
Another good source for knowledge for beginners is this page:
https://www.onerobotics.com/And for your issue, specifically this entry:
Starting FANUC Robots in AUTO - ONE Robotics Company
FANUC robots doesn't handle word data type, only individual bits or grouped together as Group I/Os where the integer value will be represented.
If you are able to send signals to the robot's digital inputs, then you can use the UOP-signals. No need for background logic.
Here a brief example:
Code
Display More(Pseudo-code) !Remote controller sends start command to robot via UOP-signals !and start method is "Other", program that will start is "MAIN.TP" MAIN.TP LBL[1] !Initialize robot I/Os, flags and registers CALL INIT !Go to home position CALL HOME !Check which subprogram should be used SELECT GI[1:job number] = 1, CALL JOB_1 = 2, CALL JOB_2 = 3, CALL JOB_3 ... ... !If unknown job number is sent, handle this in separate program DEFAULT, CALL UNKNOWN_JOB_NUMBER !Check for cycle stop IF DI[10:Stop cycle] THEN END ELSE JMP LBL[1] ENDIF END
-
Thank you for such a detailed answer. Believe me, I made all the above settings, and the robot works when simulating remote work. I just don't have the sense to write it in logic using the right function. You're right, I need to read more, but YouTube didn't find any videos on my question.
-
If you use the TP when programming, your syntax will not be an issue. Most of the times you can discover/learn how to do the logic programming when you see which instructions are available for you.
Thank you for such a detailed answer. Believe me, I made all the above settings, and the robot works when simulating remote work. I just don't have the sense to write it in logic using the right function. You're right, I need to read more, but YouTube didn't find any videos on my question.
What do you mean with the above statement?
You obviously got the robot to work, right?
Which logic is it that you "don't have the sense to write"? -
That's right, when simulating signals, the robot executes a program linked to PNS1. I need BG Logic using GI1 and GI2 commands that include the necessary flags. As I understand it, in BG Logic, write 2 'words', where in one the command, in the other the program code.
-
For more information, I can send photos of my sketches by email so that you can understand me more accurately.
-
That's right, when simulating signals, the robot executes a program linked to PNS1. I need BG Logic using GI1 and GI2 commands that include the necessary flags. As I understand it, in BG Logic, write 2 'words', where in one the command, in the other the program code.
So, you are able to run the desired program when sending a certain signal -good!
Then you would proceed to program your logic inside that program to get the robot to perform the work you want?
Still don't understand your need of BG Logic...
Still don't understand what kind of information you want to send through the Group I/O.
Which words do you want to write, and why?
Maybe try to explain what exactly you mean with "command" and with "program code".
-
You don't really need BG Logic. If you can write from your PC to GIs, then you could just as easily write to UIs, there is no difference. Just map the UIs to the correct rack/slot/start point.
DI, GI, and UI are all the same thing as far as an external device is concerned. The robot uses them for different purposes, but to an external device, you PC for example, they are all just bits.
-
Commands are sent via the Owen OPC server. If I enter the value 55, then GI1 equals 7, if I change the address from 0 to 1 in Owen OPS, then the value 55 in GI2 is 14080. When Gi1 = 7 then DI 1,2,3,5,6 = on. When GI2 = 14080 then DI 17,18,19,21,22 = on
-
It sounds like your GI mapping is off. In your GI config you have rack, slot, start pt, num pts. The binary for 7 is 0000 0111, the binary for 55 is 0011 0111, and for 14080 it's 0011 0111 0000 0000. My guess is that you are either looking at a big/little endian issue or you have a problem with your config in your GI config (or maybe both).
When I see you getting 0000 0111, when you should be getting 0011 1011, I get the impression that start pts is off by 3 in your config in the robot. When I see you getting 0011 0111 0000 0000 when you should be getting 0000 0000 0011 0111, I start thinking big/little endian problem.
When you look at the binary equivalents to the numbers you are putting in against what you are getting out it's reasonable to conclude that the information is getting through, just not decoded properly on the robot side.
-
That's right, I just figured out GI.))) It remains to correctly write the condition that includes the program. I'm not strong here, with your help there will be a victory over such an interesting task)