Giter Club home page Giter Club logo

Comments (14)

kyle-github avatar kyle-github commented on July 22, 2024

Hi,

Yes, the library works on Windows. I am not a Windows dev, so it isn't as easy to use as the Linux makefile. I last built it with Visual Studio 2013 and it worked fine. Caveat: Windows is not our primary platform, so I am much less able to help with that than Linux.

Once you have the dll, you can use it without any other parts. The dll does not depend on any other libraries (other than the standard Windows ones).

If you are able, I would love to have some contribute a working command line makefile for VS. I have no idea how to do that and it would be better than the hacks I went through :-/

Best,
Kyle

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Have you been able to get the library built under Windows?

from libplctag.

Donnie-github avatar Donnie-github commented on July 22, 2024

I'll test it in a few days and will let you know.

On Monday, 21 September 2015, Kyle Hayes [email protected] wrote:

Have you been able to get the library built under Windows?


Reply to this email directly or view it on GitHub
#16 (comment)
.

from libplctag.

Donnie-github avatar Donnie-github commented on July 22, 2024

Hi Kyle,

I'm using VS2013. However, the version of VS is not so important here.

  1. You should add correct reference path to the .h files in each project. Project Property-C/C++/General/Additional Include Directories - For example for VS2012 project it should be ..\lib;..\lib\ab;..\lib\util;..\lib\windows;%(AdditionalIncludeDirectories)
  2. There are some missing files in VS2012 project - common.c, ab.c, ab_defs.h, common.h

When you fix it, I'll be able to continue with the testing.

Regards

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

I am close to finishing a switch to using nmake instead of the GUI. This seems to be more stable. I am trying to get tag_rw compiling and tested now.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Hi Don,

The Google group is here:

https://groups.google.com/forum/#!forum/libplctag

Or, it might be here:

https://groups.google.com/group/libplctag

I started with the second and ended up on the first.

Best,
Kyle

On Sat, Sep 26, 2015 at 7:39 AM, Don [email protected] wrote:

P.S. Where is that new Google libplctag group ?


Reply to this email directly or view it on GitHub
#16 (comment)
.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

I have checked in (master) the nmake set up for building libplctag. It is not quite ready though.

To build this, you will need Visual Studio. Do the following:

  1. check out libplctag from GitHub.
  2. go to the Start menu (or equivalent) and look in the Visual Studio folder. There should be a folder for tools. Go into that folder.
  3. run the tool called something like Native Tools Command Prompt. This opens a cmd.exe window in which all the environment variables are set up for nmake and the compiler and linker.
  4. cd into the directory in which you checked out libplctag. Go into the vs directory.
  5. run nmake -f vs.mk all. That should build the library.
  6. move the library to where the system will find it. Usually that is in c:\windows\system32 or something similar.
  7. go into the examples directory. (still in the command line) cd ..\examples
  8. type nmake -f vs.mk all. This should make the tag_rw tool.
  9. if you did not copy the library, run set PATH=< path to vs folder >;%PATH% to allow the system to search for the library where it was built.
  10. run tag_rw without any arguments. If you see an error about the .dll missing, make sure to either copy it where the system already searches or set up the PATH as above.
  11. run tag_rw and provide a type and path to the PLC and tag you want to read. Note that with DOS/cmd.exe you will need to escape the command line (the & and = are special characters) and I always, always forget to do that :-(

Unfortunately, this still results in a crash. I have to go get on an airplane in a short time, so I will try to continue working on this later. I am sure that it is something pretty obvious, but I am out of time today.

If you could help debug, that would be great!

I am doing my testing with Windows 7 and the free version of Visual Studio 2013.

from libplctag.

Donnie-github avatar Donnie-github commented on July 22, 2024

I managed to build the library and the sample your way, however I crated and a VS solution with two projects - libplctag and tag_rw. With VS project it's much easier for debugging. I committed the changes to your repository. Currently I don't have а PLC at hand to test but I'll be able to test it next week and will let you know the result.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Were you able to get tag_rw to work to the point where it tried to contact the PLC? I am running into problems with the nmake version, but it looks more and more like it is actually the cmd.exe command line parsing more than anything else.

Do you have a fork of the repository? If so, can you send me a pull request with the patched data?

from libplctag.

Donnie-github avatar Donnie-github commented on July 22, 2024

I've just sent you a Pull request.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Thanks!

I'll go through it and see what you did.

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

Hmm, so I was going through the tag_rw that you checked in. It looks like there are a bunch of changes on the surface, but when I went through them, I really only saw that you had added a define to define sleep as Sleep (which is not correct I believe as Sleep has arguments in milliseconds). Other than that, the rest looks like whitespace/formatting changes. Am I correct?

I have not touched the VS project yet. I will go through that and make sure that my nmake compiler flags etc. are all correct.

Have you been able to get tag_rw to correctly parse the command line? In my latest testing this weekend, I think that may be the core of the problem. It looks like cmd.exe is doing savage and unnatural things to the -p argument. How do I stop cmd.exe from interpreting the quoted string? I tried single quotes, but that did nothing useful. I ended up quoting most of the operator characters like = and & and that got me closer, but I am still not there.

I did not realize that cmd.exe was so different from my *nix shell experience. It has been a very long time since I did much with any command line DOS tools. Maybe there needs to be a different tool than tag_rw for DOS?

from libplctag.

kyle-github avatar kyle-github commented on July 22, 2024

OK, I doubled checked the MSDN docs and found that my core problem was not escaping all of the characters I needed to escape on the cmd.exe command line when testing tag_rw :-(

It turns out that you must escape everything. '&', '=', ',' etc. all must be escaped. I was not escaping the commas in my previous tests! Sigh.

So, the code as checked into the 1.0 and master branches appears to work fine on Win7 32-bit with Visual Studio Express 2013, using nmake. I tweaked tag_rw.c so that all calls to sleep went to my_sleep and then made that platform dependent. I tested the same source with Linux (Ubuntu 15.04 64-bit) and Win7 as I noted above.

I will go over your pull request for the VS project. While nmake requires fewer special cases (i.e. telling the compiler than all sources are in C not C++), it is more of a pain to use so maybe it was not a good detour. Thanks, again, very much for setting that up.

Can I close this issue?

from libplctag.

Donnie-github avatar Donnie-github commented on July 22, 2024

In my personal opinion the Windows developers would prefer a VS project than the nmake option because with VS they'll be able to debug.
Yes, we can close the issue.
Thank you.

from libplctag.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.