C++/Delphi control of Omron CPM2A PLC

abdekker

Member
Join Date
Jun 2006
Location
London
Posts
2
Hi,

I'm brand spanking new to PLC (and COM port) programming, having spent my career so far doing standard Windows desktop programming.

In my new role, I need to be communicate with an OMRON CPM2A PLC via a serial port. I'm busy going through examples on the net on how to open and close COM ports in C++, but its slow going, and I know nothing about how to control the PLC itself.

Does anyone have any helpful suggestions or perhaps example code for this PLC and/or simple COM port code in C++ and/or Delphi?

Thanks in advance,
Alain
 
Hi, I only wrote a serial port program which is used to communicate with a online gas analyzer.

For general, you need to know the communication protocol of your OMRON PLC, so that you can send your commands in the right way and you can understand the feedback message from PLC.
To open/Close a serial port under C++ or Delphi, I recommend you to use some ActiveX element developped by someone. It hides all the complex code to open/close a serial port, only provide some basic interfaces. So it will be more easier to use this kind of elements instead of writing open/close function by yourself.
 
The default communication protocol with a CPM2A will be Host Link. The link below is to a host link manual. You will not see the CPM2A referenced in the manual, but the information on the protocol is correct.

Omron Host Link Manual


The 9 pin port on the CPM2A will default to host link 9600 baud, 7 data, 2 stop and even parity.

Sorry, but I will be no help on the PC programming side.

Hope this will help.
 
Thanks...

With the help provided here and the manual I've been able to get a simple program communicating with the PLC in C++.

Thanks,
Alain
 

Similar Topics

Hi guys, i've got a question here. I actually i wasn't sure in which fourm post the question, but tlet's give it a try. I want to develop an...
Replies
4
Views
5,243
I have a customer that wants some changes to their HMI Operator Station, that is a PC based program that according to the original manufacturer is...
Replies
10
Views
3,725
How to connect to COM object S7ProSim (version 5.4) and receive events OnScanFinished, OnConnectionError using Delphi?
Replies
0
Views
1,746
I am not fully familiar with the Siemens product line so I thought I would post a small question session here concerning the Siemens Product line...
Replies
23
Views
6,020
I have made another example of how to use Delphi and OPC. This example has two parts: - A Server to read from and write to the PLC, display data...
Replies
0
Views
1,696
Back
Top Bottom