Sign in to follow this  
Followers 0
Rejetor

Omron HostLink + Raspberry Pi

7 posts in this topic

Hi, I have a student project in hands that consists in using an Omron CPM1 via HostLink in a Raspberry Pi with an interface to read and write locally and from the web. As raspberry pi works with linux, I need an application to read those registers in linux. I found an application called Proview for Raspberry Pi on Debian: http://maba.dk/index.php/shop/debian/ http://www.proview.se/v2/ http://www.proview.se/doc/en_us/ In the guide to I/O systems, they specify that it supports Modbus/TCP, Other I/O systems need to be created a c/c++ file. Now I´m really lost because I never programmed in c++ and I don´t know how to connect the plc in linux using hostlink, most programs are created for windows with mscomm. Also, I dont have a gateway to convert serial to ethernet, so, I´m stuck with HostLink Serial RS232C. I would love some code written in c++, java or python to comm with the plc over HostLink Serial to have some base to work with the Proview program. Or maybe you know another way to accomplish what I want to do without proview in the raspberry pi. Please Help and thank you in advance!

Share this post


Link to post
Share on other sites
The Host Link commands are detailed in this manual W182 Here is sample code in Visual Basic (thank you Jay!). Hostlink VB Sample Code You should be able to convert the example to a Linux programming language. Hope this will help. Edited by gtsuport

Share this post


Link to post
Share on other sites

Dear, A while ago I started doing the same thing you want to do, but using an Arduino. Search my previous posts : Hostlink via Terminal for more information. Attached you'll find my code to send/revieve commands via the Arduino (and a TTL to RS232 convertor). The Arduino acts as an UDP server which is called from a PHP script running on a webserver (eq. Raspberry PI). The code for the webserver is also included. It isn't finished yet, but might help you get along. Regards, Andy.

Arduino_hostlink.zip

webcode.zip

1 person likes this

Share this post


Link to post
Share on other sites
On 10/20/2013 at 1:35 PM, angeraer said:

Dear, A while ago I started doing the same thing you want to do, but using an Arduino. Search my previous posts : Hostlink via Terminal for more information. Attached you'll find my code to send/revieve commands via the Arduino (and a TTL to RS232 convertor). The Arduino acts as an UDP server which is called from a PHP script running on a webserver (eq. Raspberry PI). The code for the webserver is also included. It isn't finished yet, but might help you get along. Regards, Andy. Arduino_hostlink.zip webcode.zip

Hi,  angeraer can you share your work again, Arduino_hostlink.zip webcode.zip? Thanks.

Share this post


Link to post
Share on other sites

Hi guys, how is it going? 

As i understand you trying to make some kind og opc server with the plc using arduino and rasberry pi?

Share this post


Link to post
Share on other sites
On 2013-10-20 at 0:35 PM, angeraer said:

Dear, A while ago I started doing the same thing you want to do, but using an Arduino. Search my previous posts : Hostlink via Terminal for more information. Attached you'll find my code to send/revieve commands via the Arduino (and a TTL to RS232 convertor). The Arduino acts as an UDP server which is called from a PHP script running on a webserver (eq. Raspberry PI). The code for the webserver is also included. It isn't finished yet, but might help you get along. Regards, Andy.

Arduino_hostlink.zip

webcode.zip

Thank you Andy! This was the perfect solution for another project by me.

It was really helpful to get the the setup and checksum calculations working.

I could save a expensive machine from being scrapped. Here is a video of the result:

https://www.facebook.com/watch/?v=466243297276584

Best regards

Johan

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0