- Posts: 19
- Thank you received: 1
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
OPCDA subscription Cast Error in Delphi
Thank you for your help.
I find the Issue, the TLBs were not overrided.
Now it works, I will check if i still face memory leak.
And i will open another tread in case.
Regards
Please Log in or Create an account to join the conversation.
Enclose the entirety of your code in [code] instead.
I will rethink my answer and reply later.
Please Log in or Create an account to join the conversation.
I suspect the TLBs was not overrided. let me do it again. I keep you informed.
Thank
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Arguments := ItemSubscriptionArguments;
I do not see how this can work.
Regards
Please Log in or Create an account to join the conversation.
My code is based on your exemple. the only diff is only that the number of requested Tag is a parameter and is include in a VCL app.
I create an Array : Arguments := VarArrayCreate([0, NbTag - 1], varVariant); to pass to SubscribeMultipleItems.
My code was working well on \OPC Labs QuickOPC 2020.2 except a memory leak.
So I upgrade on 2025 in order to see if the memory leak is fixed. but i no more able to run my appli an i face the issue i sent you as screen shot on previous mail.
To upgrade i installed the new 2025 release a regenerate TLB from SDK/Lib folder.
When I run the application I checked the DLL loaded by my app and now its the 2025 one.
Any idea of what else i can do?
Regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
procedure TForm3.btnAddOpcdaClick(Sender: TObject);
var
Arguments: OleVariant;
ItemSubscriptionArguments: _EasyDAItemSubscriptionArguments;
// ItemSubscriptionArguments: _DAReadItemArguments;
// ItemSubscriptionArguments: _DAItemGroupArguments;
HandleArray: OleVariant;
I: Integer;
begin
// exemple in kb.opclabs.com/Reference_counting_in_Delphi
//https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/User%27s%20Guide%20and%20Reference-OPC%20Studio/Examples%20-%20OPC%20Data%20Access%20-%20Subscribe%20to%20multiple%20items.html
// CoInitialize(nil);
ClientEventHandlers := TClientEventHandlers.Create;
ClientOPCDA := TEasyDAClient.Create(nil);
ClientOPCDA.OnItemChanged := ClientEventHandlers.OnDataChangeNotification;
Arguments := VarArrayCreate([0, NbTag - 1], varVariant);
//init tag requested
for I := 0 to NbTag - 1 do
begin
ItemSubscriptionArguments := CoEasyDAItemSubscriptionArguments.Create;
// ItemSubscriptionArguments := CoDAReadItemArguments.Create;
// ItemSubscriptionArguments := CoDAItemGroupArguments.Create;
//Nom du PC
ItemSubscriptionArguments.ServerDescriptor.MachineName := 'localhost';
//Nom du serveur OPC
ItemSubscriptionArguments.ServerDescriptor.ServerClass := 'Kepware.KEPServerEX.V6';
//Nom du tag OPC
ItemSubscriptionArguments.ItemDescriptor.ItemID := 'Simulation Examples.Functions.Ramp' + (I + 1).ToString;
//Delai de rafraichissement
ItemSubscriptionArguments.GroupParameters.RequestedUpdateRate := 1000;
Arguments := ItemSubscriptionArguments;
end;
ClientOPCDA.SubscribeMultipleItems(Arguments);
btnAddOpcda.Enabled := False;
btnRemOpcda.Enabled := True;
CodeSite.send('OPCDA Added');
end;
I face the following Error.
Impossible d'effectuer un cast d'un objet de type 'OpcLabs.EasyOPC.DataAccess.OperationModel.EasyDAItemSubscriptionArguments en type OpcLabs.EasyOPC.DataAccess.OperationModel.DaReadItemArguments.
Is _EasyDAItemSubscriptionArguments the right type to use for the array to pass to SubscribeMultipleItems?
Regards
Please Log in or Create an account to join the conversation.