PLC programming in C++

RockNRollRulz

Member
Join Date
Aug 2003
Location
St. John's
Posts
2
Hi all, this is my first time using this site. It was highly recommended by one of my instructors, so I figured I would give it a try. My question is that I am trying to write a PLC driver program that will connect to a modem and just read and write information from the PLC to a microsoft access database. The problem I am having is that I do not know how to write code to connect to a modem. If anyone can help me with this or at least point me in the right direction it would be greatly appreciated. Thanks.
 
Connecting to a modem is only one of the tasks you'll have to master. Before you start to worry about how to connect to a PLC through a modem, you'll have to figure out how to connect to the PLC directly through your computer's serial port.

For that, you need to identify what type of PLC you want to talk to. The reason we need to know that is because different PLCs use different rules to do serial port communications. These sets of rules are called 'protocols', and each brand of PLC has its favorite protocol. The closest think to a universal serial protocol is one called Modbus RTU, often referred to simply as Modbus, but sometimes identified as RTU. This is the standard for just about all Modicon products, but many brands of PLC can also use it.

Once you decide on your serial port protocol, you'll need to add control for the modem to tell it what telephone number to dial and how to deal with the response it receives from the telephone on the other end of the line. The driver that handles communications with the PLC doesn't care whether the data it sends and receives is coming through a modem.
 
Do a search for "Mark Goodwin".
Then search within results for "Serial Communications".

You'll find a lot of info. Mark has a book on this subject available at Amazon.
 
For a good basic to advanced/intermediate understanding of all things serial I can recommend "The C Programmers Guide to Serical Communications" by Joe Campgell. Should be available on Amazon.com. However, it does not cover anything with the newer Microsoft OS's (NT, 2000, XP) where direct serial port calls are not allowed (or so I've read...) If you are using an older C++ compiler on a DOS or Win95 system, it will apply direcely. Regardless, the information on general serial stuff will not be a waste of your time.
 

Similar Topics

Hello colleagues, Some time ago I started my adventure with programming. With your help and the courses, things are starting to come together...
Replies
13
Views
661
Dear All, I need a sample PLC program to count the output pulse of a mass flow meter so that a specific amount of mass (for example 100gm)can be...
Replies
2
Views
143
Hi Please I have zeilo smart relay #SR2A201BD but I don't have it's programming cable. Can I use any general usb/rs232 converter? Or need...
Replies
3
Views
130
Hi, Does anyone have thoughts or know of, can point in the right direction any published materials with a plumbing centric point of you explaining...
Replies
1
Views
161
@ All: what is your best guess on a potential range in increase in efficiency in % (i.e. saved programming hours, greater output, etc.) when...
Replies
5
Views
343
Back
Top Bottom