uLogix1500 & C++ serial..

fusion

Member
Join Date
Jul 2005
Location
Auckland
Posts
26
I was wondering if you could help me with the serial communication between C++ program and micrologix 1500 plc.
I have set the baud 19200, 1 stop bit, no parity, 8 byte size. The port opens perfectly.
I do not know wat sort of input does the plc accept? i tried to send an acsii string but the plc would not respond to it.
All i really need is to know what sort of output should i send from my C program as a string that the micrologix 1500 will accept and then respond to. Also the C+ is a very fast pace language, where as the plc is slower..do i need any special timers or anything?

Your help will be much appreciated.
Please see attached file for the C code..
 
AB Micrologix and SLC serial ports have two modes, user and system. System mode supports defined protocols for communicating between like devices and the programming device (PC). When in user mode, there are ladder logic instructions that instruct the PLC on what to do with the serial port; receive, transmit, and process the data.

Some of the PLCs have 2 serial ports, typically the primary port is set to system mode by default out of the box. If you want to use it you'll need to use the programming device to access the channel configuration and change it. Same is true for the 2nd port.

so first you'll need a PC with RSLogix, then you can use it to investigate the serial port modes and instructions.
 
Well not to be Rude but you do have another post on this topic already

But

You have a couple options. Both will require a copy of Logix as the previous poster mentioned

You can buy a Single OPC Server and integrate it into your code.. This is the simplist...

or you can write a driver based on the following manual

DF1 Protocol and Command Set Reference Manual

Just type the above into Yahoo and you'll get a link to the PDF
 
i see, you can just open serial port, maybe you'll find it much harder than you expected ... here, i found something interesting, it's an RTU simulator with MODBUS and AB DF1 support, there are also c++ source available ... watch files like "ABComms.cpp" or "ABCommsProcessor.cpp" ...

http://www.codeguru.com/Cpp/I-N/network/serialcommunications/article.php/c5401/

... if you're unfamiliar with winapi (and rs232 comm structures) you'll do much easier better thing using OPC server as wnkook suggested ...
 
Yep, i have a copy of RSlinks with the RSLogix500, it detects the input/output on the micrologic1500 and i can upload my ladder logic into the micro with no problems. The user interface for the logic is in C+, i thot tht wud be a good option but i cnt get the string to work with the ladder logic. and now i have read that it is simplier to do in MS Excell! has anyone tried to work the plc from Excell?
 

Similar Topics

Does anyone know of an AOI using the user ASCII protocol select on the L6x controllers that will talk Modbus RTU using RS-485? Thanks, Trevor...
Replies
1
Views
129
I have 9 field devices, three METSEPM5110 power meters and six ACE949-2 rs285 interface modules. I want to read this Modbus rtu data through rs485...
Replies
8
Views
315
I have lm9030 program on my toughbook CF-29 cannot get my program to hook up with the serial port.
Replies
2
Views
67
I have a project to setup base programs across multiple PLC platforms that can be used for Modbus communications to various sensors that have...
Replies
0
Views
120
Hello all, I am a college student currently working on my senior year engineering capstone project. As part of this project, I have been given an...
Replies
6
Views
238
Back
Top Bottom