Author Topic: Raspberry Pi 3 + AHMI + Automation Directs Click PLC  (Read 6014 times)

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« on: November 01, 2019, 02:16:53 PM »
I wrote a program on Automation Directs Click PLC and verified its functionality. Then I made a HMI using Advanced HMI's software. I am able to hook up to the plc via MODBUS TCP with my laptop and ethernet to use the HMI, but when I copy the .exe and appropriate folders to a thumb drive and try to run the application it is not able to communicate with the Click PLC via Ethernet. The errors on the buttons i ham getting are "Could not connect to 169.254.0.0, port 502. Timed out."

If anyone can help that would be great.

Thanks.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #1 on: November 01, 2019, 02:33:05 PM »
169.254.0.0 is locally assigned address. Is that a correct IP address?

See this:  https://packetlife.net/blog/2008/sep/24/169-254-0-0-addresses-explained/
« Last Edit: November 01, 2019, 02:35:35 PM by Godra »

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #2 on: November 04, 2019, 11:30:27 AM »
That is the default address to the Click. Like I said, everything is the same on the laptop compared to the Raspberry. I just try the program on the raspberry and it doesn't communicate. But I launch the same program on my laptop and it does work. Just to be clear i am directly connecting via ethernet (No router or switch between) both with the laptop and raspberry.
« Last Edit: November 04, 2019, 11:33:21 AM by jsathern »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #3 on: November 04, 2019, 02:38:55 PM »
Are you running the program as a superuser (sudo)?

What is the IP address of the Pi ethernet?
« Last Edit: November 04, 2019, 02:47:24 PM by Godra »

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #4 on: November 04, 2019, 03:13:54 PM »
pi@raspberrypi:~ $ hostname -I
169.254.189.229 192.168.2.16

I try to run as sudo and its the same as running mono.

I can launch the .exe via mono or clicking on the application.

I attached a screen snip of the pi.


« Last Edit: November 04, 2019, 03:32:40 PM by jsathern »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #5 on: November 04, 2019, 04:07:53 PM »
I don't have any other suggestion for you but to change the IP address of your Click PLC to 192.168.2 range.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #6 on: November 04, 2019, 04:10:41 PM »
This page shows a different default IP address for Click PLC:

https://www.automationdirect.com/microsites/clickplcs/click-help/Content/200.htm

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #7 on: November 04, 2019, 04:25:35 PM »
ill give that a try real quick.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #8 on: November 04, 2019, 04:41:07 PM »
Just to clarify "sudo" usage, take a look at the attached picture here which shows how I use it:

https://www.advancedhmi.com/forum/index.php?topic=2498.msg15124#msg15124

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #9 on: November 04, 2019, 04:56:58 PM »
Yes i used it that way and still same thing. This is a TCP connection correct? *New to modbus* so no need for the tty0tty correct?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #10 on: November 04, 2019, 06:11:43 PM »
Correct, tty0tty is for Modbus RTU.

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #11 on: November 05, 2019, 02:52:08 PM »
I been doing a lot of reading and I believe that it is due to the issue of running a .net framework on linux based software? Not positive but I would like to figure this out.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #12 on: November 05, 2019, 07:29:53 PM »
Can you ping the PLC IP Address from the Pi?

jsathern

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #13 on: November 06, 2019, 11:36:48 AM »
no:

$ ping 169.254.0.0
Do you want to ping broadcast? Then -b. If not, check your local firewall rules.
pi@raspberrypi:~ $ ping 169.254.0.0 -b
WARNING: pinging broadcast address
PING 169.254.0.0 (169.254.0.0) 56(84) bytes of data.
^C
--- 169.254.0.0 ping statistics ---
60 packets transmitted, 0 received, 100% packet loss, time 387ms


You think that i'd have to use a crossover cable? I'm just using a direct connection from the pi to the CLICK with an ethernet cord. (Which works from the laptop but not from the PI)
« Last Edit: November 06, 2019, 11:40:06 AM by jsathern »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
« Reply #14 on: November 06, 2019, 05:18:07 PM »
I been doing a lot of reading and I believe that it is due to the issue of running a .net framework on linux based software? Not positive but I would like to figure this out.

Mono has its limitations but AHMI does run properly with the exception of maybe a few controls within its collection.

You should steer away from 169.254 range since it's barely ever used for anything and is kind of Windows thing.

Devices these days are capable of utilizing both straight-through and cross-over cables but it doesn't hurt to try either.