Display MoreI wanted to set the values like parameters for laser.
EX.
H1 = 1000 ; Set Laser Power to 1000 Watt
M20 ; Set Laser to ready
M21 ; Start Laser
These below user defined variables will Communicate with PLC. Similarly GET and SEND data.
HCodeREQ
HCodeACQ
Posts by RKind
-
-
Why don't you open a new thread? You have a complete different question.
What do you mean by 'it is not working'?
Imho this code even won't be compiled. So it can't work.
F.e. you define an array of integer: FANUC_OUT
then you use FANUC_OUT as a structure FANUC_OUT.bHCodeREQ[i].
This will not be compiled.
Your main program
Code--SECTION 4: MAIN PROGRAM ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ BEGIN WRITEHM END WRITEHM
doesn't do anything but calling itself, so what other things should this program do instead of nothing?
Even worse, this is a endless recursive calling, you will get a stack overflow or something similar.
Hello Hermann,
Sorry I would have created a new thread.
Exactly, I'm trying to compile the file but have so many errors that it doesn't work.
That's where I would need your help to fix these errors.
As mentioned before, I am new to KAREL. I am reading documents and learning through the threads created here.
-
Hello all!!
I am just posting here without creating a new thread.
I am new to Karel but trying to understand all the functions.
I have created the code to send and receive the values from the controller to the PLC via a ProfiNET.
But unfortunately it is not working.
I would like to get some help from the experts out here.
Code: WriteHM
Display More------------------------------------------------------------------------------------------------------------------------ --SECTION 1: Program environment ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ PROGRAM WRITEHM %COMMENT = 'WRITEHM' %NOLOCKGROUP %NOBUSYLAMP %NOPAUSE = ERROR+COMMAND+TPENABLE %PRIORITY = 1 -- Priority for task execution -> 0 is highest priority %TIMESLICE = 8 -- Time slicer for tasks having the same priority, 1 is highest. %DELAY = 8 -- Each 256ms a task is delayed by default 8ms %ALPHABETIZE %NOPAUSESHFT --%INVISIBLE --% --%CMOSVARS %NOABORT= ERROR + COMMAND ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ --SECTION 2 constant and variables declaration ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ CONST CLR_SCRN = 128 VAR -- M and H code SPS_IN FANUC_OUT iMCode : ARRAY [5] OF INTEGER bMCodeREQ : ARRAY [5] OF BOOLEAN iHCode : ARRAY [3] OF INTEGER bHCodeREQ : ARRAY [5] OF BOOLEAN rHCode : ARRAY [3] OF REAL -- M and H code SPS_OUT FANUC_IN bMCodeACQ : ARRAY [5] OF BOOLEAN bHCodeACQ : ARRAY [5] OF BOOLEAN ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ --SECTION 3: ROUTINES ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ ROUTINE tp_err(message:STRING;abort_flag:BOOLEAN) -- Writes on th TP error line a message & aborts the program if required BEGIN WRITE TPERROR (CHR (CLR_SCRN) , message, CR) IF abort_flag THEN ABORT; ENDIF END tp_err ROUTINE SetHCode (iHCode: INTEGER; rHCodeVal: REAL; bQuick: BOOLEAN) -- Suche "freien H-Code" VAR iSet : INTEGER I : INTEGER FANUC_OUT : ARRAY [5] OF INTEGER FANUC_IN : ARRAY [5] OF INTEGER BEGIN iSet=0 ; FOR I=1 TO 3 DO IF NOT (FANUC_OUT.bHCodeREQ[I]) THEN iSet=I; ENDIF ENDFOR IF (iSet=0) THEN --WRITE TPPROMPT(’FEHLERMELDUNG AND BEWEGUNGSSTOP OR WARTEN BIS EIN H-Code FREI IST’,CR) else FANUC_OUT.iHCode[iSet]=iHCode; FANUC_OUT.rHCode[iSet]=rHCodeVal; FANUC_OUT.bHCodeREQ[iSet]=TRUE; ENDIF IF NOT (bQuit) THEN --BEWEGUNGSSTOP / PRGSTOP; WHILE NOT(FANUC_IN=bHCodeACQ[iSet]) DO --WARTE EINEN ZYKLUS; ENDWHILE FANUC_OUT.bHCodeReq[iSet] = FALSE; ENDIF RETURN END SetHCode ROUTINE QuitHCodes() --am Ende oder Anfang des ZYKLUS BEGIN -- Quittiere alle H-Code FOR I:=1 TO 3 IF FANUC_IN.bHCodeACQ[I] THEN FANUC_OUT.bHCodeREQ[I]:= FALSE; ENDIF ENDFOR RETURN END QuitHCodes ROUTINE GetHCode() -- am Anfang oder Ende des ZYKLUS BEGIN -- Suche "gesetzen H-Code" iSet:=0; FOR I:=1 TO 3 IF SPS_IN.bHCodeREQ[I] THEN actHCode := SPS_IN.iHCode[I] actHCodeVal := SPS_IN.rHCode[I] ExecuteHCode(actHCode, actHCodeVal); SPS_OUT.bHCodeACQ[I]:=TRUE; ENDIF ENDFOR QuitHCodes(); RETURN END GetHCode ROUTINE QuitHCodes() BEGIN -- Rücksetzen des Acquire-Bits FOR I:=1 TO 3 IF NOT(SPS_IN.bHCodeREQ[I]) THEN SPS_OUT.bHCodeACQ[I]:=FALSE; ENDIF ENDFOR RETURN END QuitHCodes END WRITEHM ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ --SECTION 4: MAIN PROGRAM ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ BEGIN WRITEHM END WRITEHM
-
Hello Oats,
I agree with you but i would have suggested the same, using a absolute value must solve your issue.
-
Hello Oats,
It will be more easy to look into problem if you share your pseudocode
-
Hello All,
I am going to use Laser Cladding apllication for my coming project.
Just trying to gather the data and inputs from you all expertise people around here.
Basically i am using Fanuc M20ID35-30P-A-CENR, Controller g R-30iB Plus Type A, Fieldbus ProfiNET with FANUC/MOLEX card (yet to finallise), DCS, ProfiNET Safety and iRProgrammer.
What all the things must be taken into account before hand for this special application
I also have developed pseudocode for my understanding.
Any reference backup would also help me to understand the concepts.
Thanks and Regards,
RK
-
Hello,
currenly I am working on Tucker device (stud weld) and willing to pass on all the errors from tucker device to the plc.
thank you in advance
-
Thank you dewitm
I have checked these codes and its working perfect.
Can i ask you one more thing, is it possible to seperate robot error and slave devices error?
-
hello dewitm,
I only need to send alarm code and not the complete string. and you said it is possible sending only code, how do we do that
-
Isn't any other option for sending alarm
I am not sure about this but is it possible to receive alarm code from tucker system in one byte and just send it to plc. and later plc will display those alarm code using data block. -
Hello All,
I am willing to send active alarms in robot to the PLC over Profi-bus protocol. ( using R-30ic controller)
Active alarms like Tucker faults or welding faults in robot pendent wanted to show on HMI. Adding to this, tucker device is having more than 750 alarms.
Your help is highly appreciated!
Thank you
-
Thank you
for your valuable reply.
infact i was looking for some command, but i dont find anything. Now i'll go with flags and jump labels.
-
Greetings from the day !
i am continuously monitoring water supply to the weld gun using BGLogic TP program.
But wanted to stop BGLogic in a Tip/Cap change (using automatic cap changer) program. because when i stop water flow for tip/cap change, then program gets paused and fault (user alarm) occurs due to BG TP program.is there any command to start and stop BGLogic perticular program?
-
yes exactly
Agreed with Panic mode
issue is with cable connections from X11
you just need to check with 3-4 and 21-22.
-
Hello Empireryan,
KUKA provides tech-pack for auto backup or else Its possible with ethrnet connection for that you need to make a network connectivity with line-PC. if you have then just follow the below settings.
please go through the following settings
c_KRC_UTIL_NETWORKCONNECTIVITY
NETWORKCONNECTIVITY.ini
Type=1
LokalPfad=
disableNetwork=false
Networkadapter=Intel(R)[UserData1]
Kennwort=operator
Domaine=operator
Benutzer=LinePCSupervisor ()
Pfad=x: \\172.27.45.240 (follow with robot id)Hope this is helpful to your requirements.
-
please check whether you selecting the file or opening it.
you need to "open" the config.dat, and after making changes just submit pressing with "yes".
-
Thanks for the details
Can someone provide me the robot backup with background tip dress program.
Thanks in advance.
-
For KUKA Robot : How do we call Tip Dress (Pedweld Robot) program in background while its doing the other task too (multiple program running).
E.x. Robot is picking the panel and doing tip dress
-
Hello All,
i am in need of Robotic Sealer system power point presentation document for reference.
Thanks in advance
-
Is there any possibility to convert kuka program to kawasaki program??E.g. suppose we are replacing kuka robot to kawasaki robot ....
thanks