Welcome, Guest
Username: Password: Remember me

TOPIC: cross compile "file not recognized"

cross compile "file not recognized" 2 years 2 months ago #11322

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

this is the file




File Attachment:

File Name: rt_io_m_evo_objects.c
File Size: 58 KB
The administrator has disabled public write access.

cross compile "file not recognized" 2 years 2 months ago #11325

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

It works now...

from 5.6 the Sv objects are changed...
the ActualValue is now a pointer...
that was the reason of failing.

This par of the code is changes:
old code:

copy2StrEndCheck(refName, sizeof refName, AttrName, ".DeviceName");
sts = gdh_NameToAttrref(pwr_cNOid, refName, &aref);
if (ODD(sts)) {
sts = gdh_GetObjectInfoAttrref(&aref, objectString, sizeof (objectString));
if (ODD(sts)) {
copyStrEndCheck((char*)(co->DeviceName.ActualValue), sizeof (pwr_tString80), objectString);
}
}


new code:

copy2StrEndCheck(refName, sizeof refName, AttrName, ".DeviceName");
//Nodes-EvoPro-IO-A-R_IO_H-Touch_1.DeviceName
sts = gdh_NameToAttrref(pwr_cNOid, refName, &aref);
if (ODD(sts)) {
sts = gdh_GetObjectInfoAttrref(&aref, objectString, sizeof (objectString));
if (ODD(sts)) {
ActualValueString_P = (pwr_tString32*) gdh_TranslateRtdbPointer((unsigned long) co->DeviceName.ActualValue);//new
// ActualValueString_P to Evo-H-Var-IO-Touch_1.DeviceName.ActualValue
copyStrEndCheck((char*)ActualValueString_P, sizeof (pwr_tString32), objectString);//new
printf("TEST strings:\n AttrName= %s\n refName= %s\n objectString= %s\n",AttrName,refName,objectString);//new
}
}

Thanks for the tips

cees
The administrator has disabled public write access.

cross compile "file not recognized" 2 years 2 months ago #11326

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Cees,

Just some hints if you want to improve the performance and simplify the code.

Don't make any gdh calls in the exec function. Initialize pointers to objects and attributes with gdh_DLRefObjectInfo and gdh_TranslateRtdbPointer in the init function instead, add new attributes in the object to store these pointers (like PlcConnectP), and use these pointers in the exec function.

Avoid to declare attributes as Dv, Av, Iv or Sv. Declare them as Boolean, Float32, Int32 and String80 instead. Then you can access them directly from the object pointer and don't need to call gdh_TranslateRtdbPointer.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: seec

cross compile "file not recognized" 2 years 2 months ago #11330

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


Thanks for the tips. I change the code to your advice later on.

Now without these changes,

my project is running now under 5.9 in raspberry pi

Next is it still possible to view project in android.?

At this moment he project don't start in android.

(Previous version 5.5 views in android)

cees
The administrator has disabled public write access.

cross compile "file not recognized" 2 years 2 months ago #11331

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3170
  • Thank you received: 497
  • Karma: 133
Hi Cees,

The android app is replaced by the new web interface that can be viewed in most web browsers. Read about it in Designer's Guide chapter Web operator environment.

/Claes
The administrator has disabled public write access.
Time to create page: 7.762 seconds