I'm happy because these past 2 weeks I have been working to decode and interpret the communication between the LOGO! PLC and a PC. Well ... I finished this work and achieved the following:
- Ask the status of communication between PC - LOGO! PLC
- Ask the status of the PLC (The PLC responds RUN/STOP status)
- Forcing the status of the PLC to RUN mode.
- Forcing the status of the PLC to STOP mode.
- Ask the current values (in real-time) of all channels of the PLC:
o 24 digital inputs
o 16 digital outputs
o 8 analog inputs
o 2 analog outputs
o 24 digital marks
o 6 analog marks
o 4 cursors
The application developed in LabVIEW performs the main function of communicate the Desktop / Laptop with PLC LOGO! (That is to say link National Instruments with Siemens ... ja ja). The software performs the following functions:
- Monitors and displays all channels of the LOGO!
- Choose the communication port.
- The user can save in a file all the data, each configurable period.
I have made many tests with different logic modules, and it has not given any problems.
In the image attached, I show you some of the topologies that can be implemented knowing this protocol of communication. I ask you to spread this to engineers/technicians who design and implement these MICRO-AUTOMATION systems, in order to offer this Software applicable to supervisory system or data-logger device.
I'm ready to be able to help
Solved! Go to Solution.
I've also been working on this and I'm sharing knowledge I've adquired and the source code of the VI. It's not finished and it's not commercial. I'm just willing to share something useful.
This program communicates with Logo! (Tested with 7th generation, former versions may not work) and retrieve the status of the inputs, outputs…It’s just an outline of what I think it should be. I explain everything I’ve done so anyone can use it or create other programs.
It uses LabView 8.6 and the .NET library, I’m sorry if this bothers someone but it was the easiest way for me to establish the serial connection. So you will need the .NET framework to make it works, or improve the program using built-in LabView libraries.
The communication with Logo! is based on RS232 but it’s not revealed. Here you have some of the protocol configuration and control words that I’ve learned and how I have interpreted them.
BaudRate 9600. Parity=0. Databits=8. Stopbits=2. The XOn/XOff Handshake seems to work quite fine.
All control words and answers are written in Hexadecimal code. No terminator is needed.
Question? (PC) Answer (Logo)
(Status?) 21--->( Status OK ) 06 03 21 44
(Mode?) 55 17 17 AA ---> (if STOP) 06 42
(if RUN) 06 01
(Go to Stop Mode) 55 11 11 AA --->(OK) 06
(Go to Run Mode) 55 18 18 AA --> (OK) 06
(Read all status) 55 13 13 00 AA --> (79 bytes length packet) 06 55 11 11 4A D6 00 19 20 00 00 00 00 00 00 00 ….. AA
Where byte 34 represents the status of the digital inputs, byte 38 is the status of the digital outputs and byte 45 is the status of the cursors. But there is much more like analog inputs, analog outputs and marks (both digital and analog) that I haven’t identified.
The cable (USB version) create a virtual COM PORT in order to use the RS232 protocol. It uses a 6pin connector but I haven’t been able to identify the pins. They use a Texas Instruments chip HA14 7AK G4 but I couldn’t find any information about it. I believe that the Logo! itself power the chip on the cable with +5V (bottom left pin) and GND is middle left pin so it left 4 pins for TX, RX, RTS and DTR but trying to identify the pins was when my Logo! died. So be careful.
Hope you find it useful and if anything is wrong or you learn something more, please post it.
Thanks for sharing ....
I send you some interesting items:
- The PLC data frame depends on the versions of the PLC
Generation 4 and 5 mistra not send the data frame.
The Generation 6 sends a data frame larger.
The generation 7 mmmm. I do not know. Siemens has not yet released it to Latin America.
- With respect to the data cable PLC-PC. This link may help you.
- With respect to commands ...
- Finally, with respect to the GUI
Thanks for the VI which I managed to get to work with a OBA6, however it seems to be very unstable when running on my PC (Windows7 64bit) also when I converted it to use the VISA blocks, the data has shifted. I am also getting very inconsistent comms? Any suggestions would be much appreciated.
Yes, thanks a bunch !. Already tested your code, it worked without any problems !. Did you find any good source of documentation of the LOGO protocol ?
In order to use all the features of the Logo, reading AI, AO and being able to set AO and DO's is also needed. Reverse engineering is always somwhat of a challenge and I noticed that our fellow LV'er cacalderon had solved this issue.
I found a dutch made software for logging of the LOGO data, however, I could not get it to work.
I have been using the USBlyzer software to capture the commands on the LOGO USB<->PC cable, its fairly easy to use ang comes with 33 days of free trial time.
I didn't find any documentation, all I know is from this forum and reverse engineering.
I only had the basic model so I cna't help with AI, AO and I don't know if is possible to set a value.
You have done an excellent job gongratulations.You would like to share with all of us your knoweldge of how you create this by posting your Vi code?Thanks