Welcome, Guest
Username: Password: Remember me

TOPIC: Compile from source with new classes

Compile from source with new classes 7 years 9 months ago #8330

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 159
  • Thank you received: 5
  • Karma: 1
Hi Claes,

Thanks for your swift reply. The two elements, pointer and value, are well understood. The initial confusion began when first studying the SUM function in rt_plc_arithm.c, as shown:

Summer.png


If the SUM object sets unconnected input pointers to input value addresses, then isn't this conditional redundant because it's always TRUE? The same conditional is found in MAXMIN and CURVE. Because of this code, I was initially led to believe (falsely) that unconnected inputs contained NULL values.

Your example verifies my conclusions and understanding:

if (o->InP != &o->In)
// Connected

Thank You!

/Ron
The administrator has disabled public write access.

Compile from source with new classes 7 years 9 months ago #8331

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

There are 59 diffenent compile methods that all generates slightly different code.
Sum has compile method 28 which set the pointer to NULL if the input is not visible.

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

Compile from source with new classes 7 years 9 months ago #8378

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 159
  • Thank you received: 5
  • Karma: 1
Hi Claes,

A large and complex object graph template has been developed for a custom class GRAPHIC object that contains many objid references and no code. Each GRAPHIC object is configured with various objid references, so an object graph of a specific GRAPHIC object is unique compared to other GRAPHIC objects. A similar example might be an object graph with PID and MODE information plus amps, interlocks, permissives, messages and other relevant information from various objects on a single graph. This technique works very well and really helps standardize and minimize effort required to configure many units with a common structure. Obviously, it is not an original idea because Proview graphics support multiple levels of indirection.

Because of an arbitrary structure of a referenced custom class object, a Ge display challenge has been encountered. In this case, it is necessary to index into a string array for one of the objid objects, as shown below. Is there a method to dynamically index into a string array or is a different object structure required to avoid this Ge requirement?

Indirection.png


/Ron
The administrator has disabled public write access.

Compile from source with new classes 7 years 9 months ago #8380

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

The array index has to be a fix value.

Have you considered building aggregate classes instead? In this way you can standardize not only the graphics but also the code. In you Mode/PID example you can use the CompModePID and CompPID designed for aggregates.

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

Compile from source with new classes 7 years 9 months ago #8382

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 159
  • Thank you received: 5
  • Karma: 1
Hi Claes,

Thanks for suggesting Aggregate classes. An in depth study of your demo provides many good examples on the power of Aggregation. Proview certainly has a large selection available! Learning the features and functionality of all of the available Aggregate objects will take awhile. Awareness of Aggregate classes reveals even more power and flexibility within Proview.

Thanks,
Ron
The administrator has disabled public write access.

Compile from source with new classes 7 years 4 weeks ago #8825

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 159
  • Thank you received: 5
  • Karma: 1
Hi Claes,

A custom class references the atlas library (automatically tuned linear algebra software), found here: math-atlas.sourceforge.net

This C program references the following include files:

#include <stdio.h>
#include <atlas_enum.h>
#include "clapack.h"

void SCREEN_exec(plc_sThread *tp, pwr_sClass_SCREEN *o)

To enable clapack_dgesv, as shown:

info = clapack_dgesv(CblasRowMajor, 3, 1, term, 3, ipiv, d, 3);

This custom class compiles without error, using the following compile options:

~$ gcc -g -c $pwrp_appl/fuzzy.c -o $pwrp_obj/fuzzy.o -I$pwrp_inc -I$pwr_inc -I/usr/include/atlas -llapack_atlas -llapack -lblas -latlas -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 -DOS_POSIX

By copying libraries and include files to your directories, this condensed command works too:

gcc -g -c $pwrp_inc/fuzzy.c -o $pwrp_obj/fuzzy.o -I$pwr_inc -L$pwr_lib -DOS_LINUX=1 -DOS=linux -DHW_X86=1 -DHW=x86 -DOS_POSIX


When building a RootVolume Sim node, a link error occurs:

** Plc program link errors for x86_64_linux node plc_tester_0999_plc
/usr/local/pwrp/cpptest/bld/x86_64_linux/obj/fuzzy.o: In function 'SCREEN_exec':
/usr/local/pwrp/cpptest/bld/common/inc/fuzzy.c:1386: undefined reference to 'clapack_dgesv'
collect2: error: 1d returned 1 exit status


By manually adding library references to plc_tester_0999_plc.opt, the program above links successfully (despite the "Do no edit!" warning).

`: Autogenerated options file, Do not edit !!` $pwrp_obj/fuzzy.o $pwrb_root/os_linux/hw_x86_64/exp/obj/rt_io_user.o -lpwr_rt -lpwr_pnak_dummy -lpwr_cifx_dummy -lpwr_usb_dummy -lpwr_usbio_dummy -lpwr_nodave_dummy -lpwr_epl_dummy -llapack_atlas -latlas -lcblas -llapack -latlas


What script auto-generates this .opt file and how to add new library references?


Regards,
Ron
Last Edit: 7 years 4 weeks ago by AutoMate. Reason: Update: More information
The administrator has disabled public write access.
Time to create page: 7.896 seconds