Author Topic: Advance HMI and Android HMI  (Read 3403 times)

rob1970

  • Newbie
  • *
  • Posts: 18
    • View Profile
Advance HMI and Android HMI
« on: April 13, 2018, 10:11:06 PM »
Is it possible to get AdvanvceHMI to share some Modbus registers to an Android HMI? The Android HMIs that I have tried are looking for a server and doesn't connect with the modbusTCP. I'm fairly new to this so it's very possible that I did it wrong. Wanting to interface with the Android via modbusTCP and read/write values on Modbus RTU RS485 bus that my AdvHMI is using. I may have to get additional hardware to get it to work. Has anyone done this? I normally VNC into my HMI but my wife had a stroke and I need to have a simple interface for her to adjust the room temperature. 

thanks

DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Advance HMI and Android HMI
« Reply #1 on: April 14, 2018, 02:40:33 AM »
You might be able to run ModRSsim2 from SourceForge on the AHMI computer since it is a server. Then have the Android write data to a register and then have AHMI read the same register. You should also be able to have AHMI write to a register and read this on the Android. Let me know if you need more details.

rob1970

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Advance HMI and Android HMI
« Reply #2 on: April 14, 2018, 11:42:56 AM »
Thanks. I will research this a bit.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Advance HMI and Android HMI
« Reply #3 on: April 14, 2018, 12:26:20 PM »
Another option could be to use Microsoft RDP client on your Android device to connect remotely to the computer running AHMI.

If this is pretty much what you did with VNC then just ignore my suggestion.
« Last Edit: April 14, 2018, 12:37:32 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Advance HMI and Android HMI
« Reply #4 on: April 14, 2018, 02:07:35 PM »
You should still be able to use VNC.

In your current AHMI project, just create a new form with simple controls for the room temperature.
Make sure this form's size and StartPosition properties are set the same as the MainForm.
Add the same Modbus driver to this form.

Add  a standard button control to the MainForm and use it to show this new form.

This new form, when called, would be covering the MainForm so both of them could be running at the same time.

Something similar to the attached pictures.
For this experiment, I have used: ModbusTCP driver, standard buttons and a BasicLabel control on Page2.
This was the code behind these buttons:

Code: [Select]
    Private currentTemp As Integer
    Private Sub btnUP_Click(sender As Object, e As EventArgs) Handles btnUP.Click
        currentTemp = CInt(ModbusTCPCom1.Read("40001"))
        currentTemp += 1
        ModbusTCPCom1.Write("40001", currentTemp)
    End Sub

    Private Sub btnDOWN_Click(sender As Object, e As EventArgs) Handles btnDOWN.Click
        currentTemp = CInt(ModbusTCPCom1.Read("40001"))
        currentTemp -= 1
        ModbusTCPCom1.Write("40001", currentTemp)
    End Sub

The BasicLabel had its PLCAddressValue set to "40001", a prefix "Temp: " and a suffix " °F".
« Last Edit: April 14, 2018, 02:39:55 PM by Godra »

Phrog30

  • Guest
Re: Advance HMI and Android HMI
« Reply #5 on: April 14, 2018, 02:46:34 PM »
If you need code to run all of the time, I suggest using parent. That's what I've done and it works well.

rob1970

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Advance HMI and Android HMI
« Reply #6 on: April 15, 2018, 04:52:20 PM »
Using ModRSsim2 as a server is working out well. Thanks for the suggestion,  DougLyons.


DougLyons

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
Advance HMI and Android HMI
« Reply #7 on: April 15, 2018, 07:16:20 PM »
rob1970, I am glad that this seems to be working out for you. You are very welcome for the suggestion. I believe that if we can use these tools to help others, then this is a wonderful benefit that they can provide. Doug Lyons