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

TOPIC: Fo

Fo 5 years 4 months ago #10001

  • seec
  • seec's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Karma: 0
hi there

Question?
Is it possible to create en plc function object(PlcHR92Fo1) and integrate a c-code object(PlcHR92Fo)
in the plc function object.

example:


info.jpg


and how to connect:
PlcConnect
PlcNode


Cees
The administrator has disabled public write access.

Fo 5 years 4 months ago #10003

  • benoit
  • benoit's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 180
  • Thank you received: 1
  • Karma: 0
Hi Cees,
Yes I suppose it's possible.
See Documentation, Designer's guide.... class editor.
/Ben
The administrator has disabled public write access.

Fo 5 years 4 months ago #10046

  • seec
  • seec's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Hi Ben

I have try some connection but it won work

I Have a C-Code Function Object(Fo) PlcHr92Fo. It's a working object if u use it in
a normal program.

I have create a new Fo PlcHR92xFo This is a Plc-coded Fo.


PlcHr92Fo.jpg




In this Fo i used PlcHr92Fo but i can't connect PlcConnect.




PlcHr92xFo.jpg



How can a create a connection to PlcConnect?



cees
Last Edit: 5 years 4 months ago by seec.
The administrator has disabled public write access.

Fo 5 years 4 months ago #10068

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

There is no user friendly way to do this. You have to insert it manually in the object editor. PlcConnect should be of the form $PlcMain:'classname'.'attribute'. The easiest way is to copy from a GetDp or GetDv and replace the 'attribute' part.

/Claes
The administrator has disabled public write access.

Fo 5 years 4 months ago #10073

  • seec
  • seec's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Hi cleas

I've connected PlcConnect :

$PlcMain:CVolEvoProj-Class-BaseHR92.PlcConnect

Now next error i get:



In the source c-code i have a working init code (check the connections):


/*_*
@Aref PlcHR92Fo_init PlcHR92Fo_init
*/
void PlcHR92Fo_init(pwr_sClass_PlcHR92Fo *o) {
pwr_tDlid dlid;
pwr_tStatus sts;
sts = gdh_DLRefObjectInfoAttrref(&o->PlcCo
can you give met solutionnnect, (void **) &o->PlcConnectP, &dlid);
if (EVEN(sts)) {//error
o->PlcConnectP = 0;
printf("PlcConnectP not connected 1 PlcHR92Fo %d\n", sts);
} else {
pwr_sClass_BaseHR92 *co = (pwr_sClass_BaseHR92 *) o->PlcConnectP;
if (!co) {//error
printf("PlcConnectP not connected 2 PlcHR92Fo \n");
} else {
pwr_tAName AttrName;
sts = gdh_AttrrefToName(&co->IoConnect, AttrName, sizeof (AttrName), cdh_mName_pathStrict);
if (EVEN(sts)) {//error

printf("IoConnect not connected 3 PlcHR92Fo %d\n", sts);
}
}
gdh_DLUnrefObjectInfo(dlid);
}
}


When I start the system i get the message "IoConnect not connected 3 P.......

For some reason the IO connection is not working..


Can you give met solution.....


cees
The administrator has disabled public write access.

Fo 5 years 4 months ago #10074

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

Your BaseHR92 is an attribute in a larger object, isn't it? Let's say the larger class is named BaseX and it contains an attribute of type BaseHR92 named HR92. Then PlcConnect for BaseHR92Fo should be

$PlcMain:CVolEvoProj-Class-BaseX.HR92

As the BaseHR92Fo appears in the BaseXFo code, $PlcMain here points at the BaseX object, and you should point out the BaseHR92 attribute in this object.

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