AdvancedHMI Software
General Category => Support Questions => Topic started by: betilly on December 27, 2016, 03:57:50 AM
-
Hi,
I working on Omron plc and latest version AHMI. On my laptop when i start the application i made, things work perfect, write/read bits, registers etc. But when i run my AdvancedHMI.exe file on my raspberry pi3 (latest raspbian-Jessie i think) with mono i get an error and application just close itself. Soo i came here to ask someone who knows more about mono or can help me with my problem. I added screenshoot from terminal window.
Thanks for help,
and Big thanks to Archie for AHMI software.
-
Since it looks like it crashes on drawing a TextBox, I would create a complete blank VB WinForms project and see if that will run.
-
Yea, blank form works great, checkbox, formchange buttton too. It looks like when i add analog value display, get an error.
-
What about a BasicLabel? The AnalogValueDisplay is a minor variation of the BasicLabel.
-
Ok, i check what makes my error. When add KeyboardInput to write to register.
-
I won't have a way to test this until next week. You can also use the BasicLabel and the PLCAddressKeypad property to enter values.
The KeyboardInput was originally designed for use with HID devices such as barcode scanners.
-
Nice, ill use basic label with input which works like a charm.
Thank you again.
Have a nice day
-
Hi, me again. A few days ago i try to use MesssageDisplayByValue on my AHMI project, and again when run app on windows, its all ok, but when i try to open app on RPi i get an error. Is any other possibility to show alarm message by value?
Thank you
-
Mono implementation has lots of limitations.
Bunch of AHMI controls might have issues displaying or working properly (you would pretty much need to try it to find out).
For example, BasicLabel, when clicked, might have issues with AlphaKeyboard popup but not necessarily with Keypad popup.
Still it is probably the best choice amongst AHMI controls for Mono environment.
You can always write some code to handle value changes and display messages on the BasicLabel.
-
First i think that error was because i have old mono. Soo i install the latest mono, and it didnt work too. But when i try with MessageDisplayByBit it works. This two controls must be composite similar or i am wrong? In the last attempt i used MessagelistByValue, works fine, but cannot change MaxmessagesInList in properties in my case to one. I didnt find in code where that parameter is defined.
And i dont have any knowledge of VB programming. I search for examples of VB programing for plcs and didnt find much. Soo any link will be helpfull.
-
AS suggested, Mono is an environment with limitations. If the latest Mono edition doesn't resolve issues for you then you have to look for workarounds:
- Test AHMI controls in Mono to find out which works properly
- Redesign your solution to use only those controls that work in Mono
- For possible workaround code, here is what Archie generally suggests:
- Add a Datasubscriber to the form (or use DataSubscriber2 instead)
- Set PLCAddressValue to desired address
- In your case you might place a standard Winforms Label on the form (to show messages)
- Double click the DataSubscriber to get back to the code
- Enter code similar to this:
Private Sub DataSubscriber1_DataChanged_1(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
'* Make sure Data came back
If e.Values IsNot Nothing AndAlso e.Values.Count > 0 Then
If e.Values(0) = "1" Then
Label1.Text = "Message1"
ElseIf e.Values(0) = "2" Then
Label1.Text = "Message2"
End If
End If
End Sub
I am not sure if DataSubscriber control works properly in Mono, so test that as well.
-
Thanks for code example. I tried Datasubscriber and it works like it must, i got message which i want.
One Datasubscriber in form is just for one PLCAddress? If i want add another PLCAddress for message i need to add additional Datasubscriber? What about Datasubscriber2, i saw that has property for Collection (to add more PLCAddresses).
Now i am trying to understand the code, if i understand right "e.values(0)" is linked to my PLCAddress with communication driver, but what means
" If e.Values IsNot Nothing AndAlso e.Values.Count > 0 Then " ?
What about if i use Datasubscriber2 with two PLCAddresses in Collection i need to change code to e.values(1) for second PLCAddress (this works that way, like array()? )
-
If all else fails then repeat steps to add additional Datasubscriber components.
The line: " If e.Values IsNot Nothing AndAlso e.Values.Count > 0 Then " is making sure that data came back so it can be processed (just in case if the DataChanged event was raised incorrectly).
For usage on the DataSubscriber2, check this topic:
http://advancedhmi.com/forum/index.php?PHPSESSID=1bd1e615af61665d8e80ffbff4a09e8d&topic=1119.0
If you search for "DataSubscriber2" in the forum then you will see bunch of topics discussing different things which you should only learn from.
You would generally use e.Values(0) for each address pretty much the same as the above mentioned topic shows. If you are subscribing to more than 1 element that's when you would use e.Values(1), e.Values(2)...etc.
Make sure to test the DataSubscriber2 component in Mono environment.
-
I am trying to use just one DataSubscriber2 for my alarm massages, but doesnt work as it should
Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
If e.PlcAddress = "D15006" & e.Values(0) = "1" Then
Label1.Text = "Alarm 1"
ElseIf e.PlcAddress = "D15006" & e.Values(0) = "2" Then
Label1.Text = "Alarm 2"
End If
End Sub
-
I would suggest that you stick with what works in Mono and wait until the Mono developers improve its implementation.
There would have to be a separate edition of AHMI with controls redesigned for Mono and I don't think that will be happening any time soon.