Cancel
Showing results for 
Search instead for 
Did you mean: 

robot signals in robot moduls with array

Gears Phenom Gears Phenom
Gears Phenom

 

in most of robot programs runs logic with arrays

 

currently process simulate can not work with arrays

 

$OUT[O_TCH_COVER_OPEN[ST_NR]]=TRUE

 

example from robot program:

GLOBAL DEF TCH_COVER_OPEN(ST_NR :IN)
INT ST_NR,HANDLE

$OUT[O_TCH_COVER_CLOSE[ST_NR]]=FALSE
$OUT[O_TCH_COVER_OPEN[ST_NR]]=TRUE

 

is there a chance???

 

Kind regards,

Benjamin Voelzke
22 REPLIES

Re: robot signals in robot moduls with array

Siemens Phenom Siemens Phenom
Siemens Phenom

ST_NR=1

O_TCH_COVER_CLOSE[ST_NR]=2

$OUT[O_TCH_COVER_CLOSE[ST_NR]]=TRUE

 

should already work.

Re: robot signals in robot moduls with array

Gears Phenom Gears Phenom
Gears Phenom

GLOBAL DEF PKlappeAuf(BHF_NR : IN)      

DECL INT BHF_NR
 
WHILE (BHF_NR<1) OR (BHF_NR>16)
   WAiT SEC 0.1 ; ungueltige Bahnhofsnummer
ENDWHILE

$OUT[ABDECKUNG_CLOSE_DATA[BHF_NR].AB_CL_NR]=FALSE         
$OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]=TRUE

WAIT FOR $IN[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]     
WAIT FOR NOT $IN[ABDECKUNG_CLOSE_DATA[BHF_NR].AB_CL_NR]        
$OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]=FALSE

END    
    

 

sorry this modul is dosen't work with process simulate

ps writes in simulation layer "$OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]" signal not found

Kind regards,

Benjamin Voelzke

Re: robot signals in robot moduls with array

Siemens Phenom Siemens Phenom
Siemens Phenom

This also works:

 

ABDECKUNG_OPEN_DATA[3].AB_OP_NR=1

 

BHF_NR=3

 

$OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]=TRUE

 

You need to have ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR defined somewhere, as a variable assignment (reading record/structure definition is not supported).

Re: robot signals in robot moduls with array

Gears Phenom Gears Phenom
Gears Phenom

hello,

 

i have checked the functionality in cee mode

these are the results of the log window

the marked lines show that the function is not executed correctly

 

 

kr360_3[RRS]> Hinweis an home1: [DBG] PKlappeAuf (2)
kr360_3[RRS]> Hinweis an home1: [DBG] Simulate PKlappeAuf (2)
kr360_3[RRS]> Hinweis an home1: [DBG] Simulations Roboter Modul Prozedur PKlappeAuf
kr360_3[RRS]> Hinweis an home1: [DBG] # NotifyCallFunctionExecutionStarted PKlappeAuf
kr360_3[RRS]> Hinweis an home1: [DBG] DECL INT BHF_NR
kr360_3[RRS]> Hinweis an home1: [DBG] $OUT[ABDECKUNG_CLOSE_DATA[BHF_NR].AB_CL_NR]=FALSE
kr360_3[RRS]> Hinweis an home1: [DBG] Evaluate signal ABDECKUNG_CLOSE_DATA[2].AB_CL_NR: 0
kr360_3[RRS]> Hinweis an home1: [DBG] Simulate $OUT[ABDECKUNG_CLOSE_DATA[BHF_NR].AB_CL_NR]=FALSE
kr360_3[RRS]> Hinweis an home1: [DBG] # waittime 2
kr360_3[RRS]> Hinweis an home1: [DBG] Wartezeit: 2 s
kr360_3[RRS]> Hinweis an home1: [DBG] NotifySimulationEvent WaitTime : ON (6,87600000239908ms)
kr360_3[RRS]> Hinweis an home1: [DBG] OnTimeReached : 8,87600000239908
kr360_3[RRS]> Hinweis an home1: [DBG] NotifySimulationEvent WaitTime : OFF (8,87600000239908ms)
kr360_3[RRS]> Hinweis an home1: [DBG] $OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]=TRUE
kr360_3[RRS]> Hinweis an home1: [DBG] Evaluate signal ABDECKUNG_OPEN_DATA[2].AB_OP_NR: 0
kr360_3[RRS]> Hinweis an home1: [DBG] Simulate $OUT[ABDECKUNG_OPEN_DATA[BHF_NR].AB_OP_NR]=TRUE
kr360_3[RRS]> Hinweis an home1: [DBG] # waittime 2
kr360_3[RRS]> Hinweis an home1: [DBG] Wartezeit: 2 s

 

 

Kind regards,

Benjamin Voelzke

Re: robot signals in robot moduls with array

Siemens Phenom Siemens Phenom
Siemens Phenom

>> Evaluate signal ABDECKUNG_CLOSE_DATA[2].AB_CL_NR: 0

 

This means you are missing the definition, somewhere before:

ABDECKUNG_CLOSE_DATA[2].AB_CL_NR = <value>

 

As I wrote earlier, you need this assignment to be defined somewhere to have it work. ABDECKUNG_CLOSE_DATA is an array of structures (with fields such as AB_CL_NR). Arrays of structured data are not supported, but you can cheat the system by instead defining the full variable "ABDECKUNG_CLOSE_DATA[2].AB_CL_NR", as it was just a variable name with some special characters (such as [, ] and .) inside.

 

I hope this helps.

Re: robot signals in robot moduls with array

Gears Phenom Gears Phenom
Gears Phenom

sorry i don't understand what you mean.

i have created the signal on robot signals (see picture)

in path editor i call the function (with transfer parameters)

the signals are always connected to logic resource

 

bild1.jpg

 

 

 

bild2.jpg

 

 

bild3.jpg

Kind regards,

Benjamin Voelzke

Re: robot signals in robot moduls with array

Siemens Phenom Siemens Phenom
Siemens Phenom

ABDECKUNG_CLOSE_DATA[2].AB_CL_NR is not a signal name but a signal index.

 

My idea was that you would:

  1) define" $IN[3]" as robot signal

  2) have somewhere instruction "ABDECKUNG_CLOSE_DATA[2].AB_CL_NR = 3" (just an example) before reaching the attempt to send/wait for $IN[ABDECKUNG_CLOSE_DATA[2].AB_CL_NR] signal

This would be aligned with what the actual Kuka controller is doing.

 

Another option could be to define "$IN[ABDECKUNG_CLOSE_DATA[2].AB_CL_NR]" as robot signal. I am not sure it will work but it might worth trying.

Re: robot signals in robot moduls with array

Gears Phenom Gears Phenom
Gears Phenom

the first idea is dosn't work

i have written an instruction "ABDECKUNG_CLOSE_DATA[2].AB_CL_NR = 3" somewhere in robot path

the signal "ABDECKUNG_CLOSE_DATA[2].AB_CL_NR" is always "true" (see at simulation panel)

 

 

second idea is also dosn't work

 

i have created "$OUT[ABDECKUNG_CLOSE_DATA[2].AB_CL_NR]" as robot signal

ps dosn't find the signal

 

Smiley Sad

 

 

Kind regards,

Benjamin Voelzke

Re: robot signals in robot moduls with array

Siemens Phenom Siemens Phenom
Siemens Phenom

In the first idea (which I tested successfully), the signal that should be defined on the robot on Process Simulate is "$IN[3]" or '$OUT[3]", not ABDECKUNG_CLOSE_DATA[2].AB_CL_NR (which is an index - a variable - and not a signal).

 

I will check the second idea.