Get data from Compact Logix to Android C++ App (Sysdev Kalipso)

ASF

Lifetime Supporting Member
Join Date
Jun 2012
Location
Australia
Posts
3,921
Hi all,

I have a customer who wants to use an android app developed using a C++ application generator (Sysdev Kalipso) to extract some data from a Compact Logix 1769-L18ER-BB1B. It will be a very simple setup - the operator will press a button, and this will load one REAL value into a field on the application, which will ultimately get sent to an SQL database with other correlating data. All I have to worry about is how to get the data from the PLC into the app; what happens after that is somebody else's problem.

I don't have any experience with C++ beyond a few weeks of it in high school IT. The guys developing the application will obviously be proficient, but have no experience with PLC's. Ultimately, all they need from me is some information on what sort of C++ code is required to extract the value they want from the tag I specify.

Does anyone have any documentation/example code on extracting a value from a Compact Logix with C++? Or has anyone set anything like this up before, who can give me a starting point?

Thanks!
 
I would recommend buying the C library from Real-Time Automation. It's ordinary ANSI C and will work on any OS with the Berkeley sockets layer (and Android networking is largely Linux)

https://www.rtaautomation.com/software-solutions/ethernetip-client-tagc/

While there are some Java and Python libraries and other open-source Android communication projects out there, they're all at the testing or experimental stage. The RTA library will, in my estimation, reduce quite a bit of risk for troubleshooting and development time.
 
My suggestion would be to not try to connect to the PLC with the phone. The phone and other mobile devices should get their data from a database through a web app. If you have an OPC server and scada system then you could use that to move the data between the PLC and SQL. If not, then you need something like a windows service to handle the movement of data between the PLC and SQL server.

I have spent the past 6 years completely rewriting the data handling, routing and order fulfillment for a large tire factory. It included writing custom drivers for the controllogix PLC and other custom socket drivers for PC based machinery, The system uses only C#, ASP.NET and SQL Server. No scada and no OPC servers. The system has approximately 100 windows services handling everything from barcode readers, recipe downloads, test result uploads, etc. It's big.

Anyway I don't mean to ramble on, I just wanted to qualify my answer and I am over simplifying.
 
Not sure what all it can do or be used for, but it's worth a read of the manual.

http://www.remotemagazine.com/main/...for-controllogix-and-compactlogix-processors/

Thanks for the link - unfortunately not suitable for my application because the L18 Compact Logix uses 1734 I/O, not 1769. And also I'd rather keep the C++ code out of my panel so that nobody can try to pretend I'm responsible for it :D but good to know that they exist!

I would recommend buying the C library from Real-Time Automation. It's ordinary ANSI C and will work on any OS with the Berkeley sockets layer (and Android networking is largely Linux)

https://www.rtaautomation.com/software-solutions/ethernetip-client-tagc/

While there are some Java and Python libraries and other open-source Android communication projects out there, they're all at the testing or experimental stage. The RTA library will, in my estimation, reduce quite a bit of risk for troubleshooting and development time.
Thanks Ken. A bit of googling turned that up and I wondered if perhaps I would be best to just point them that way. If you've used it before (or if you just happen to know), what sort of ballpark price am I looking at for that?

My suggestion would be to not try to connect to the PLC with the phone. The phone and other mobile devices should get their data from a database through a web app. If you have an OPC server and scada system then you could use that to move the data between the PLC and SQL. If not, then you need something like a windows service to handle the movement of data between the PLC and SQL server.

I have spent the past 6 years completely rewriting the data handling, routing and order fulfillment for a large tire factory. It included writing custom drivers for the controllogix PLC and other custom socket drivers for PC based machinery, The system uses only C#, ASP.NET and SQL Server. No scada and no OPC servers. The system has approximately 100 windows services handling everything from barcode readers, recipe downloads, test result uploads, etc. It's big.

Anyway I don't mean to ramble on, I just wanted to qualify my answer and I am over simplifying.
In this application the idea is to get the data into the database. I personally agree, the better way to do this would be to have the SCADA system log all the relevant data to the database, and have it viewed on the tablet from there. But unfortunately, the customer has bought into a setup where the other information is obtained via RFID tags into this app using C++ code, and they need to compile it with data from my PLC, before putting it into the database. They're not interested in hearing that they should have done the whole lot, RFID and all, via the PLC and SCADA system so at this point I just have to help them do what they're trying to do.

