Register    Login
 
Professional OPC Development Tools
And Services
 
 
SupportOnline Forums
 
Links: Related Pages
 
Links: Related Services
 
Links: Related Support
 
Links: Related Resources
 
Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see link in upper right corner) in order to Post questions. You do not have to be a licensed user.

OPC Labs team is actively monitoring the forums, and provides answers as soon as possible. For your convenience, we have also assembled a Frequently Asked Questions page.

Please do not use the Contact page for technical support.

HINT: You may use the Search feature (magnifier icon below) in the forums to locate the information you need. You can also search our entire Web site (the search box in the upper right corner of every page).

 
 
SupportSupportDiscussions (re...Discussions (re...QuickOPC-ClassicQuickOPC-ClassicQuickOPC.NET  QuickOPC.NET How to use WriteMultipleItems methodHow to use WriteMultipleItems method
Previous Previous
 
Next Next
New Post
 9/23/2010 1:01 AM
 

From: ...
Sent: Thu 9/23/2010 2:41 AM
To: Zbynek Zahradnik
Subject: WriteMultipleItems

[...] . I am trying to use the WriteMultipleItems method but I keep getting an error, something like "OPC server doesn't support timestamp and/or state"...or somthing like that. I can't figure out how to populate the array for the write. Can you tell me what I am doing wrong? Here is the code snippet after trying several variations;

Dim m_asTagsToWrite(5) As DAItemVtqArguments
Dim MsgID As String = fnConvertMessagetoID(tmpMsg.Command)

m_asTagsToWrite(0) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_MESSAGE, New DAVtq(MsgID), New Object()) ', Nothing, Nothing) ', Now, New DAQuality())

m_asTagsToWrite(1) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_ADAM, New DAVtq(tmpMsg.Params.ADAMID), New Object()) ', Now, New DAQuality())

m_asTagsToWrite(2) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_DEST, New DAVtq(tmpMsg.Params.DestinationID), New Object()) ', Now, New DAQuality())

m_asTagsToWrite(3) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_NEST, New DAVtq(tmpMsg.Params.NestID), New Object()) ', Now, New DAQuality())

m_asTagsToWrite(4) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_PART, New DAVtq(tmpMsg.Params.PartID), New Object()) ', Now, New DAQuality())

m_asTagsToWrite(5) = New DAItemVtqArguments(se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_MSG_READY, New DAVtq("True"), New Object()) ', Now, New DAQuality())

Dim opResults() As OperationResult = m_OPC.WriteMultipleItems(m_asTagsToWrite)

I hope you can understand this code enough to figure this out because I've tried everything I can and can't figure it out.

Thank you. Submitted By: I.

New Post
 9/23/2010 1:24 AM
 

I think you may actually want to use WriteMultipleItemValues method. Writing VTQ (Value/Timestamp/Quality) is a feature introduced in OPC-DA 3.0, and not many servers support it (this is fine - it only has its merits for certain cases anyway). So, the error you are getting may be a correct reaction from the OPC server, to a request that it cannot fulfill. I base this conclusion also on the fact that you do not seem to pass anything really "useful" as Timestamp or Quality.

An example for WriteMultipleItemValues can be found in this thread: http://www.opclabs.com/Support/Online....

Note that there used to be a bug in this method, so make sure you grab the recent download from this site, or at least verify that you have at least 5.00.1321.1.

New Post
 9/23/2010 6:13 AM
 

From: i.
Sent: Thu 9/23/2010 2:54 PM
To: Zbynek Zahradnik
Subject: RE: WriteMultipleItems

Zbynek,

Thank you fo rthe response. [...]

As a follow up to my post, I tried downloading the newest install for
QuickOPC.NET and the WriteMultipleItems did not generate an error but
it also did not work. Instead I made 6 individual WriteItemValues
calls instead which did work. So for now I am leaving it this way but
I would prefer to use the WriteMultipleItems call.

Thanks.


I.

New Post
 9/23/2010 6:17 AM
 

The method that complements WriteItemValue but works with multiple items is named WriteMultipleItemValues, not WriteMultipleItems. Maybe that's why it does not work. If you are using the proper one, WriteMultipleItemValues, and it still does not work, can you please post your code here for review.

New Post
 9/26/2010 8:28 AM
 
 Modified By IF  on 9/26/2010 5:29:31 PM
Here's the code. As I said previously there are no errors but data didn't show up on PLC either.


Dim m_asTagsToWrite(5) As DAItemValueArguments

m_asTagsToWrite(0) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_MESSAGE, MsgID)

m_asTagsToWrite(1) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_ADAM, tmpMsg.Params.ADAMID)

m_asTagsToWrite(2) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_DEST, tmpMsg.Params.DestinationID)

m_asTagsToWrite(3) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_NEST, tmpMsg.Params.NestID)

m_asTagsToWrite(4) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_PARAM_PART, tmpMsg.Params.PartID)

m_asTagsToWrite(5) = New DAItemValueArguments("", se.ServerClass, "Channel1.ADAM_GE.API." & TAG_IN_MSG_READY, "True")

Dim opResults() As OperationResult = m_OPC.WriteMultipleItemValues(m_asTagsToWrite)


So now I am sending each tag separately using m_OPC.WriteItemValue which does work but I'd prefer to do the multiple writes.
Previous Previous
 
Next Next
SupportSupportDiscussions (re...Discussions (re...QuickOPC-ClassicQuickOPC-ClassicQuickOPC.NET  QuickOPC.NET How to use WriteMultipleItems methodHow to use WriteMultipleItems method

 
 
 
 
 

 
 
 
 
Home|Services|Products|Purchase|Downloads|Support|Resources|Company|Contact
Copyright 2007-2012 by OPC Labs Terms Of Use Privacy Statement May 20, 2012