- Posts: 40
- 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.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Reading, Writing, Subscriptions, Property Access
- Subscribing to a non-existent item
Subscribing to a non-existent item
pulling of a fake item can bypass EventArgs.Succeeded testing.
The freezing is is in a DLL (another app) when used with Matrikon
with a fake item that bypasses EventArgs.Succeeded.
Thank you for your valuable updated note on 08 Jul 2021 07:54.
The returned empty string(?) causes the freezing in my DLL.
I tried testing If EventArgs.VTQ.Value <> '' Then ...
I tried testing If EventArgs.VTQ.Value <> null Then ...
Both if them also fail.
Maybe any kind of touching EventArgs.VTQ.Value will cause freezing.
Do you have any ideas how to grab the empty value?
Please Log in or Create an account to join the conversation.
I am not sure if you have sent me the right code.
When I run your program, I get this form:
with the values in the uppermost edit box quickly changing.
This, in my understanding, *is* the expected behavior with the code in the program, which looks like this (shortened):
procedure TForm1.FormCreate(Sender: TObject);
begin
OPCDAClient := CoEasyDAClient.Create ;
OPCDAClient.PullItemChangedQueueCapacity := 1000 ;
OPCDAClient.SubscribeItem('', 'Matrikon.OPC.Simulation.1', 'Random.UInt1', 50) ;
OPCDAClient.SubscribeItem('', 'Matrikon.OPC.Simulation.1', 'SomeUnknownItem', 50) ;
OPCDAClient.SubscribeItem('', 'Matrikon.OPC.Simulation.1', 'Bucket Brigade.UIntqa', 50) ;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
Var i : Integer ;
EventArgs: _EasyDAItemChangedEventArgs ;
Begin
Repeat
EventArgs := OPCDAClient.PullItemChanged(5) ;
If EventArgs <> nil Then
If EventArgs.Succeeded Then
If EventArgs.VTQ.HasValue and EventArgs.VTQ.Quality.IsGood Then
Begin
If EventArgs.Arguments.ItemDescriptor.ItemId = 'Random.UInt1' Then
Edit1.text := EventArgs.VTQ.Value ;
If EventArgs.Arguments.ItemDescriptor.ItemId = 'SomeUnknownItem' Then
Edit2.text := 'Edit2 text changed unexpectedly' ;
If EventArgs.Arguments.ItemDescriptor.ItemId = 'Bucket Brigade.UIntqa' Then
Edit3.text := 'Edit3 text changed unexpectedly' ;
End;
Until EventArgs = nil ;
End;
Edit1 is changing because the server sends no errors, good quality Byte-typed updates for the 'Random.UInt1' item.
Edit2 keeps its original text because the server returns an error for this item, EventArgs.Succeeded is false, and the "if" statements do not thus make any update.
Edit3 changes to 'Edit3 text changed unexpectedly', because (I have mentioned in my previous post), the server sends a string value for this item, although it is not configured.
I do not see any signs of the problem you reported, i.e. that the program blocks somewhere, or stops. But, this is not the same code you had included with that report.
Regards
Attachments:
Please Log in or Create an account to join the conversation.
Apparently (and in line with what you yourself has observed), an error is returned for *some* unknown items ("SomeUnknownItem"), but no error and a bad quality for others ("Bucket Brigade.UIntqa"). This explains why in your test, the flow proceeded past the Exception/Succeeded test with the "Bucket Brigade.UIntqa". But it does not explain the behavior after that. I will continue the investigation.
As a side note, I am seeing some weird non-standard behaviors in items I have looked at (under "Bucket Brigade"). The behavior might be good for testing the code resiliency, but probably not so good for testing how things would *normally* work, with real OPC servers and items.
Best regards
*EDITED*: Later on, the same item "Bucket Brigade.UIntqa" now returns a "Good" quality with an (empty?) string value. Go figure.
Attachments:
Please Log in or Create an account to join the conversation.
Attachments:
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
By the way, I got closer to the issue.
When I subscribe to the fake item "SomeUnknownItem" --- it does NOT fail.
When I subscribe to the fake item "Bucket Brigade.UIntqa" --- it DOES fail.
"Bucket Brigade.UIntqa" is very similar to the existing items
"Bucket Brigade.UInt1"
"Bucket Brigade.UInt2"
"Bucket Brigade.UInt4"
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I use it with default settings, with the predefined default tags.
Please Log in or Create an account to join the conversation.
Best regards
Please Log in or Create an account to join the conversation.
Haman mind often fails with distinguishing between slightly modified repeated patterns.
But believe in me, I truly focused on your event handling code, and, since I do not write
a console application, I tried to adapt it as much as I can.
"If the item was truly non-existent, I would expect your code to only show the message "1 ...", but not 2 to 6."
Seems you are right. I tested it with your simulation server, and the fake item did not cause any problems.
I made the prior test with Matrikon OPC Simulation server. This test passes 1 to 5 even at a non-existent-item.
Very strange...
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Reading, Writing, Subscriptions, Property Access
- Subscribing to a non-existent item