Recent

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

denny.chou

  • New Member
  • *
  • Posts: 11
Re: OPC client with Lazarus
« Reply #60 on: November 24, 2021, 04:17:58 am »

Normally not, but there are OPC-UA to OPC-DA gateways which allow that.

For direct OPC-DA access you can use something like this: https://github.com/seryal/OPCComponent

Thank you for your valuable response

denny.chou

  • New Member
  • *
  • Posts: 11
Re: OPC client with Lazarus
« Reply #61 on: November 24, 2021, 06:57:33 am »
"For direct OPC-DA access you can use something like this: https://github.com/seryal/OPCComponent"

What should I do if such an error message appears when installing this component? thanks!

OPCtypes.pas(37,69) Error: Data element too large

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #62 on: November 24, 2021, 09:14:46 am »
What should I do if such an error message appears when installing this component?
Contact author or open a github issue? I haven't used that coponent for a while, so maybe trying older Lazarus like 2.0.x might be worth trying.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

denny.chou

  • New Member
  • *
  • Posts: 11
Re: OPC client with Lazarus
« Reply #63 on: November 26, 2021, 04:18:40 am »
Contact author or open a github issue? I haven't used that coponent for a while, so maybe trying older Lazarus like 2.0.x might be worth trying.

Thank you very much for your suggestion. The author has assisted with this issue.

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: OPC client with Lazarus
« Reply #64 on: July 06, 2022, 12:36:12 pm »
Hello,
I just downloaded the free pascal wrapper from https://github.com/fluisgirardi/fpopen62541 but if I run the test application, when I try to add the variable, it fails with error BADNODEATTRIBUTESINVALID.
I am running free pascal/lazarus under linux and compiled open62541 under linux from sources.


I use open62541 version 1.2.3, maybe is no longer supported?

What version of open62541 has to be used to make sure it works?
« Last Edit: July 06, 2022, 01:41:30 pm by tt »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #65 on: July 23, 2022, 01:29:48 pm »
According to sources on https://github.com/fluisgirardi/fpopen62541 the version there should be compatible with open62541 version 1.2
(originial test application was developed and tested against version 1.1. Header files for version 1.1 you can find in this discussion earlier if you want test them)

yus

  • Jr. Member
  • **
  • Posts: 57
Re: OPC client with Lazarus
« Reply #66 on: July 26, 2022, 08:02:08 pm »

ruedi

  • Newbie
  • Posts: 1
Re: OPC client with Lazarus
« Reply #67 on: August 02, 2022, 02:35:32 pm »
Hallo,
It is possible to insert several monitored items in one subscription.
I would like to subscribe to several variables.

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: OPC client with Lazarus
« Reply #68 on: August 25, 2022, 10:13:51 am »
Hello everybody,
I tried running the TestOpcUa demo bundled with the free pascal open62541 wrapper.

I use library version 1.2.3 located in same dir as application.

When I try starting the server with the <start> button I get this:

user@debian:~/Documents/dev/3rd-party/fpopen62541-main$ LD_LIBRARY_PATH=. ./TestOpcUa

[...]
[2022-08-25 10:11:59.161 (UTC+0200)] warn/server        AccessControl: Unconfigured AccessControl. Users have all permissions.
[2022-08-25 10:11:59.161 (UTC+0200)] info/server        AccessControl: Anonymous login is enabled
[2022-08-25 10:11:59.161 (UTC+0200)] warn/server        Username/Password configured, but no encrypting SecurityPolicy. This can leak credentials on the network.
[2022-08-25 10:11:59.161 (UTC+0200)] warn/userland      AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2022-08-25 10:11:59.161 (UTC+0200)] info/network       TCP network layer listening on opc.tcp://debian:4840/
[2022-08-25 10:11:59.212 (UTC+0200)] info/network       Shutting down the TCP network layer


Last line in log is the problem. It seems that server is started and immedialy stopped, as if the "running" variable passed to control server execution is not read correclty, despite in TestOpcUa is set correctly before passing to run method.

I tried to create another C program to call the library directly and once started it does not show the above red line:

user@debian:~/dev/open62541-v1.2.3/build/bin/custom$ LD_LIBRARY_PATH=. ./custom-OpcServer

