Roboterforum Willkommen Gast. Bitte einloggen oder registrieren.
Haben Sie Ihre Aktivierungs E-Mail übersehen?
08. Februar 2012, 23:10:47
Übersicht Hilfe Suche Kalender Einloggen Registrieren
News: >> Roboterprogrammierer gesucht !? <<

Roboterforum für Industrieroboter Anwender  |  Industrieroboter Helpcenter  |  KUKA Roboter (Moderatoren: Werner Hampel, stefanM, IrrerPolterer)  |  Thema: KFD scripting : ONTOUCHUP not working? 0 Mitglieder und 1 Gast betrachten dieses Thema. « vorheriges nächstes »
Seiten: [1] Nach unten Drucken
Autor Thema: KFD scripting : ONTOUCHUP not working?  (Gelesen 415 mal)
Joan
Member
***
Offline Offline

Beiträge: 85


« am: 04. März 2010, 19:46:42 »

Hello all,

In the KFD file I have one inlineform that must react to the ONTOUCHUP and ONOPEN event.

Now I've made a script:

DEFSCRIPT GetPosAct
                ShowVar (FULLPATH[] “$POS_ACT.X”, PARAM rX)
                ShowVar (FULLPATH[] “$POS_ACT.Y”, PARAM rY)
                ShowVar (FULLPATH[] “$POS_ACT.Z”, PARAM rZ)
                ShowVar (FULLPATH[] “$POS_ACT.A”, PARAM rA)
                ShowVar (FULLPATH[] “$POS_ACT.B”, PARAM rB)
                ShowVar (FULLPATH[] “$POS_ACT.C”, PARAM rC)
                Message “HELLO?”
ENDSCRIPT

And each time I press the TOUCHUP button on the KRC it appears on the screen the message HELLO, but no changes are made.

When I create the inlineform it works properly and BOTH of the events use the same script.

Any idea of why it is not working if I use the ONTOUCHUP event?

Thank you in advance!
Gespeichert
Bewareofthis
Stammgast
**
Offline Offline

Beiträge: 33


« Antworten #1 am: 08. März 2010, 16:26:17 »

Hello,

this works fine for my application:
Code:
DEFSCRIPT scrTeachenPos_INDEX1
SHOWVAR(FULLPATH[] "$Pos_Act.X", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ].X", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.Y", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .Y", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.Z", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .Z", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.A", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .A", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.B", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .B", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.C", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .C", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.S", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .S", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act.T", PARAM parAktPos)
SETVAR(Fullpath[] " %parVar [%parIndVar1 ] .T", Value[] " %parAktPos ")
SHOWVAR(FULLPATH[] "$Pos_Act", PARAM parAktPos)
MESSAGE "Punkt '%parPosName ' erfolgreich geteacht!"
MESSAGE "Position '%parVar [%parIndVar1 ] '  = %parAktPos "
DO ACCEPTINLINEFORM
ENDSCRIPT

Maybe try "Do AcceptInlineForm"

HTH

Tobi
Gespeichert
Joan
Member
***
Offline Offline

Beiträge: 85


« Antworten #2 am: 08. März 2010, 16:43:07 »

First of all thank you for answering...

The only difference that I can see here is: SETVAR(Fullpath[] " %parVar [%parIndVar1 ].X", Value[] " %parAktPos ")

And I don't understand it properly:

How do you have declared the variable parVar, parIndVar and parActpos?

Thank you in advance...
Gespeichert
Bewareofthis
Stammgast
**
Offline Offline

Beiträge: 33


« Antworten #3 am: 08. März 2010, 17:14:22 »

Here you go!

Code:
DECL PARAM parAktPos = {VALUE {FREE: DEFAULT[] ""}}
DECL PARAM parVar = {SHORTNAME[] "Var:" , SHORTCUT[] "Var" ,VALUE {NAME: DEFAULT[] "POS_Variable" }}
DECL PARAM parIndVar1 = {SHORTNAME[] "Index 1:" , SHORTCUT[] "Ind1" ,VALUE {NAME: DEFAULT[] "INDEX_Variable1" }}

parIndVar1 is for arrays of "POS" only!  For example   POS  posArray[10]

HTH
Gespeichert
Joan
Member
***
Offline Offline

Beiträge: 85


« Antworten #4 am: 08. März 2010, 17:38:59 »

Very Happy

THANK YOU VERY MUCH!!!! the problem I was having here was the type of the variable I was using...

I was using a set of 6 variables to hold the E6POS fields... I had to use the FREE variable type to make it work...

