How to set the PC/PG interface in Step7? - plc

My question is how to set the pc/pg interface in Step 7? I know the PLC's IP but it seems that the program is unavailable to find the PLC in the list of available devices. I am using TCP/IP connection so it would be ideal if I could receive some steps in configuring the interface the right way.

Double­click on "Setting PG/PC Interface" in the "Control Panel" of Windows.
Set the "Access Point of Application" to "S7ONLINE."
In the list "Interface parameter set used", select the required interface parameter set. If the required interface parameter set is not displayed, you must first install a module or protocol via the "Select" button. The interface parameter set is then generated automatically. On plug-and-play systems, you can not install plug and play CPs manually (CP 5611 and CP 5511). They are integrated automatically in "Setting PG/PC Interface" after you have installed the hardware in your PG/PC.

If you are using TIA Portal, you might want to look into Control Panel / Communication Settings.
If you want to connect with a LAN cable to the PLC's Ethernet/Profinet port you must select your Network Card in the PG/PC Interface (or Communication Settings).
After that you should use a fixed IP address on your Network Card.
If the PLC has IP 192.168.0.1 and subnet mask 255.255.255.0 you should set 192.168.0.2 and the same subnet mask.
For this, go to your Network Adapters list. In Windows10 it's Control Panel\Network and Internet\Network Connections
Then right click your Network Card -> Properties
Go to Internet Protocol Version 4 (TCP/IPv4) Properties and enter manually your IP address.
To test the communication open Command Prompt and ping the PLC (eg. "ping 192.168.0.1").
Then probably you will be able to connect to the PLC.

Related

Is it possible to connect to Modbus TCP via Ethernet?

Is it possible to connect the Ethernet port (of a Raspberry Pi) directly to a Modbus TCP RJ45 port (such that the devices can talk to each other)? Or is this not possible without a converter?
I am unsure if this is the correct forum, but I believe this should not be specific to the Raspberry pi.
Short answer - Yes... But....
As per the comments this is possible but there are a few things you will need to do (i.e. some configuration will be needed).
I think it's worth nothing that "Modbus TCP RJ45 port" is not really a meaningful term. Modbus is an application layer protocol; this depends upon a number of underlying layers:
Transport layer - TCP
Network layer - IP
Datalink Layer - Ethernet
Physical Layer - Ethernet cable with RJ45 connectors
You don't need to understand this in detail; the point is that before ModbusTCP will work you need to have a working TCP network (which all Modbus-TCP devices will support; generally via an RJ45 Ethernet connection). As such a better question probably is "If I run a CAT-5 cable between a Raspberry Pi and another device (Modbus TCP unit) will I be able to connect via TCP?" (a lot more people know about TCP/IP networking than Modbus!).
The first thing to consider is Ethernet. Running a cable directly between two older devices will often not work because they needed a crossover cable. Almost all modern equipment (including the Pi) supports Auto MDI-X which means the cable will just work. You can also connect the units via a switch (and doing this removes the need for Auto MDI-X).
Next you need to consider the IP layer. When you connect your Pi to your home network it will (usually!) be given an IP address by a DHCP service (usually running on your router). If you are connecting the Pi directly to the device then there will be no DHCP service so you will need to manually assign IP addresses to the devices (and ensure the subnet is correctly configured). A common way to check if an IP connection is working is to use the ping command.
With the lower layers working ModbusTCP will generally 'just work'. Many ModbusTCP devices also offer a browser based configuration and checking that you can access that is a good way to confirm that the network link is working.
One further question is probably "should I do this"; it's OK to hook things up this way to make some quick changes. However generally you will want the Pi to access other network resources so connecting everything to a router (home router will work; for remote devices a cell router is often used). You can either give the Modbus unit a static IP manually or use the routers configuration pages to assign it a static DHCP lease (otherwise it's IP might change from time to time).

No internet through GSM connection, possible interface issue

I have a problem with getting GSM connection to work.
Currently used:
Advantech UNO-2272G device
Ubuntu 18.04
NetworkManager/nmcli package
The card works when put in a mobile phone.
*Note: following screenshots are made over SSH and remotely, as the device is currently plugged in ethernet until this issue is resolved.
This is current state of "nmcli" command:
nmcli print
The system connection for GSM is called "radi". My guess is that somehow the interface of that connection is trying to work with the other interface (underlined in red), which in turn is trying to get its DNS conf from router (to which it currently is connected with ethernet, but nothing changes if device is plugged out from router and NetworkManager and network is restarted, it still tries to get to router for its DNS).
This is current state of "ip addr" command:
ip addr
This is current state of /etc/network/interfaces file:
interfaces
This is current state of /etc/NetworkManager/system-connections/radi file:
systemconnection
So, the question is, what am I missing here? Is it the interface issue as written above, or something else entirely?
Disclaimer: I am not that proficient in the stuff presented here, most if not all of it was configured following guidelines on the internet.
Hey I'm not expert in this but I do have a different cellular modem connected to a linux system (RPI) and working with NetworkManager (and ModemManager). My modem was connected by a serial UART port (ttyACM0) so that seems similar to what you have done.
When I configured my cellular connection profile in NM I had to setup the ppp section of the connection profile on top of the gsm part. I also went into my ppp options (on the host) and configured those to match a chat script that came from my modem manufacturer. WHen NetworkManager runs a ppp interface it expects the ppp options for the pppd (daemon) to be configured properly.
Here is the ppp section of my NetworkManager cellular connection settings file. Most are defaults and in my case I only added the baud rate for my modem (since it was connected to a UART).
ppp.noauth: yes
ppp.refuse-eap: no
ppp.refuse-pap: no
ppp.refuse-chap: no
ppp.refuse-mschap: no
ppp.refuse-mschapv2: no
ppp.nobsdcomp: no
ppp.nodeflate: no
ppp.no-vj-comp: no
ppp.require-mppe: no
ppp.require-mppe-128: no
ppp.mppe-stateful: no
ppp.crtscts: no
ppp.baud: 115200
ppp.mru: 0
ppp.mtu: auto
ppp.lcp-echo-failure: 0
ppp.lcp-echo-interval: 0
If this is not helpful then have a look at this thread on NM and routing. In their case eth0 was a local network interface and eth1 was their cellular interface
Now to save you 10 hours of troubleshooting - note that the route
metric is independent of the DNS priority! So if you still have
connectivity issues, make sure it's not a DNS resolution issue (eg.
your DHCP server is providing a dummy resolution service). If it is,
then increase the ipv4.dns-priority of your eth0 connection to make it
lower priority, and/or make sure the ipv4.dns-search of your eth1 is
set to "~" to make it the go-to option.

stm32 lwip - unable to respond to ping

I am trying to configure the minimum I can to get my Nucleo-F429ZI to respond to a ping
Using CubeMX, I enable ethernet in MII mode and assign a unique MAC address.
In Middleware I enable LwIP (no RTOS, no DHCP) I set an IP of 192.168.1.55, 255.255.255.0, 192.168.1.1.
I enable ICMP, UDP and TCP.
I build in TrueStudio and run, but no response to a ping from my linux box on the same network.
In main.c I see
MX_LWIP_Init(); which call lwip_init() with the address mask and gw I configured.
In lwip.c
I see my IP, mask and gw initialized correctly followed by lwip_init();
I try to ping from my linux box (same network) but get "host not found"
What am I missing???
in Nucleo-F429ZI the Ethernet physical chips is LAN8742A-CZ-TR that you should configure Ethernet media (your micro mac) in RMII mode, FOR MII interface you need RXD[3:0] and TXD[3:0] between your media level and physical level , but if you look at LAN8742A-CZ-TR datasheet or Nucleo-F429ZI schematic you found that between your physical and media you just have RXD[1:0] and TXD[1:0] pins that is RMII standard interface
your problem can occur according several reasons,
check your media config
check connection and look at links led on your eth connector
check auto negotiation process between your Linux box and phy
CubeMX default RMII pinout and Nucleo-F429ZI pinouts are different. You must change the following pins for achieving communication via ethernet.
PB11 -> PG11 (RMII_TX_EN)
PB12 -> PG13 (RMII_TX_D1)
Also, PHY address is should set to 0 in ETH settings.

Why can't I enter the url on my phone's browser to view my live site?

I use an extension called Live Server in Visual Studio Code. When I run live, the browser opens and the url is http://127.0.0.1:5500/index.html. Why can't I open this url on my phone's browser to see the live site on the phone. Is there a way to do this (Live reload on phone and browser)?
Note: I also develop using ionic and when I ionic serve I can see it on browser and when I open the ionic dev app (not ionic view!), I can see the live app on the phone. I can view it on multiple devices with the condition of all devices being in the same network which I am fine with.
127.0.0.1 is a special-purpose IPv4 address reserved for loopback purposes. That is, this IP refers to your computer itself.
By entering http://127.0.0.1:5500/index.html in your browser, you're requesting web page within your computer.
In normal case, your computer will be in a NAT network (under same wi-fi AP for instance), and you'll be assigned with a virtual IP. Normally it's 192.168.x.x.
You may enter the following command in your command prompt to see your IP address.
ipconfig
If you're using Mac or Linux, use this instead.
ifconfig
As a result, under your network interface card, you'll get your IP Address.
If the IP address belongs to virtual IP, then you may access it with your phone using
http://< Your IP Address >:5500/index.html
If it's not virtual IP, it is Public IP. Then, you'll have to configure appropriate Firewall settings under this circumstance.
Hope this will help.
You cannot open the same url on your phone, because that url host (127.0.0.1) refers to the localhost (the same machine).
If your phone and server are on the same network, you can replace the current host with the servers local IP.
So if your servers local IP is: 192.168.0.36
the URL you enter in your phone should be http://192.168.0.36:5500/index.html.
I had a same problem.
Solution: Control Panel -> Windows Defender Firewall -> Allow an app or feature through Windows Defender Firewall -> Allowed "code.exe" app.
Run ipconfig and find your private IP.
Make sure your phone is on the same network.
go to http://192.168.0.***:5500/
Open Live server's settings.json and add these two settings "liveServer.settings.useLocalIp": true and "liveServer.settings.host": "localhost". Then type your localhost ip in your mobile browser (in my case it was 192.168.0.110) with the rest of the Live server URL i.e. 192.168.0.110:5500/index.html. This worked for me.
Let me clear this out for you. we call localhost or 127.0.0.1 as loop backs. which will itself point to the same machine(means that particular service should also be hosted in the same machine). what Microsoft did with visual studio live share is that if have the live share extension it will create a reverse proxy between the host(where the server is hosted) and the target (In this case your browser) which means even though your host is in a different country the extension will tunnel the transparent proxy to your loop-back address. visual studio live share extension is what you phone doesn't have and Microsoft doesn't support yet. If you still want to access your local service what you can do is turn off the firewall(or pass through that particular port where ur service is hosted) and connect your phone to the same network as your machine with the service running and instead using http://127.0.0.1:5500/index.html use http:// UR SERVER IP :5500/index.html you can get UR SERVER IP by giving ipconfig in windows command prompt or ifconfig if ur server is on linux.

