AdvancedHMI Software

General Category => Open Discussion => Topic started by: jsathern on November 01, 2019, 02:16:53 PM

Title: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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/
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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?
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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.


Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 04, 2019, 04:25:35 PM
ill give that a try real quick.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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?
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra on November 04, 2019, 06:11:43 PM
Correct, tty0tty is for Modbus RTU.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Archie on November 05, 2019, 07:29:53 PM
Can you ping the PLC IP Address from the Pi?
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern 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)
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra 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.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jasoncircello@gmail.com on November 06, 2019, 07:12:58 PM
A direct connection will work.  Crossover cables are not really needed for anymore.   

View the click plc manual for the ip address configuration. 

Mine is something like 192.168.100.1
                                   Subnet 255.255.255.0

Configure your pi to something like 192.168.100.5
255.255.255.0


Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 15, 2019, 12:22:55 PM
are you talking of setting the raspberry up for a static ip?
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 23, 2019, 10:51:39 AM
I keep trying to get this to communicate and I cannot. Is there a missing step in the wright ups that is just assumed the everyone knows and I do not?
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Godra on November 23, 2019, 06:19:37 PM
Your devices can talk to each other only if they are in the same subnet.
It was suggested to you to change the IP address of your Click PLC to 192.168.2 range.
Have you tried doing so?

Also, look at your reply posted previously:

pi@raspberrypi:~ $ hostname -I
169.254.189.229 192.168.2.16

If these addresses reflect 2 different interfaces, like wired and wireless, then change the IP address of your Click PLC to 192.168.2 range and connect it to the interface that has that 192.168.2.16 address.
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 23, 2019, 06:35:09 PM
I will try that when I get home today. Working right now
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 23, 2019, 11:16:10 PM
Ok so the key is setting up the pi for a static ip address. JESUS I FIGURED IT OUT FINALLY!!! Thanks for your guys help
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Phrog30 on November 30, 2019, 12:54:24 PM
Ok so the key is setting up the pi for a static ip address. JESUS I FIGURED IT OUT FINALLY!!! Thanks for your guys help
Umm, Godra told you exactly what to do in post #5.  You didn't figure anything out. :)
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: jsathern on November 30, 2019, 01:06:24 PM
Good to see everyone is friendly  :)
Title: Re: Raspberry Pi 3 + AHMI + Automation Directs Click PLC
Post by: Phrog30 on November 30, 2019, 03:52:16 PM
Not being unfriendly.  Simply pointing out you had the answer for a while.