AdvancedHMI Software
General Category => Open Discussion => Topic started 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.
-
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/
-
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.
-
Are you running the program as a superuser (sudo)?
What is the IP address of the Pi ethernet?
-
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.
-
I don't have any other suggestion for you but to change the IP address of your Click PLC to 192.168.2 range.
-
This page shows a different default IP address for Click PLC:
https://www.automationdirect.com/microsites/clickplcs/click-help/Content/200.htm
-
ill give that a try real quick.
-
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
-
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?
-
Correct, tty0tty is for Modbus RTU.
-
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.
-
Can you ping the PLC IP Address from the Pi?
-
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)
-
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.
-
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
-
are you talking of setting the raspberry up for a static ip?
-
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?
-
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.
-
I will try that when I get home today. Working right now
-
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
-
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. :)
-
Good to see everyone is friendly :)
-
Not being unfriendly. Simply pointing out you had the answer for a while.