News:

  • September 29, 2023, 03:39:28 PM

Login with username, password and session length

Author Topic: h0-ecom to plc trouble  (Read 5882 times)

bryannotbrian

  • Newbie
  • *
  • Posts: 4
h0-ecom to plc trouble
« on: July 20, 2007, 01:03:15 AM »
Hi everyone,
   I just got an internship with a company that uses DL06 PLCs.  I have been working for about 2 weeks now so I get the basics of ladder logic programming.  My first task was to get the PLC to take the readings from a thermocouple, humidity transmitter, and a pressure transducer.  I was able to do that alone but now they want me to use an H0-ECOM module to take those readings from the PLC and have it write to a file (preferably an excel file) onto my laptop.  Ive been looking through the manual and they only give examples for plc-to-plc communication.  Also, I already looked at the report-by-exception program.  It was quite confusing and I don’t know how to retrieve the data once it is written on to my laptop.  Any help would be greatly appreciated.  Thanks!

-bryan

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 254
    • Host Engineering, Inc.
Re: h0-ecom to plc trouble
« Reply #1 on: July 20, 2007, 10:10:00 AM »
bryan (not brian),

there are two options to do this: one is free but takes some work, the other costs money but takes essentially no work:

the free route involves getting the ethernet sdk from the host engineering web site (www.hosteng.com/ethernet_sdk) and use that to build a visual c/c++ or visual basic application to retrieve the data from the plc and store the data in a file of your choice. there are example programs for vc and vb that read & write plc data, so all you'd have to add is the code to store the data in a file.

the not free route is buying the dsdata server (pc-dsdata) from automationdirect.com (the place the company bought the dl06 and h0-ecom) and use that to pull the data directly from the plc into an excel file.

--mike
Good design costs a lot. Bad design costs even more.

bryannotbrian

  • Newbie
  • *
  • Posts: 4
Re: h0-ecom to plc trouble
« Reply #2 on: July 20, 2007, 12:52:09 PM »
Thanks for the tips mike.  I looked at the example vc and vb code and it was pretty overwhelming.  Is there any way I would be able to communicate from plc to pc without having to use vc or vb?  I would feel more comfortable just using ladder logic and netedit then just have the file be directly written onto a file.  Is this in any way possible?

chris.zeman

  • Jr. Member
  • **
  • Posts: 12
Re: h0-ecom to plc trouble
« Reply #3 on: July 20, 2007, 02:52:23 PM »
It's not that easy, I'm afraid.

There is a third option, however. You could purchase an ActiveX control and use it to perform the data transactions with the PLCs. I purchased an ActiveX from vhmiautomation (http://vhmiautomation.com) and currently have a program running with it, but plan to phase it out in the near future. I'd be happy to send you the source code if you like. It was written in VB6. I won't be purchasing anything else from vhmiautomation, though. It took months of trying to contact them for support before I finally got a response. There's another company selling their activex on eBay for around $90.

I'm currently working on a program that will collect data from multiple PLCs and log the data to a MySQL database. I'm using the Ethernet SDK source code and my program will be running on a Linux server. I really don't have anything worth sharing for that yet, though. :(

Good luck!
Chris

bryannotbrian

  • Newbie
  • *
  • Posts: 4
Re: h0-ecom to plc trouble
« Reply #4 on: July 23, 2007, 01:55:17 AM »


Thanks for the tip Chris but I need to go the free route for this one.  I got Ethernet sdk from the host engineering website already.  There are a lot of different files and I was just wondering if anyone knew which file it would be writing to.  Also, which file will I have to add code to?  Will the code I have to add be complicated?  I took a C++ class a while ago and I only learned some of the basics.  Thanks for all the help!

-Bryan

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 254
    • Host Engineering, Inc.
Re: h0-ecom to plc trouble
« Reply #5 on: July 23, 2007, 11:47:50 AM »
bryan (not brian),

use the examples named etherccm (there's one for visual basic and one for visual c). it demonstrates the basics of locating the ecom or ecom100 on the network, establishing a connection to it, readng and/or writing data, then closing the connection.

that example lets you read and write plc data by manually entering the range, length, etc. and sending the output to the screen. in your app, you'll need to replace the ui so that your application will enter the required data, and replace the output code so the output data goes to a file instead of the screen. both of these should be pretty straight forward.
Good design costs a lot. Bad design costs even more.

bryannotbrian

  • Newbie
  • *
  • Posts: 4
Re: h0-ecom to plc trouble
« Reply #6 on: July 23, 2007, 01:16:52 PM »
Hey Mike,

Unfortunately for me, none of this seems to be straight forward.  I suppose the intro class I took on C++ isn’t enough because most of the code on this file is completely alien to me.  I don’t know which pieces of code I need to change so my app will enter the data and to replace the output code so the data outputs to an excel file nor do I know what the code should look like.  I also tried to build the etherccm.cpp file without changing anything and it gave me this error: 

Linking...
LINK : fatal error LNK1104: cannot open file "\ethersdk\lib\hei32_2.lib"
Error executing link.exe.

Forgive my naivety but please help.