News:

  • February 05, 2023, 06:54:44 PM

Login with username, password and session length

Author Topic: Updated VC Samples  (Read 6505 times)

JMB

  • Jr. Member
  • **
  • Posts: 15
Updated VC Samples
« on: August 12, 2011, 02:31:49 PM »
Hi All,

I've attached a very straightforward update of the Visual C EtherCCM sample.  I did the following things:

- updated the project to Visual Studio 2008
- replaced the timeGetTime() function with a version that doesn't require the multimedia library
- removed some of the unnecessary Win32 parts
- switched to using version 3 of the HEI library
- changed some of the integer data types to match their usage and eliminate a few compiler warnings
- added a bit of error reporting to the main() method (specific return codes)

I've tested this against an H4-ECOM and an H2-ECOM100 that I have on my corporate network in both Debug and Release builds and it appears to function correctly.  If anyone has any comments, (constructive)criticisms or finds any problems - let me know.

I intend to do the same thing with the other samples over the next little while but I don't have access to any ERM/EBC/etc hardware to test against so someone else will have to try them out.

Thanks,
Jacob
Jacob Berghofer
Robotics and Automation Engineering Technologist
E-One Moli Energy (Canada) Ltd, Maple Ridge, B.C.

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Updated VC Samples
« Reply #1 on: August 12, 2011, 10:25:34 PM »
Jacob,

I have a complete setup in my office so I can test any code you need help with.

Thanks,
Christopher

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Updated VC Samples
« Reply #2 on: August 13, 2011, 09:38:03 AM »
Jacob,

I am taking my lumps with Visual C. I am getting a hei32_3 not found when trying to execute EtherCMM.exe

It builds fine.

Thanks,
Christopher

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 5793
  • Yes Pinky, Do-more will control the world!
Re: Updated VC Samples
« Reply #3 on: August 13, 2011, 10:35:21 AM »
It's looking for ether32_3.dll, the file that actually does all of the work. It just needs to be somewhere that Windows normally loads DLLs from...which could be the directory you are running etherccm.exe from or the Windows directory.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Updated VC Samples
« Reply #4 on: August 14, 2011, 12:42:56 PM »
I was incorrect about error before, the program is looking for hei32_2.dll and not hei32_3.dll

Any thoughts on this?


Thanks,
Christopher

JMB

  • Jr. Member
  • **
  • Posts: 15
Re: Updated VC Samples
« Reply #5 on: August 15, 2011, 02:21:04 PM »
That seems odd since I set up both the Debug and Release builds to link against hei32_3.lib so it should only want hei32_3.dll.  Either way, set up post-build events with this command line:

copy "$(ProjectDir)\Lib\hei32_2.dll" "$(ProjectDir)\$(OutDir)\"
copy "$(ProjectDir)\Lib\hei32_3.dll" "$(ProjectDir)\$(OutDir)\"

This should copy both .dlls into the same directory as the final executable on a successful build.

Jacob
Jacob Berghofer
Robotics and Automation Engineering Technologist
E-One Moli Energy (Canada) Ltd, Maple Ridge, B.C.

chrisatwan

  • Full Member
  • ***
  • Posts: 30
Re: Updated VC Samples
« Reply #6 on: August 15, 2011, 04:14:42 PM »
Jacob,

I retraced my steps and it is working fine now. I had the change:

WORD Protocol = HEIP_IPX;

to

WORD Protocol = HEIP_IP;

Which solved my next problem. I am going to play with this along with trying to get my VB6 dll working. I am able to find the ECOM but unable to write or read from it with the dll.


Thanks,
Christopher