AdvancedHMI Software

General Category => Support Questions => Topic started by: milos on October 23, 2017, 04:19:07 PM

Title: AdvancedHMI+Raspberry Pi - error
Post by: milos 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
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: Godra 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.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: milos 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?
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: dmroeder 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.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: Phrog30 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.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: milos 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 :-(
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: milos on October 27, 2017, 06:10:47 PM
Phrog30: This is great an idea! Please, can somebody do it for me?
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: dmroeder on October 27, 2017, 08:55:17 PM
I'll try to get you something tonight.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: Godra 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".
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: dmroeder on October 30, 2017, 12:06:25 AM
Thanks Gorda, I got busy...
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: milos 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!
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: Godra 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.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: bangoskank 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?
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: bachphi 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
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: Godra 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).
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: dmroeder on December 20, 2017, 06:16:24 PM
So when you download AHMI from sourceforge, there won't be a ".exe" for you to run, you must build a program first using Visual Studio.  Once you've built a program using Visual Studio, there will be a .exe of your project in the /bin/debug folder of your project.
Title: Re: AdvancedHMI+Raspberry Pi - error
Post by: bugmenot on June 14, 2021, 07:07:52 AM
yes i am also facing the same error.
i am also sailing in the same boat. as usual new to raspberry pi.
i have done the install of sudo apt-get install mono-complete and mono-vbnc
   TLS:           __thread
   SIGSEGV:       normal
   Notifications: epoll
   Architecture:  armel,vfp+hard
   Disabled:      none
   Misc:          softdebug
   Interpreter:   yes
   LLVM:          yes(610)
   Suspend:       preemptive
   GC:            sgen (concurrent by default)

please help me in solving this issue. i am trying to build one hmi interface for my plc. dont know where to start