12:49, EEST
October 24, 2023
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
19:02, EEST
December 21, 2011
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.
12:15, EET
October 24, 2023
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
16:49, EET
December 21, 2011
18:01, EET
October 24, 2023
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.
10:40, EET
December 21, 2011
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:
TUaVariant Value = TUaVariant::Create(Struct);
It seems we haven’t really tested this with custom structures and assumed that if it compiles, it works…
11:38, EET
October 24, 2023
16:11, EET
December 21, 2011
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:
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)
17:55, EET
October 24, 2023
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?
9:09, EET
October 24, 2023
17:14, EET
December 21, 2011
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.
17:39, EET
December 21, 2011
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).
10:01, EET
October 24, 2023
13:27, EET
October 24, 2023
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
Most Users Ever Online: 1919
Currently Online:
33 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1