Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Error $Buffer class (in class editor)

Error $Buffer class (in class editor) 15 years 10 months ago #246

  • gallim
  • gallim's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Karma: 0
Hi,
when enter PlcNode-$Buffer class under DevBody-$ObjBodyDef and save, error \"$buffer unknown type \" appears.
Why?

/Maurizio
The administrator has disabled public write access.

Re:Error $Buffer class (in class editor) 15 years 10 months ago #248

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi,

You have to specify the Buffer class which should be pwr:Class-$PlcNode (in the Class attribute of the $Buffer object).

I would strongly advise you to use the configure methods in the popup menu for the $ClassDef object to create functions object classes. These methods make some setting that are undocumented and it's not so easy to get a working function object class without them.

/Claes
The administrator has disabled public write access.

Re:Error $Buffer class (in class editor) 15 years 10 months ago #249

  • gallim
  • gallim's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Karma: 0
Hi Claes,
ok, i configured my class with popup menu, $buffer type is ok;
when use the class in my project, add the new object function in plc editor and when build the program in terminal window the following c-compiler errors appear:

In file included from /usr/local/pwrp/maurizio2/common/tmp/plc_m000_001_001_002_0000001b.gc:22:
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc: In function 'M000_001_001_002_0000001b_exec':
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:2: error: 'plc_t_rtdbref' has no member named 'In1'
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:2: error: 'plc_t_rtdbref' has no member named 'In1P'
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:3: error: 'plc_t_rtdbref' has no member named 'In2'
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:3: error: 'plc_t_rtdbref' has no member named 'In2P'
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:5: error: 'plc_t_rtdbref' has no member named 'Out'
/usr/local/pwrp/maurizio2/common/tmp/plc_cod000_001_001_002_0000001b.gc:5: error: incompatible types in assignment
** Plc window compiled with errors for x86_linux Maurizio2_Plant-Processi-prg1-W
%GSX-F-CCERROR, Error from c compilator, see terminal window

I'm trying to build a function with c-code.

Good afternoon.

/Maurizio
The administrator has disabled public write access.

Re:Error $Buffer class (in class editor) 15 years 10 months ago #250

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi,

When you build the class volume an include file for the volume is generated on $pwrp_load, pwr_xxxclasses.h. This should be included in the file $pwrp_inc/ra_plc_user.h:

#include \"pwr_xxxclasses.h\"

where xxx is the name of your classvolume in lower case.

/Claes
The administrator has disabled public write access.

Re:Error $Buffer class (in class editor) 15 years 10 months ago #252

  • gallim
  • gallim's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 29
  • Karma: 0
Hi,
when add lines in ra_plc_user.h the problem was solved.
I tried to build a function with C-code.
I have difficulties to produce the file myCfunc.o: what should include headers files in the file source mycfunc.c and what command should i use ?( \"gcc mycfunc.c\" is sufficient?)

Thanks.

/Maurizio
The administrator has disabled public write access.

Re:Error $Buffer class (in class editor) 15 years 10 months ago #253

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi,

I think it should be something link this.

Includes:

#include \"pwr.h\"
#include \"pwr_'yourclassvolume'classes.h\"

Compile:

gcc -c mycfunc.c -o $pwrp_obj/mycfunc.o -I$pwr_inc -I$pwrp_inc -DOS_LINUX
(-I = uppercase i)

You also need an .opt file on $pwrp_exe when building the node with

$pwr_obj/rt_io_user.o -lpwr_rt -lpwr_usbio_dummy $pwrp_obj/mycfunc.o
(-l here is lowercase L)

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.326 seconds