Help - Search - Members - Calendar
Full Version: PLC -- vb 2005
Forums.MrPLC.com > PLCs and Supporting Devices > General Topics - The Lounge > Computer Help and Networking
khkertje
Hellow,

I'm making for school a project that needs to read values from a plc, over the ethernet with a PC pogram that I need to make with vb 2005.
The PLC has an ip adres and a port where he send his data (short values).
Do you know how I can read that value on the ethernetnetwork with a program in vb 2005?
Does somebody has some code that i can use for that?

Bart
Nathan
Please specify the requirements in terms of PLC type (brand, model, etc). You could use a standard like OPC. Alternatively, Archie from PLCTalk is working on free VB libraries to communicate with AB PLCs. Not a lot of activity in the open source world, but you can always check out Sourceforge.net.

http://www.plctalk.net/qanda/showthread.php?t=33836


QUOTE(khkertje @ Jan 4 2008, 04:09 AM) [snapback]63353[/snapback]

Hellow,

I'm making for school a project that needs to read values from a plc, over the ethernet with a PC pogram that I need to make with vb 2005.
The PLC has an ip adres and a port where he send his data (short values).
Do you know how I can read that value on the ethernetnetwork with a program in vb 2005?
Does somebody has some code that i can use for that?

Bart

Supporter
Hi,

You have (at least) two problems.

1. This is the easy one, to send/receive data using VB2005 you will need to learn about socket programming. .NET has a framework that makes it fairly easy to send/receive data over ethernet. Use Google and the following search words: socket tcp .net

2. Now, the tricky part. You will need to know the protocol that the PLC supports. In some cases you can get a protocol specification from the manufacturer but I guess that most manufacturers does not want to share this information. What kind of PLC are you using? Even if you don't have the protocol you can try to "reverse engineer" the protocol. For an example, connect an OPC-server to the PLC and read a few words, see what telegrams that are sent/received and try to determine what datafields that contains e.g the address, number of words that you want to read etc.

Also, most PLC's supports Modbus, maybe it's possible to configure the ethernet module to communicate using Modbus instead. Modbus is an "open" protocol and you can find the specification at www.modbus.org
I hope this helps...

//Supporter
khkertje
Hellow,

I'm using an HPC V10. It's a plc from the belgium company ED&A
If selected to use the modbus tcp protocol.
That protocol uses port 502.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.