Author Topic: Omron Ethernet(Fins) and Raspberry pi 3 Problem  (Read 3252 times)

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Omron Ethernet(Fins) and Raspberry pi 3 Problem
« 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.


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #1 on: December 27, 2016, 06:34:17 AM »
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.

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #2 on: December 27, 2016, 06:50:45 AM »
Yea, blank form works great, checkbox, formchange buttton too. It looks like when i add analog value display, get an error.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #3 on: December 27, 2016, 07:05:56 AM »
What about a BasicLabel? The AnalogValueDisplay is a minor variation of the BasicLabel.

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #4 on: December 27, 2016, 07:09:20 AM »
Ok, i check what makes my error. When add KeyboardInput to write to register.
 

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5266
    • View Profile
    • AdvancedHMI
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #5 on: December 27, 2016, 07:12:52 AM »
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.

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #6 on: December 27, 2016, 07:36:49 AM »
Nice, ill use basic label with input which works like a charm.
Thank you again.

Have a nice day

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #7 on: February 07, 2017, 01:53:57 AM »
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

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #8 on: February 07, 2017, 01:24:37 PM »
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.

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #9 on: February 09, 2017, 02:02:20 AM »
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.

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #10 on: February 09, 2017, 11:43:56 AM »
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:

Code: [Select]
    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.
« Last Edit: February 09, 2017, 11:47:10 AM by Godra »

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #11 on: February 10, 2017, 05:37:07 PM »
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()? )

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #12 on: February 10, 2017, 08:45:52 PM »
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.
« Last Edit: February 12, 2017, 10:50:10 AM by Godra »

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #13 on: February 20, 2017, 07:43:50 AM »
I am trying to use just one DataSubscriber2 for my alarm massages, but doesnt work as it should
Code: [Select]
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


   

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Omron Ethernet(Fins) and Raspberry pi 3 Problem
« Reply #14 on: February 21, 2017, 12:57:12 PM »
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.