Comments (14)
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.
Have you been able to get the library built under Windows?
from libplctag.
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.
Hi Kyle,
I'm using VS2013. However, the version of VS is not so important here.
- 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)
- 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.
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.
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.
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:
- check out libplctag from GitHub.
- 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.
- 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.
- cd into the directory in which you checked out libplctag. Go into the vs directory.
- run nmake -f vs.mk all. That should build the library.
- move the library to where the system will find it. Usually that is in c:\windows\system32 or something similar.
- go into the examples directory. (still in the command line) cd ..\examples
- type nmake -f vs.mk all. This should make the tag_rw tool.
- 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.
- 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.
- 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.
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.
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.
I've just sent you a Pull request.
from libplctag.
Thanks!
I'll go through it and see what you did.
from libplctag.
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.
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.
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)
- Standalone website to host documentation HOT 4
- Write is not working for SINT and USINT (1 byte) datatype for Omron NX/NJ PLC HOT 5
- MSR is not working for modbus_tcp protocol using libplctag library HOT 3
- MinGW timeapi.h issue HOT 4
- ASP.Net error HOT 2
- Parsing of port/link pairs is not correct in all cases HOT 5
- ControlNet is limited to 504 byte request/response packet sizes HOT 1
- Read/writing OmronNJ/NX TIME and DATE_AND_TIME data HOT 14
- Support data files for input and output without the data file numbers HOT 1
- Support for Omron NX/NJ variable listing HOT 214
- Packet sizes for Omron do not match documentation
- More exposure of internal tag information needed to solve BOOL array problem HOT 1
- Known Omron problems
- Support Omron-style fragmented reads and writes
- split Omron code out from generic/Rockwell CIP code.
- redo start_read()/start_write() to use data segment descriptors.
- Refactor the existing CIP/Rockwell code to eliminate more of the duplication and split out common versus specific code.
- Document all attributes in one place
- Update simulator to support BOOL arrays
- Minor Documentation Bug for `str_is_fixed_length`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libplctag.