Welcome, Guest
Username: Password: Remember me

TOPIC: Compile from source with new classes

Compile from source with new classes 8 years 9 months ago #8262

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3234
  • Thank you received: 520
  • Karma: 135
Hi Ron,

The compile command should look something like this. You probably have to add some path to the compiler or add the path in $PATH. I have moved the c-file to $pwrp_appl which is the preferred location for source files.

arm-linux-gnueabihf-gcc -g -c $pwrp_appl/myclass.c -o $pwrp_root/bld/arm_linux/obj/myclass.o -I$pwrp_inc -I$pwr_inc -DOS_LINUX=1 -DOS_POSIX=1 -DHW_ARM=1

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

Compile from source with new classes 8 years 9 months ago #8265

  • marc
  • marc's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 711
  • Thank you received: 70
  • Karma: 24
Hi Ron,

If you want to use ArchLinux be aware of lots of issues.
Don't waste your time.
To distribute to Raspbian Operator/Process station from a ArchLinux Development station can create library conflicts.
Give the cross compile answer from Claes a try and look what happens. Don't make it more difficult then it already is.
Maybe the Pi3 is better in performance with Raspbian related to the Rpi2, running as Development station.
I don't know.

My projects/tests on maba.dk are maybe already outdated.
Yes, of course. A x86/64 is the easiest way to handle, if its fits your I/O needs.


/Marc
Please, use the Wiki if you succeeded your project or solved your problem. Share your work, so we can learn from each other.
Last Edit: 8 years 9 months ago by marc.
The administrator has disabled public write access.
The following user(s) said Thank You: AutoMate

Compile from source with new classes 8 years 9 months ago #8266

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
Claes,

Thanks for the cross-compiler info! That's exactly what's needed.


Marc,

Thanks for the Arch Linux heads up. I don't want to waste my time or make life more difficult than necessary.

Ron
Last Edit: 8 years 9 months ago by AutoMate. Reason: Not relevent to Proview forum...
The administrator has disabled public write access.
The following user(s) said Thank You: marc

Compile from source with new classes 8 years 9 months ago #8271

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
Claes,

While building custom classes, I often notice something strange. The attached object code works fine, until the addition of an $Intern enumeration placed between $Inputs and $Outputs. The .c program is compiled, class updated, plc code rebuilt, and loaded to simulator run-time. No compiler errors and no linker errors. However, a simple o->Out = result; command suddenly stores to the wrong variable. Other values are also stored to wrong places. In this case, no pointers are used. Just direct o->variable = value; statements I've examined the wb_load file for corruption errors and the .h include file, too. Don't see anything obvious? When the enumeration is removed, program compiled and loaded, all is well again. Any ideas or suggestions?

Thanks,
Ron

Proview_Weird.png
The administrator has disabled public write access.

Compile from source with new classes 8 years 9 months ago #8272

  • AutoMate
  • AutoMate's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 165
  • Thank you received: 6
  • Karma: 1
A little more information...

In the previous post, it seems obvious the root cause is a malformed $TypeDef. By carefully checking the type definition, my custom object class is now working properly. I'm not sure of the exact cause. In the picture below, should $TypeDef attribute:Elements = 1 or 3? Class Help doesn't really say. My inclination is to set Elements = 3, for three enumerated values? But, Bruno's control Wave Type specifies number of elements as 1. My class object works with Elements = 1. The other cause may have been failure to specify a PgmName for each $Value?

/Ron


Proview_Types.png
The administrator has disabled public write access.

Compile from source with new classes 8 years 9 months ago #8273

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3234
  • Thank you received: 520
  • Karma: 135
Hi Ron,

Elements should always be 1 except for strings. If you set 3 it means an array of Enum with 3 elements, and this seems to be the case in the object body, while the c-struct generator doesn't look at Elements and only allocates 4 bytes.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: AutoMate
Time to create page: 7.735 seconds