Roboterprofis für Ihren Erfolg
Roboterprogrammierer auf Stundenbasis engagieren
jetzt Preise und verfügbare Roboterprogrammierer anfragen

Autor Thema:  Can I create PERS data structures using RECORD and ENDRECORD?  (Gelesen 1104 mal)

0 Mitglieder und 1 Gast betrachten dieses Thema.

Offline Joan

  • Forum Mitglied LV 9
  • *
  • Beiträge: 86
  • Bewertet: 0
Hello all,

In my last question I asked about how to make data structures.

It seems that something called RECORD and ENDRECORD makes the trick:

RECORD aaa
  bool b1;
  bool b2;
ENDRECORD

VAR aaa struct1;


The only thing that I need to make it perfect is to be able to share data between 4 robots, nowadays I'm using independent variables (variables that are not inside any structure) in order to do that :

PERS bool a := TRUE; ! FOR EXAMPLE...

I suppose that tha logical way to share structures would be:

RECORD aaa
  bool b1;
  bool b2;
ENDRECORD

PERS aaa struct1;


but this is not working.

Any idea on how should I make it work?

As always thank you in advance for your time and help.
  • finde ich gut    Danke, das hat mir geholfen    brauche Hilfe    da stimmt was nicht    Lesenswert


ABB Robotertraining
günstig und verständlich mit Zertifikat
ABB Roboterschulung

Offline gucky35

  • Stammgast LV 2
  • *
  • Beiträge: 14
  • Bewertet: 0
Hello Joan

See in my example there is a PERS variable. Do you want to use a PERS RECORD you must have value in the declaration. It’s the same for all PERS variable. Because the PERS variable save the value and you can see the current value after a Backup(or save programmodule) in the declaration of the variable.

Best regards
  • finde ich gut    Danke, das hat mir geholfen    brauche Hilfe    da stimmt was nicht    Lesenswert

Offline Joan

  • Forum Mitglied LV 9
  • *
  • Beiträge: 86
  • Bewertet: 0
OK, I've got what was happening:

I cannot have special types inside a PERS structure (e.g. clock) and moreover I must take care on where I'm placing my comments...

Here you can see why it was not working properly:

RECORD aaa ! this is a comment that makes it not to work...
  bool b1;
  num n1;
  clock c1;
ENDRECORD

PERS aaa struct1;
VAR aaa struct2;

If I try to use struct 1 it won't work for two reasons: the comment by aaa and the clock variable inside.

In any case struct2 will not work, but in this case clock is perfectly legal, you must remove only the comment.


THANK YOU VERY MUCH FOR YOUR COMMENTS/ANSWERS...
  • finde ich gut    Danke, das hat mir geholfen    brauche Hilfe    da stimmt was nicht    Lesenswert

Offline gucky35

  • Stammgast LV 2
  • *
  • Beiträge: 14
  • Bewertet: 0
Hello Joan

I think your problem is the clock variable, because clock variables are don’t use with type PERS.

That doesn’t work:
PERS clock clMyClock;

Only that:
VAR clock clMyClock;

It is the same in RECORD variable.

My own idea is to make a NUM variable for your clock. ( for example aaa.c1:=ClkRead(clMyClock); )
Then you have the second in your variable, but you have only the current value in your variable and no “running” clock.



The comment problem:
I have test in my controller and I have the same problem to make a comment after RECORD :bawling:, but you can make the comment after the ENDRECORD :D

RECORD aaa
  bool b1;
  num n1;
  num c1;
ENDRECORD ! that comment work...

Best regards
  • finde ich gut    Danke, das hat mir geholfen    brauche Hilfe    da stimmt was nicht    Lesenswert


xx
Can I create new data structures in RAPID?

Begonnen von Joan

2 Antworten
1307 Aufrufe
Letzter Beitrag 14. August 2007, 07:16:11
von Joan
xx
PERS structures problem during initialization?

Begonnen von Joan

2 Antworten
1176 Aufrufe
Letzter Beitrag 16. August 2008, 19:08:27
von Joan
xx
VAR ; PERS ; CONST :(

Begonnen von Sven2009

5 Antworten
2287 Aufrufe
Letzter Beitrag 04. Juni 2008, 18:15:09
von Sven2009
xx
Record und dynamischer Aufruf

Begonnen von Robiman

6 Antworten
1099 Aufrufe
Letzter Beitrag 08. März 2014, 10:00:22
von Robiman
question
Ein Datenfeld im Record erzeugen

Begonnen von Paulaner

4 Antworten
1583 Aufrufe
Letzter Beitrag 18. Mai 2009, 20:14:30
von Paulaner
 

über das Roboterforum

Nutzungsbedingungen Impressum
Sitemap