Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Application with an OPC UA client - connection to different PLC (Siemens, Rockwell, Phoenix)
October 24, 2023
12:49, EEST
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Hello,

We are evaluating the TUAClient component for use in Embarcadero RAD Studio XE7.

The component should be used to standardize the communication between our Application and different type of PLC.
The Application is an automation software used in food industry.

Using the example programs provided with the evaluation version, I was able to easily communicate with the three plc in Topic.
I ran some further tests to see if this solutions fits our needs and I came across a question.

We have a lot of data to read from the PLC, something like (as an example for a Siemens PLC) 5000 WORD organized in free data and structures.
What we do now, in the three different drivers, is to read the data in large blocks and then convert them according to the specifications of the plc.
This is to reduce the reading time of all data.

Is it possible to do the same thing using the TUAClient component? I did some tests with a simple structure and seems to work quite well but what about having a structure with this much data? is there a limit to the amount of data that can be be read at one time?
Or is there a different approach to be developed?
The same question is valid also in WRITE operations.
I searched the forum for some already answered answers but I found few things.

Thank you in advance for your answer
Best Regards
Cristina

October 24, 2023
19:02, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Cristina, I am not sure if I follow completely, but I would say that if it seems to work, then it probably does work 🙂

The amount of data is not necessarily a problem, if you don’t read/write it too often. Are you just reading or using subscriptions? In both models you can define how often you update the data. In read/write you define the interval yourself; in subscriptions, you can define the PublishingInterval long enough.

November 13, 2023
12:15, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Hi Journi

Thanks for your quick response and sorry for my late reply.

Following your response, I continued with the tests and actually it seems not to be a problem the amount of data.
(for the actual test, I’m using a siemens plc; next I will try with a Rockwell that has not the server included but must pass through a further Server driver. For now, I’m not using subscriptions but only reading operations).
I have another question (if I may): In the test example included with the component, it seems possible to write structures, the same way as I read structures of data.
The function to be used is “WriteDynamicStructureValue” (the same example can be find in the online documentation) but when I try to use the same code I get an error from the linker that can not resolve the creation of a dynamic structure:

[ilink32 Error] Error: Unresolved external ‘Prosysopc::Uabase::TUaVariant __fastcall Prosysopc::Uabase::TUaVariant::Create<System::DelphiInterface >(System::DelphiInterface)’ referenced from…….etc

Is this the trial version of the component? or is it something that can’t be done?
(I searched online for this answer but I could not find what I was looking for)

Thanks again for your reply
Greetings
Cristina

November 13, 2023
16:49, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Cristina,

Hmm, a bit odd. I tested with XE7 in my development environment and could not reproduce.

Can you compile the LessonUa1_UaClient_Cpp project that is found from the Tutorial projects?

November 13, 2023
18:01, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Hi Jouni

Actually, I used the LessonUa1_UaClient_BCB.cbproj (I don’t know if it’s the same project you are referring… but it’s one of your examples)

The project is fully compilable and works perfectly…. untill I call the function WriteDynamicStructureValue(…) … in that case I get the linker error.

November 14, 2023
10:40, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

OK, I thought it did not even compile.

The template functions are a bit problematic with C++, since the compiler only compiles the versions in that are used in active code.

But, there is another way to create the variants, so you could try this:

_di_IUaStructure Struct = DynamicStructureBuilder->Build();
TUaVariant Value = TUaVariant::Create(Struct);

It seems we haven’t really tested this with custom structures and assumed that if it compiles, it works…

November 14, 2023
11:38, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Well, easier than expected Laugh
Maybe I should have thought about it Laugh

Thanks very much for the support!

November 14, 2023
16:11, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Super. Well, I I don’t know if it was so obvious, but we should fix the examples to use this version, too.

Or another option – which you might also try – would be to comment the following line (720?) out of ProsysOPC.UaBase.hpp in the include directory:

// template<typename T> static TUaVariant __fastcall Create(T Value)/* overload */;

If that works, we should actually clear it out from the file by default, since it won’t work anyway… (the Delphi version works differently and does not have this problem)

November 14, 2023
17:55, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

I hope it’s the correct line (in my file 684…. but it’s the only one corresponding to your code)

By doing it… I get now a compiler error in calling the Build inside the Create:

[bcc32 Error] LessonUa1CMainForms.cpp(633): E2015 Ambiguity between ‘_fastcall Prosysopc::Uabase::TUaVariant::Create(bool) at C:\Program Files (x86)\ProsysOPC\Sentrol752DCXE7Eval\include\ProsysOPC.UaBase.hpp:658’ and ‘_fastcall Prosysopc::Uabase::TUaVariant::Create(System::DelphiInterface) at C:\Program Files (x86)\ProsysOPC\Sentrol752DCXE7Eval\include\ProsysOPC.UaBase.hpp:670’
Full parser context
LessonUa1CMainForms.cpp(625): parsing: void TLessonUa1CMainForm::WriteDynamicStructureValue(Prosysopc::Uaclient::TUaClient *,Prosysopc::Uabase::TUaNodeId)

Is this helping? or am I doing the wrongmodification?

November 15, 2023
9:09, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Ouch, sorry, I understand…. I’m testing version 7.5.2… I was following the tests already started by my team… you are definitely referring to version 7.6.0…
I hope the result is useful anyway..

November 15, 2023
17:14, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

OK, thanks. Yeah, I was not able to test myself earlier, but that’s what the compiler seems to complain about, so this won’t help. On the other hand, it’s probably better to give a compilation error instead of a runtime error, so I will try to get the template version removed from the headers anyway.

So, just resort to the earlier fix, in any case.

November 15, 2023
17:39, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

I have fixed this now to the Tutorial as well, and it will be in the respective Tutorial project in the next release (7.6.2, probably).

November 16, 2023
10:01, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Super! Thanks so much for the support, Jouni.

December 4, 2023
13:27, EET
Avatar
CristinaBenassi
Member
Members
Forum Posts: 8
Member Since:
October 24, 2023
sp_UserOfflineSmall Offline

Hi Jouni,
I’m sorry to bug you again but I can’t get out of a problem.

I’m trying to write a Structure following the examples in “9.1.1. Writing structure types”.
(Meanwhile I updated to ver 7.6.0)
I have performed several tests in which I always received an “Invalid Pointer Operation” exception in the “Client.WriteValue(VariableId, DynamicStructure)” function; I always thought it was a question of building my structure.

Then I tryed the simplest:

node = Client->NamespaceTable->ParseNodeId(“a struct node in the server”);
TUaDataValue DataValue = ThClient->ReadValue(node);
_di_IUaStructure S = DataValue.Value.AsStructure;
TUaVariant Value = TUaVariant::Create(S);
Client->WriteValue(node, Value);

Meaning: read the structure directly from the server and rewrite it immediately afterwards.
And I got the same error. Exception class EInvalidPointer with message “Invalid pointer operation.

Is this something I don’t understand and am doing wrong?

Thanks for your patience
Cristina

December 5, 2023
10:28, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Cristina,

I tried to recreate the issue with the Simulation Server, but I couldn’t get these errors. So, probably it depends on the exact structure type and value that you have there. I will contact you by email to dig a bit deeper in your exact situation.

BR, Jouni

December 7, 2023
10:45, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1010
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Turned out this issue is already fixed in the development version and will be available in the next release.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1