Thanks for the responses!
 
The Ethernet/IP (CIP) implementation by Allen Bradley can be found here:

https://github.com/EIPStackGroup/OpENer

However it is in C and not C++. Someone has ported it to C++ which is here:

https://github.com/liftoff-sr/CIPster

Some very important things to know about these libraries.... First it is a generic CIP implementation and mainly geared toward being an Ethernet/IP adapter. It is by no means ready to use for retrieving tag data from a PLC, so it would take some work by someone quite knowledgeable in CIP to add the read tag service. For someone with no PLC experience, it could take months of work to learn then implement even from this starting point.
 
What about using Modbus TCP on the PLC? There are a number of examples then to use c++ to get the data out of the unit.

Just a thought,
Regards,
 
The Ethernet/IP (CIP) implementation by Allen Bradley can be found here:

https://github.com/EIPStackGroup/OpENer

However it is in C and not C++. Someone has ported it to C++ which is here:

https://github.com/liftoff-sr/CIPster

Some very important things to know about these libraries.... First it is a generic CIP implementation and mainly geared toward being an Ethernet/IP adapter. It is by no means ready to use for retrieving tag data from a PLC, so it would take some work by someone quite knowledgeable in CIP to add the read tag service. For someone with no PLC experience, it could take months of work to learn then implement even from this starting point.

The guys developing the application are not familiar at all with PLC's or CIP as far as I'm aware, so I don't think it's a practical solution for me in this instance. But good to know that this exists, I'll file it away for future reference.

if it is simple, you can use the socket interface,

check out enet-at002
http://literature.rockwellautomation.com/idc/groups/literature/documents/at/enet-at002_-en-p.pdf

You will have to write code in the PLCs, but you were going to do that anyway, right?
That's where I initially thought this was going, but with the responses above I'm hopeful that I'll be able to get this working without actually having to visit site. Just because it's two plane trips and a 3-4 hour drive on gravel roads away.

What about using Modbus TCP on the PLC? There are a number of examples then to use c++ to get the data out of the unit.

Just a thought,
Regards,
I hadn't thought of that. I doubt these guys are familiar with Modbus either, but they might find it easier to get up to speed with that, than with Ethernet/IP. Perhaps I'll throw that in the mix as a "potential option" - but I think right at the moment I'm going to be pushing for the RTA solution.

Thanks again for all the different ideas! Always good to learn multiple ways to remove the hide from a feline.
 
I also vote for the Modbus TCP way, except if the vendors of RTA library, or other library, assure they have tested the library on Android and better if tested with Sysdev Kalipso

The Android native programming language is Java, an Android app can have parts of the code written in C or C ++ that will be executed through JNI, but the main skeleton has to be Java.

Programming tools like Sysdev Kalipso generate this java skeleton so the application can run on Android.

Ethernet/IP protocol is a quite complex protocol and incompatibilities can arise on any of those steps to make possible execute the C++ code in an Android device.

Instead Modbus TCP is a pretty simple protocol that a programmer with medium sockets knowledge can implement easy.
 
Last edited:

Similar Topics

Hi, I'm trying to get values from 8 encoders using a 2-wire bus RS485 connection to a Red Lion Data Station. These will ultimately write values to...
Replies
10
Views
2,367
My plc is thr 5069- L306ER and my HMi is the Panelview plus 7. My customer wants me to log on the SD card the values of 8 tags of 2000 arrays. On...
Replies
2
Views
1,410
Hello, For my general information and knowledge, how is querying and storing data from a AB PLC (Compact or Control Logix) typically...
Replies
15
Views
7,362
Hi there, Can anyone suggest the solution to communicate between AB Compactlogix L36ERM controller(Which is having remote flex IOs over ethernet)...
Replies
9
Views
3,609
Let me know if this is possible. I have a Compact logix with a 10.206.100.10 ip address and I need to read data from it to a Control logix on...
Replies
4
Views
2,383
Back
Top Bottom