Author Topic: AdvancedHMI+Raspberry Pi - error  (Read 3301 times)

milos

  • Newbie
  • *
  • Posts: 5
    • View Profile
AdvancedHMI+Raspberry Pi - error
« on: October 23, 2017, 04:19:07 PM »
Hello all,

Im new both in AdvancedHMI and Raspbian. I have a big problem. Cannot run AdvancedHMI on Mono:

pi@raspberrypi:~/bin/Debug $ mono AdvancedHMI.exe

Unhandled Exception:
System.InvalidProgramException: Invalid IL code in System.Windows.Forms.Application:SetCompatibleTextRenderingDefault (bool): method body is empty.

  at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00007] in <6b3a05ddcb9b406895d49466ab68072f>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidProgramException: Invalid IL code in System.Windows.Forms.Application:SetCompatibleTextRenderingDefault (bool): method body is empty.

  at MfgControl.AdvancedHMI.My.MyApplication.Main (System.String[] Args) [0x00007] in <6b3a05ddcb9b406895d49466ab68072f>:0

Raspberry Pi 3B+, Raspbian, updated, installed last Mono. Visual Studio 17.

Any ideas? Please help me.

Milos

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #1 on: October 23, 2017, 10:15:46 PM »
Your best option is to research this topic:

http://advancedhmi.com/forum/index.php?topic=666.0

Some posts might lead to other topics as well (which can only provide additional info).

Try reading all the posts to see what issues other users have experienced and if anyone offered any solution.

Mono environment has limitations and some AHMI controls might not work properly. Because of this you might try starting your application with just 1 control (BasicButton or BasicLabel) and if you don't experience any issues then keep adding other controls one by one.
« Last Edit: October 24, 2017, 10:02:20 AM by Godra »

milos

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #2 on: October 25, 2017, 03:51:20 PM »
Godra,

searching through forums was the first thing I did. Of course, I know this topic you mentioned.
I followed instructions on Mono homepage as well. Unfortunately, it seems to me that AHMI on Raspberry works nicely for everyone except me :-(
As you can see, I cannot even start AHMI.
My application is pretty simple, only two gauges and few labels on one page. I simplified it down to one label, but the problem persists.

There must be something I missed, but what? Or can be the problem in Raspberry (3, B+) itself?

dmroeder

  • Global Moderator
  • Full Member
  • *****
  • Posts: 206
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #3 on: October 25, 2017, 10:36:02 PM »
Hey milos,

Bummer you are having problems with your Pi and AdvancedHMI.  I wonder if you could build a really simple app in Windows, then copy the whole project over to the Pi and run it.   Might not be ideal, but maybe we can rule something out.

Phrog30

  • Guest
Re: AdvancedHMI+Raspberry Pi - error
« Reply #4 on: October 27, 2017, 12:53:54 PM »
If someone was willing to send you a known working application that would be best. Then if it doesn't work you know it's something on your end.

milos

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #5 on: October 27, 2017, 06:09:23 PM »
Hello dmroeder!

My app is simplified down to one label, as I wrote before.

Now, I wrote simple "Hello world" console application, copied it to Raspberry. Works fine.
Next, I wrote simple window application using Windows Form. Runs on Raspberry as well.

I created those apps both in Visual Studio 2015 and 2017. OK.
But if I'm trying run even the simplest AHMI app, always getting the above-mentioned error :-(

milos

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #6 on: October 27, 2017, 06:10:47 PM »
Phrog30: This is great an idea! Please, can somebody do it for me?

dmroeder

  • Global Moderator
  • Full Member
  • *****
  • Posts: 206
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #7 on: October 27, 2017, 08:55:17 PM »
I'll try to get you something tonight.

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #8 on: October 29, 2017, 11:34:13 PM »
Here is the link to zipped Debug folder of the AHMI application that runs fine on Raspberry Pi 2 / Raspbian:

https://www.dropbox.com/s/cznawi75x5ctxmv/Debug.7z?dl=0

This app was used to test the error from this topic:

http://advancedhmi.com/forum/index.php?topic=1916.0

Extract all the files and then copy the newly created Debug folder to your Pi.
Open Terminal, run "sudo su", navigate to this Debug folder and then run "mono AdvancedHMICS.exe".
« Last Edit: November 04, 2017, 03:24:53 PM by Godra »

dmroeder

  • Global Moderator
  • Full Member
  • *****
  • Posts: 206
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #9 on: October 30, 2017, 12:06:25 AM »
Thanks Gorda, I got busy...

milos

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #10 on: October 30, 2017, 08:24:33 AM »
Great!

This application runs on Raspberry properly without errors.
So something wrong is in Visual Studio side.

Thank you, guys!

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #11 on: November 02, 2017, 12:43:55 PM »
If this might help any further, here is the link to the full solution:

https://www.dropbox.com/s/ydx32h7x8sm532i/AdvancedHMI%20v399x%20-%20Error%20Testing.7z?dl=0

Once the solution is open in Visual Studio then rebuild it.
« Last Edit: November 04, 2017, 03:23:36 PM by Godra »

bangoskank

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #12 on: December 19, 2017, 09:48:33 PM »
I'm at severe risk of asking a dumb question I think... I am trying to get AHMI on my Pi3 and have followed the link in the second post and I'm missing something.  The file I downloaded from sourceforge does not have an .exe file.  There is a .sin file and according the quick start directions, that is the file that is used to launch the application in VS.

What am I missing?

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #13 on: December 20, 2017, 03:51:09 PM »
What sin did you commit again?
Archie instruction was to go to Raspberry site, not from sourceforge
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1436
    • View Profile
Re: AdvancedHMI+Raspberry Pi - error
« Reply #14 on: December 20, 2017, 06:14:09 PM »
AHMI is downloaded from sourceforge.

In order to create the AdvancedHMI.exe file, you have to open the whole solution (.sln file) in Visual Studio.
Then double-click the MainForm file and read instructions in the top left corner.

Once you run the project it will create the AdvancedHMI.exe file inside your solution folder (generally AdvancedHMI/bin/Debug folder).