Comments (5)
Hi,
Sorry for the delay. I was trying to get version 1.5 out.
Are you using hostnames or IP addresses? Hostnames require DNS look ups and those were fairly buggy in verison 1.0. They are better in 1.5.
The connect call is generally blocking, so if a PLC goes offline and you try to connect to it, a number of things could happen. If the PLC just went offline, then it is possible that the network in between the application PC and the PLC has not realized this yet and you may hit timeouts. If it has been a while (OS and setting dependent I believe), then it should fail quickly. But, this should only effect one thread at a time.
However, if you are using different threads for every tag (I am not sure if that is what you were saying), then you should not have an overall hang. I wonder if there is a mutex contention problem internally in the library?
Can you provide more information about how your application uses the library so that I can try to duplicate this?
from libplctag.
I have been looking at this. I think that you've stumbled on a mutex contention problem.
Here are the events that look like they will block in this case:
- create tags 1 and 2.
- do operations on both tags for a while.
- tag 2's PLC goes offline and tag 2 is closed.
- the application tries to reopen tag 2.
- the tag creation process continues fine until it gets to the point of opening the socket to PLC 2. But PLC2 is not there. In some circumstances, the network may not fail immediately to connect. But, during this time, the tag creation has a central mutex locked.
- at the time this is happening, the other tag tries to read. Part of that process involves queuing a request packet against the session object that is being created. That involves locking the same mutex as in the step above.
This seems like a bug that needs to be fixed. Unfortunately, it is not a simple one as the logic flow in question will need to be broken up into multiple parts. Thanks for bringing this to my attention!
from libplctag.
Sorry for not getting back to you. Was going to create a simple test project showing the issue (and make sure I didn't mess up) but never got round to it. However you have found the issue.
Thanks for investigating, I have gotten around this for now by using multiple programs for each plc.
If you would like me test anything or help in anyway, I'm always willing to. Thanks again!
from libplctag.
This is turning into a bit of a mess. It turns out that in some circumstances, the Allen-Bradley PLCs will drop packets! I need to solve that urgently.
from libplctag.
This should be fixed in 1.5.1.
from libplctag.
Related Issues (20)
- Message packing on OmronNJ/NX beyond max response size HOT 2
- 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
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.