News:

  • June 09, 2026, 07:30:04 PM

Login with username, password and session length

Author Topic: MS Visual Studio 2005 and Ethernet SDK  (Read 31242 times)

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
MS Visual Studio 2005 and Ethernet SDK
« on: October 23, 2007, 11:45:00 PM »
I am brand new to pc programming, (only plc's in the past) so I decided to jump head first into my own scada system, I downloaded the ethernet sdk but I can't get any of the code to show up in my object browser, so that I can actually use it in my program. I have been able to succesfully build a couple of small programs that actually worked using some direct logic drivers from elsewhere, but I can't even seem to get started with this sdk, Could someone please help? Jason
P.S. I am trying to write in VB using Visual Studio 2005
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3827
    • Host Engineering
Re: MS Visual Studio 2005 and Ethernet SDK
« Reply #1 on: October 24, 2007, 09:14:42 AM »
The SDK is written in C for "native" applications (i.e. Intel x86 or other processor targets).  VB generates "byte code" like Java, for the .NET framework.  While it is possible to get it to work, i.e. .NET with non-managed code (non-managed code is the term for non-.NET code), it is not trivial.

Your best bet is to use C++ native applications (MFC can help with your GUI).

However, if someone out there has a .NET Wrapper for our SDK, you could then try VB with that and the SDK.

MikeS

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 264
    • Host Engineering, Inc.
Re: MS Visual Studio 2005 and Ethernet SDK
« Reply #2 on: October 24, 2007, 09:39:59 AM »
I have a VB.Net 2003 conversion of the SDK code that was done by a customer, if you'd like a copy of that code to start with, go to the hosteng.com web site and follow the link to request the Ethernet SDK SOURCE code, mention that you'd like the VB.Net conversion code as well as the C source and I'll wing it right to ya.
Good design costs a lot. Bad design costs even more.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: MS Visual Studio 2005 and Ethernet SDK
« Reply #3 on: December 24, 2007, 10:45:30 PM »
Thanks for the help guys! I am actually making some progress now! 8)
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

away24

  • Newbie
  • *
  • Posts: 1
Re: MS Visual Studio 2005 and Ethernet SDK
« Reply #4 on: November 13, 2008, 04:55:43 PM »
Any updates on the MS Visual Studio version?

evaldes

  • Newbie
  • *
  • Posts: 1
Re: MS Visual Studio 2005 and Ethernet SDK
« Reply #5 on: December 08, 2008, 07:29:46 PM »
Depending on what you are trying to do, there may be a simpler solution. I needed to talk to a DL06 via ethernet using Freepascal in Linux. I tried translating the SDK header files to Freepascal, but I could not get it to work properly. I then tried figuring out the protocol by reading the SDK code, but it was too easy to get lost. So I then decided to simply sniff the network while running etherccm to see what the traffic looked like. It turns out that the protocol is not that complicated.

What I found is this:

UDP broadcast from PC:   48:41:50:1:0:c7:58:0a:0:9:0:20:0:4:0:0:0:0:0
UDP PLC -- > PC:              48:41:50:1:0:e9:ab:0f:0:55:aa:0:e0:62:20:ab:61:0:1:0a:ea:3e:56:0
UDP PC --> PLC:               48:41:50:2:0:84:40:1:0:4
UDP PLC -- > PC:              48:41:50:2:0:a4:5a:2a:0:0:ff:1:0:0:e0:62:20:ab:61:40:0:80:0:0:0:0:0:0:0:0:0:0:0:0:0:34:44:0:0:0:0:0:0:0:0:0:0:0:0:0:0
These first four messages I believe are simply for the SDK to identify what PLCs are on the network.

UDP PC --> PLC:              48:41:50:3:0:a1:50:8:0:19:0:1:1e:32:50:10:31
UDP PLC -- > PC:             48:41:50:3:0:2e:99:6:0:20:19:0:0:0:0
UDP PLC -- > PC:             48:41:50:3:0:a0:fe:36:0:22:19:0:0:0:0:57:2:3:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
These next three message actually are useful. The first message of this set is a read data command. The second message is an acknowledgment of some sort. The third line contains the actual data.

When I looked at the read command, I came up with this:
1 -   H
2 -   A
3 -   P
4 -   command sequence number LSB
5 -   command sequence number MSB
6 -   CRC LSB
7 -   CRC MSB
8 -   data size in bytes
9 -   Not sure. Data size MSB?
10 - Message is a command?
11 - ??
12 - ??
13 - command type?
14 - data request length
15 - data address LSB
16 - data address MSB
17 - data type

Using this information I was able to write a program that read and wrote data to the PLC. I was also able to decode the messages sent by the RBE example.

If you are working in something other than C or VB6, this approach may be easier than using the SDK.

Good luck.