Well, now it works as I expected, I can't see the contents of the inlineform unless I go there and modify it, but it will work wonders for me.

Well.  Now it works perfect.   Again, thank you!

I've used only:

DEFSCRIPT OnTouchUp
  SHOWVAR(FULLPATH[] "$POS_ACT", PARAM parAktPos)
  DO ACCEPTINLINEFORM
ENDSCRIPT


Thank you!
Gespeichert
Bewareofthis
Stammgast
**
Offline Offline

Beiträge: 33


« Antworten #5 am: 08. März 2010, 17:49:56 »

You're welcome!

Gespeichert
Joan
Member
***
Offline Offline

Beiträge: 85


« Antworten #6 am: 08. März 2010, 20:40:54 »

Hello again...

Using this approach is giving me a new problem:

Now the TouchUp works perfect and this is great, but after that, I need to place inside the fold of the inlineform a new content: something like:
PosAct.X = %parAktPos.X
PosAct.Y = %parAktPos.Y
...
PosAct.T = %parAktPos.T
LIN PosAct

Doing that what I'm searching is to have an overwritten PosAct variable each time the fold is read.

The problem that I've found here is that I can't use this syntax: %parAktPos.X
in the fold...

I've also tried to use something like: PosAct = %parAktPos also without luck...

The way the fold is declared inside the KFD is:

decl fold d_PosS1[9]
d_PosS1[1]="PosAct.X = %parAktPos.X"
d_PosS1[2]="PosAct.Y = %parAktPos.Y"
d_PosS1[3]="PosAct.Z = %parAktPos.Z"
d_PosS1[4]="PosAct.A = %parAktPos.A"
d_PosS1[5]="PosAct.B = %parAktPos.B"
d_PosS1[6]="PosAct.C = %parAktPos.C"
d_PosS1[7]="PosAct.S = %parAktPos.S"
d_PosS1[8]="PosAct.T = %parAktPos.T"
d_PosS1[9] = "LIN PosAct"


Any idea on why it is failing? and regarding your approach... why you were using the array of POS variables?

Thank you again...
Gespeichert
Joan
Member
***
Offline Offline

Beiträge: 85


« Antworten #7 am: 08. März 2010, 20:53:44 »

In order to clarify my question:

What I need is to put the $POS_ACT inside a variable.
But I need to do it inside the fold.

The objective here is to have only one variable that would receive the E6POS and that that variable would become overwritten each time the fold was read.

So something like:

PosAct = %parAktPos

would be the desired thing... but inside the fold the PosAct variable should be overwritten by the contents of the parameter parAktPos.

Thank you again...
Gespeichert
Bewareofthis
Stammgast
**
Offline Offline

Beiträge: 33


« Antworten #8 am: 09. März 2010, 07:33:20 »

Hello Joan,

Code:
decl fold d_PosS1[9]
d_PosS1[1]="PosAct.X = %parAktPos.X"
d_PosS1[2]="PosAct.Y = %parAktPos.Y"
d_PosS1[3]="PosAct.Z = %parAktPos.Z"
d_PosS1[4]="PosAct.A = %parAktPos.A"
d_PosS1[5]="PosAct.B = %parAktPos.B"
d_PosS1[6]="PosAct.C = %parAktPos.C"
d_PosS1[7]="PosAct.S = %parAktPos.S"
d_PosS1[8]="PosAct.T = %parAktPos.T"
d_PosS1[9] = "LIN PosAct"
is your Fold really like this? Be aware that you have to have a space after your parameter!
Like this
Code:
decl fold d_PosS1[9]
d_PosS1[1]="PosAct.X = %parAktPos.X "
d_PosS1[2]="PosAct.Y = %parAktPos.Y "
d_PosS1[3]="PosAct.Z = %parAktPos.Z "
d_PosS1[4]="PosAct.A = %parAktPos.A "
d_PosS1[5]="PosAct.B = %parAktPos.B "
d_PosS1[6]="PosAct.C = %parAktPos.C "
d_PosS1[7]="PosAct.S = %parAktPos.S "
d_PosS1[8]="PosAct.T = %parAktPos.T "
d_PosS1[9] = "LIN PosAct"

HTH
Gespeichert
Seiten: [1] Nach oben Drucken 
Roboterforum für Industrieroboter Anwender  |  Industrieroboter Helpcenter  |  KUKA Roboter (Moderatoren: Werner Hampel, stefanM, IrrerPolterer)  |  Thema: KFD scripting : ONTOUCHUP not working? « vorheriges nächstes »
Gehe zu:  


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2006, Simple Machines Prüfe XHTML 1.0 Prüfe CSS