Recent

Author Topic: OPC client with Lazarus  (Read 59078 times)

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #30 on: June 22, 2020, 03:02:21 pm »
Updated headers and Windows DLLs to version 1.1 (open62541 released 06/2020)
  (https://github.com/open62541/open62541/releases/tag/v1.1)
at http://lacak.users.sourceforge.net/#open62541
« Last Edit: June 22, 2020, 03:12:57 pm by LacaK »

Riodev

  • Newbie
  • Posts: 2
Re: OPC client with Lazarus
« Reply #31 on: June 22, 2020, 06:13:14 pm »
Updated headers and Windows DLLs to version 1.1 (open62541 released 06/2020)
  (https://github.com/open62541/open62541/releases/tag/v1.1)
at http://lacak.users.sourceforge.net/#open62541


Access violation error

sorry sir UA_ClientConfig_setDefaultEncryption function is a problem for me   
Not sure if I did something wrong or not?


avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #32 on: June 22, 2020, 07:14:04 pm »
Updated headers and Windows DLLs to version 1.1 (open62541 released 06/2020)
Thank you!

What happened to UA_ClientState in wrapper for v1.1?

Is there a chance for getting a server part wrapper sometime in the future?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #33 on: June 23, 2020, 07:14:40 am »
Access violation error
sorry sir UA_ClientConfig_setDefaultEncryption function is a problem for me   

function UA_ClientConfig_setDefaultEncryption() is not part of precompiled DLL, so when application links at runtime to this open62541.DLL entry point is not found, so is not assigned = nil. When you try call this function AV happens. It is expected.
(You may test before call: if Assigned(UA_ClientConfig_setDefaultEncryption) then UA_ClientConfig_setDefaultEncryption(...))

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #34 on: June 23, 2020, 07:22:46 am »
What happened to UA_ClientState in wrapper for v1.1?
As far as I can cee from sources, this enumeration was removed and also function UA_Client_getState was changed.
(it is backward incompatible change)

Is there a chance for getting a server part wrapper sometime in the future?
I do not need server part in my project, so I do not plan do it. If you need some very limited subset of functions I can add them ...

Currently unresolved problems are:
- Win64 client has problem while UA_Client_delete() is called
- UA_Client_connectUsername() does not work for me (may be that my testing OPC UA Server does not support it, or there is any problem)
Has somebody any feedback on these two problems?

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #35 on: June 23, 2020, 11:55:46 am »
What happened to UA_ClientState in wrapper for v1.1?
As far as I can cee from sources, this enumeration was removed and also function UA_Client_getState was changed.
(it is backward incompatible change)
Strange, since I can still find it in official v1.1 open62541.h at https://github.com/open62541/open62541/releases/tag/v1.1.

Is there a chance for getting a server part wrapper sometime in the future?
I do not need server part in my project, so I do not plan do it. If you need some very limited subset of functions I can add them ...
That would be fantastic! I looked at server examples and the one with the smallest number of methods and structures (but still having at least one tag) seams to be server.cpp. Whatever you can implement from there would be a jump start for me to try.

Currently unresolved problems are:
- Win64 client has problem while UA_Client_delete() is called
- UA_Client_connectUsername() does not work for me (may be that my testing OPC UA Server does not support it, or there is any problem)
Has somebody any feedback on these two problems?
My plan is to translate some original examples and do some testing needed for my use case, but because of the deadlines I currently have, it does not seam to be possible before the end of August (or even beginning of September since new ct4laz will be needed for Laz 2.0.10 with FPC 3.2.0).
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #36 on: June 23, 2020, 02:26:40 pm »
What happened to UA_ClientState in wrapper for v1.1?
As far as I can cee from sources, this enumeration was removed and also function UA_Client_getState was changed.
(it is backward incompatible change)
Strange, since I can still find it in official v1.1 open62541.h at https://github.com/open62541/open62541/releases/tag/v1.1.
Yes it is strange in https://github.com/open62541/open62541/releases/download/v1.1/open62541.h there is present, but in headers included in https://github.com/open62541/open62541/releases/download/v1.1/open62541-win32.zip is removed.
See commit https://github.com/open62541/open62541/commit/97ce87470c93423f7adf6b1d8fd87cd8d3252fb3#diff-44b00b50652139af475d451264d49ffd which removes it.

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #37 on: June 23, 2020, 03:43:49 pm »
Yes it is strange in https://github.com/open62541/open62541/releases/download/v1.1/open62541.h there is present, but in headers included in https://github.com/open62541/open62541/releases/download/v1.1/open62541-win32.zip is removed.
It seams that UA_ClientState is really gone. New v1.1 of client_async.c and client_subscription_loop.c no longer reference it.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #38 on: June 29, 2020, 11:32:02 am »
Is there a chance for getting a server part wrapper sometime in the future?
I do not need server part in my project, so I do not plan do it. If you need some very limited subset of functions I can add them ...
That would be fantastic! I looked at server examples and the one with the smallest number of methods and structures (but still having at least one tag) seams to be server.cpp. Whatever you can implement from there would be a jump start for me to try.

I have added some server side functions to:
- run OPC UA server
- add variable
- write value to variable
+ updated demo program, which now can work as client and also as server
(it is minimalistic but can be used)

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #39 on: July 01, 2020, 09:13:07 pm »
I have added some server side functions
THANK YOU !!!  :D 8-) :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC UA client with Lazarus (open62541)
« Reply #40 on: December 04, 2020, 07:02:15 pm »
I have added some other functions to header file and extended demo application
http://lacak.users.sourceforge.net/freepascal.html#open62541

Lazarus™

  • Newbie
  • Posts: 1
Re: OPC client with Lazarus
« Reply #41 on: July 10, 2021, 03:01:59 pm »
Dear Lacak,
please can you generate a package with all dll's (actual Open62541 - Version 1.2.2), Open62541.pas and Server- Client Sample ?

if you wan't you can also send me an email...

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #42 on: July 12, 2021, 01:55:49 pm »
Problem is that, open62541 project https://github.com/open62541/open62541/releases
no more releases pre-compiled DLLs for Windows. So only way is compile from source codes ... currently I do not have free time to play with this.
If someone provides these DLLs then I can update open62541.pas and demo application of course ...

denny.chou

  • New Member
  • *
  • Posts: 11
Re: OPC client with Lazarus
« Reply #43 on: October 12, 2021, 05:26:21 am »
Excuse me, I have a problem in use...

When UA_Client_Service_read reads multiple nodes, the result will be UA_STATUSCODE_GOOD, but only the first node has data and the others are empty

Why is this happening?

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #44 on: October 12, 2021, 07:16:43 am »
Hard to say without deeper look at source code ... can you provide source code which reads values?

 

TinyPortal © 2005-2018