How to connect two ABB plcs with cp635 HMI? - tags

I want to connect two PLCs ABB PM592 with HMI CP635 via ethernet? I will assign the same ip addresses to both plcs and will connect the ethernet port of each plc with ethernet port of HMI. Will it work?
Will the both ethernet ports of CP635 HMI can work on same ip addresses? Because if I assign different IPs to each plc then i will also have to import tags for each ip with different name but we can assign single tag to one object in HMI design.
Waiting for reply
TIA :)

The PLCs will need seperate IP addresses
The solution is to run two protocols.
To save having to retype all tags, how can export to xml file then import to the new protocol. panel builder 600 will automatically rename by appending a number to the duplicate tags.

Related

Using ethernet connection for two completely different purposes

I have a Dell desktop machine with one ethernet port and one NIC.
I need to use ethernet connection for two completely different purposes.
One is to get internet access via LAN and read more stackoverflow.
The other is to talk to my FPGA eval board and send/receive data
using ethernet.
Is having two NICs a good option, a splitter box externally connected or any other solutions for this kinds of usecases?
(I do not want to mess or change the configurations everytime I switch between internet to eval board with just one ethernet port on the system.(I am doing it currently))
Yes, that is no problem.
The one you connect to internet typically use DHCP.
The other set it to static IP address with another subnet than the first one.
The FPGA also use static IP address.

How to let different processes use different network interfaces?

I'm on the client side. There're multiple network interfaces. How can I let different processes use different network interfaces to communicate? Since I want to connect to the same server, routing seems not working here. Also, connect() doesn't have arguments to specify local address or interface as bind() does.
If your goal is to increase bandwidth to the server by using multiple network interfaces in parallel, then that's probably not something you can (or should) do at the application level. Instead, you should study up on Link Aggregation and then configure your computer and networking stack to use that. Once that is working properly, you will get the parallelization-speedup you want automatically, without the client application having to do anything special to enable it.
"The bind() system call is frequently misunderstood. It is used to
bind to a particular IP address. Only packets destined to that IP
address will be received, and any transmitted packets will carry that
IP address as their source. bind() does not control anything about the
routing of transmitted packets. So for example, if you bound to the IP
address of eth0 but you send a packet to a destination where the
kernel's best route goes out eth1, it will happily send the packet out
eth1 with the source IP address of eth0. This is perfectly valid for
TCP/IP, where packets can traverse unrelated networks on their way to
the destination."
More info e.g. here.
That's why you probably misunderstand bind() call.
The appropriate way to bind to physical topology (to some specific interface) is to use SO_BINDTODEVICE socket option. This is done by setsockopt() call.
Source Policy Routing might be helpful.
Try the following steps:
Use iptables to give packets from different process with different marks.
Use iproute2 to route packets with different marks to different table.
In different table, set the default route to different uplink.
The whole process require certain amount of understanding about linux networking.
Here is an example shows how to route all traffic for a user through one specific uplink: http://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface/
You could try follow similar approach by running different process with different user and route traffic from one user to one uplink.
Also you could let processes communicate with the server with different port and mark the traffic by port.

Send values over wifi via Matlab

I need to send int and double values from one computer to another. The two pc's are connected to the same wireless network and the values I get are generated by a Matlab code. Can this be done in Matlab or do I need to use a medium between the two?
Sending data over WiFi is basically the same as sending it over any network. You'll need the other computer's local IP address (various ways to find this on different operating systems, ask google). You don't want to use an external IP address like this, since this would usually require you to change some settings on your router (e.g. port forwarding).
Once you have a local IP address, you could use something like Sockets - Loren has a good blog post.

Coordinating peer-to-peer messages using multicast, how to get receiving IP?

I have been working on a local LAN service which uses a multicast port to coordinate several machines. Each machine listens on the multicast port for instructions, and when a certain instruction is received, will send messages directly to other machines.
In other words the multicast port is used to coordinate peer-to-peer UDP messaging.
In practice this works quite well but there is a lingering issue related to correctly setting up these peer-to-peer transmissions. Basically, each machine needs to announce on the multicast port its own IP address, so that other machines know where to send messages when they wish to start a P2P transmission.
I realize that in general the idea of identifying the local IP is not necessarily sensible, but I don't see any other way-- the local receiving IP must be announced one way or another. At least I am not working on the internet, so in general I won't need to worry about NATs, just need to identify the local LAN IP. (No more than 1 hop for the multicast packets is allowed.)
I wanted to, if possible, determine the IP passively, i.e., without sending any messages.
I have been using code that calls getifaddrs(), which returns a linked list of NICs on the machine, and I scan this list for non-zero IP addresses and choose the first one.
In general this has worked okay, but we have had issues where for example a machine with both a wired and wifi connection are active, it will identify the wrong one, and the only work-around we found was to turn off the wifi.
Now, I imagine that a more reliable solution would be to send a message to the multicast telling other machines to report back with the source address of the message; that might allow to identify which IP is actually visible to the other machines on the net. Alternatively maybe even just looking at the multicast loopback message would work.
What do you think, are there any passive solutions to identify which address to use? If not, what's the best active solution?
I'm using POSIX socket API from C. Must work on Linux, OS X, Windows. (For Windows I have been using GetAdapterAddresses().)
Your question about how to get the address so you can advertise it right is looking at it from the wrong side. It's a losing proposition to try to guess what your address is. Better for the other side to detect it itself.
When a listening machine receives a message, it is probably doing do using recvfrom(2). The fifth argument is a buffer into which the kernel will store the address of the peer, if the underlying protocol offers it. Since you are using IP/UDP, the buffer should get filled in with a sockaddr_in showing the IP address of the sender.
I'd use the address on the interface I use to send the announcement multicast message -- on the wired interface announce the wired address and on the wireless interface announce the wireless address.
When all the receivers live on the wired side, they will never see the message on the wireless network.
When there is a bridge between the wired and the wireless network, add a second step in discovery for round-trip time estimation, and include a unique host ID in the announcement packet, so multiple routes to the same host can be detected and the best one chosen.
Also, it may be a good idea to add a configuration option to limit the service to certain interfaces.

FIX (quickfix) how to set which NIC/IP to use for the FIX session

I am about to write a trading application using the FIX protocol (QuickFix for C++). The computer has 6 NIC card configured. How do I let my FIX application (acting as an initiator in the case) to use one particular NIC card (IP address) of the all 6 available? The initiator setting only let me set the target host/port, not source IP/port.
And, how to let it use 2+ NIC cards simultaneously (for load balancing purpose) within the same application?
thank you
Initiator only needs to know of the IP address with which it needs to connect. How should a packet reach that IP is the job of the lower network layers and the kernel network stack.
Regarding 2+ NICs, that should be handled by the kernel routing table or the routers, which come along the way.
You can setup specific routes in your routing table.
Example:
route add -host gw
Where is IP address of the target machine to which you want to connect to.
is the IP address of one of NIC you want to use.
Thus it will use that NIC card for quickfix session.
Hope this helps.