[...]
[2022-08-25 10:09:36.109 (UTC+0200)] warn/server   AccessControl: Unconfigured AccessControl. Users have all permissions.
[2022-08-25 10:09:36.109 (UTC+0200)] info/server   AccessControl: Anonymous login is enabled
[2022-08-25 10:09:36.109 (UTC+0200)] warn/server   Username/Password configured, but no encrypting SecurityPolicy. This can leak credentials on the network.
[2022-08-25 10:09:36.109 (UTC+0200)] warn/userland   AcceptAll Certificate Verification. Any remote certificate will be accepted.
[2022-08-25 10:09:36.109 (UTC+0200)] info/network   TCP network layer listening on opc.tcp://debian:4840/


Any ideas?
Thank you

« Last Edit: August 25, 2022, 10:27:33 am by tt »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: OPC client with Lazarus
« Reply #69 on: August 25, 2022, 10:33:44 am »
Hi again,
I did same test with library version 1.1.0 and seems to work correctly, probably something was changed in open62541 and wrapper does not support newer versions.

Any ideas?
« Last Edit: August 25, 2022, 10:55:53 am by tt »
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

LacaK

  • Hero Member
  • *****
  • Posts: 691
Re: OPC client with Lazarus
« Reply #70 on: August 26, 2022, 01:58:51 pm »
I did same test with library version 1.1.0 and seems to work correctly, probably something was changed in open62541 and wrapper does not support newer versions.
Try report it on https://github.com/fluisgirardi/fpopen62541 ?

Чебурашка

  • Hero Member
  • *****
  • Posts: 568
  • СЛАВА УКРАЇНІ! / Slava Ukraïni!
Re: OPC client with Lazarus
« Reply #71 on: August 26, 2022, 02:20:01 pm »
I did same test with library version 1.1.0 and seems to work correctly, probably something was changed in open62541 and wrapper does not support newer versions.
Try report it on https://github.com/fluisgirardi/fpopen62541 ?

Done.
Thank you.
FPC 3.2.0/Lazarus 2.0.10+dfsg-4+b2 on Debian 11.5
FPC 3.2.2/Lazarus 2.2.0 on Windows 10 Pro 21H2

TheMouseAUS

  • New Member
  • *
  • Posts: 47
Re: OPC client with Lazarus
« Reply #72 on: April 22, 2023, 02:42:26 am »
I have decided to attempt to switch from OPC-DA to OPC-UA and use Ignition as the Allen Bradley OPC server under Linux (trying to get away from windows as I really dont think the current windows versions ie 10 and 11 are any good for industrail use).

I am running Fedora and have open62541 (ver 1.3.4)  installed and using the wrapper discussed here but I cannot get a connection all I get is error 80AD0000 which I believe is a disconnect by the sever. Does anyone have a simple client example I can follow so I can see what I am missing? I am guessing its on the client config but not sure what. I have security disabled in the server and using a Quick OPC client I can see the tags so that side is working.

This is what I am doing in my connect procedure ;-

client := UA_Client_new();
conf := UA_Client_getConfig(client);
UA_ClientConfig_setDefault(conf);
res := UA_Client_connect(client, 'opc.tcp://localhost:62541');

Edit :- i changed the server url to something that does not exist just to see if the error message changes but it remains the same, so I can only assume that its not even trying to connect maybe its an version issue?

« Last Edit: April 22, 2023, 05:23:12 am by TheMouseAUS »

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: OPC client with Lazarus
« Reply #73 on: April 22, 2023, 01:47:23 pm »
Basic troubleshooting would be these 2 steps:

1. Check if you can connect from open62541 local pascal client to open62541 local server. If that is not working then try original C based client. With this you confirm that your open62541 is locally working.
2. Use some external OPC UA client (for example Matrikon on Windows) and try to connect to your Ignition OPC UA server. If that does not work try to connect to open62541 OPC UA server. If that also does not work then look if Ignition has installed some internal OPC UA client and try that to connect with local Ignition OPC UA server. If that works, then you probably have to change some Ignition OPC UA server security settings. With this you confirm that Ignition OPC UA server is working and if it's access is protected.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

TheMouseAUS

  • New Member
  • *
  • Posts: 47
Re: OPC client with Lazarus
« Reply #74 on: April 22, 2023, 02:54:44 pm »
Yes that was my first troubleshooting test, I used a OPC test client based on python and it worked perfectly so I know Ignition is configured and operating correctly.

I tried to compile the test example that is shipped with fpopen62541 but it does not compile, there is an issue with an identifier 'memberTypeIndex' so I cannot run the TestOPCUa to test it. Do you have a pascal client I can use to test with so I can confirm open62541 is working

 

TinyPortal © 2005-2018