VMWare fusion: connecting to host's web server from guest

I am a web developer and my development platform is Mac. I have installed a copy of Windows XP in VMWare fusion for testing purposes and using IE for previwing my websites. I have Apache running on my Mac with several subdomains, like test.localhost etc.
How can I access the webserver on host OS from the guest OS?
Thank you in advance.
Using Fusion 6.0.2 on OS X 10.9 Mavericks
In the host system (Mac)
turn off your virtual machine
open the "Virtual Machine | Network Adapter | Network Adapter Settings..." menu
in the "Bridget Networking" section choose "Autodetect":
turn on your virtual machine
In the guest system (Win7)
right click on the Notepad application, then select "Run as administrator":
when Win7 asks: "Do you want to allow the following program to make changes to this computer?"
click on the "Yes" button
navigate to: "Computer | Local disk (C:) | Windows | System32 | drivers | etc"
select "All files" in the drop down menu on the right of the "file name:" field
double click the "hosts" file
In the host system (Mac)
open your system preferences and select "Network"; in your connected interface look for the Mac IP:
192.168.1.106 in the example
In the guest system (Win7)
in your notepad window enter the Mac IP followed by the sites you want to reach in your host (Mac) system:
in the example I configured two sites: localhost and caeb.leo
open the browser and you will be able to see the sites hosted on your host system:
Hope it helps!
VMWare Fusion registers an IP address on your Mac and you can use this to point to the host from the virtual machine. You can find it with ifconfig vmnet8. Mine's 192.168.36.1, yours might be the same.
If you're using apache virtual hosts and you try to get http from this address on your virtual machine, it will probably display the default apache page. You'll need to map the domains on your windows host:
Open C:\WINDOWS\system32\drivers\etc\hosts in Notepad and add your hostnames, 1 per line:
192.168.36.1 test.localhost
Then, when you put http://test.localhost/ in IE, it will route to your Mac's apache virtual host.
Andrew's answer, while correct, is missing a significant portion, namely that vmnet8 is only used when the guest OS is set to use the Bridged network option.
If your guest OS is using the NAT network option, as seen in this Windows host example, you would need to use vmnet1 instead.
In this case, the IP of vmnet1 192.168.119.1 allows access to the host webserver, while the IP of vmnet8 leads nowhere.
note, I provide this answer for those who, like me, have the same question as the title but not the exact same specifics of running Apache as a raw local installation
double note, this answer is a mix of Andrew and Camaleo's answer since neither worked in my set up (not pointing to Mac's ip and Bridged Networking's "Autodetect" wasn't working for some reason?) , not sure if the inclusion of Docker Machine causes the hiccup
If you're setup is like so:
(Host) Mac (example ip 192.168.1.249)
(Guest) Docker Machine (example ip 192.168.99.102)
Apache (port 80)
VMware Fusion 10
(Guest) Windows 10 (example ip 192.168.68.142)
Step 1
From within Windows 10 VM open Notepad as Administrator (right click notepad for the option). Navigate to C:\Windows\System32\drivers\etc and instead of Text Documents(*.txt) select All Files. Open the hosts file and add a hosts entry for your Docker Machine's IP(via docker-machine ls). Per our above example setup, the line would look like so:
192.168.99.102 myapp.test # or some other fitting name
Save changes.
Step 2
Note: No need to stop or restart your virtual machine in VMware Fusion 10 when making network changes.
From VMware Fusion Menus select Virtual Machine / Network Adapter / Network Adapter Settings. Choose Share with my Mac.
if "Share with my Mac" is already selected, select a different network adapter option (like Bridged Network Automatic) and then re-select "Share with my Mac" to ensure host file changes are taken
Step 3
Test changes are in place from within Windows VM by pinging the desired address (e.g "myapp.test" as shown above) or by opening Edge/Chrome checking if the webpage loads
note, using a domain name that ends in .test is recommended or Chrome may still have issues with HSTS errors