Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRANT 0.2 ETH(or BTC equivalent) - Writing to plc takes long #208

Open
friko16 opened this issue Sep 29, 2020 · 8 comments
Open

GRANT 0.2 ETH(or BTC equivalent) - Writing to plc takes long #208

friko16 opened this issue Sep 29, 2020 · 8 comments

Comments

@friko16
Copy link

friko16 commented Sep 29, 2020

Hello guys, I need help, we got stuck in our project because of this.
I am offering some Ethereum tip.
My issue is that writing to plc takes too long time, around 2-3 seconds.
When writing less values, like 2-3, then it takes shorter around 50ms, so it's seems it's linear dependent on the number of values.
It blocks us.
pseudo-code ( giving you idea how I am doing it ):

WriteValue[] _writeValues = new WriteValue[20];
// initializing writeValues with primitive opcua values..... below just one example of initializing the first value.
writeValues[0] = new WriteValue( // just one example of initializing first value
                    new NodeId(PlcGateway.namespaceIdx = 3, "NodePath.node.someNumber"),
                    Attributes.Value,
                    null,
                    new DataValue(new Variant(new UnsignedLong(2))
            );
SessionChannel sessionChannel; // initialized
sessionChannel.Write(writeValues);
@friko16 friko16 changed the title Writing to plc takes long GRANT 0.1 ETH(or BTC equivalent) - Writing to plc takes long Sep 29, 2020
@friko16 friko16 changed the title GRANT 0.1 ETH(or BTC equivalent) - Writing to plc takes long GRANT 0.2 ETH(or BTC equivalent) - Writing to plc takes long Sep 29, 2020
@jouniaro
Copy link
Contributor

Unfortunately, the OPC Foundation doesn't have any support services available, in fact. But in this case, the problem is 100% on the server side - you cannot perform the write any faster from the client, if you need to write all those changes.

@friko16
Copy link
Author

friko16 commented Sep 29, 2020

@jouniaro thank you for reply. The team writing software for PLC is pointing that it's probably an issue on our side ( the client who is writing to plc ). Is there a way to check out some PLC settings, e.g. with write speed or something ? How can we determine where is the problem ? Maybe it depends on plc configuration ?

@jouniaro
Copy link
Contributor

You can use Wireshark to analyse the traffic and see how long it takes for the server to respond to your request. See https://www.prosysopc.com/blog/opc-ua-wireshark/ for details, for example.

@friko16
Copy link
Author

friko16 commented Sep 29, 2020

@jouniaro but I have measured it already inside my java app, by reading time right before and after writing the values. The PLC team still points to the java lib being the problem. Is measuring time by opc-ua-wireshark any better than my current approach with measuring time with java ?

@jouniaro
Copy link
Contributor

jouniaro commented Sep 29, 2020

Well, the Wireshark leaves your client side out of the question completely, so you can point out exactly how long it takes for the server to process the request.

@friko16
Copy link
Author

friko16 commented Sep 29, 2020

@jouniaro ohh thanks so much for pointing that out. I thought that maybe the problem is that I am sending those values in batch as list using the session.Write() method.
I thought if I write the whole structure as one request ( not one by one in list, with primitive values as in the example in topic), by implementing serializer and deserializer, it would help. So you're saying that's not the case ?

@jouniaro
Copy link
Contributor

Yes, I understood that you are making one Write call with several WriteValues in it. Then there is not much to optimise on your side.

@kevinherron
Copy link

@friko16 what PLC or server are you connecting to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants