Professional OPC
Development Tools

logos

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.

WriteMultipleItemValues requestedDataType

More
24 Nov 2020 08:34 #9222 by support
Hello,

what precisely happens behind the scenes depends on many factors, including the versions of OPC specifications supported by the target server. QuickOPC tries to hide the details from you. The general rules you should follow are:

- Do not specify the RequestedDataType unless you find it necessary. Each item has its canonical data type specified by the server, and that is what QuickOPC will use if you do not specify RequestedDataType - and that is what also should normally work.

- QuickOPC will (try to) convert any value you pass in to the (requested or canonical) data type of the item (or the server will do it - this again is somewhat complex matter). If you know the precise type, it is recommended to pass in values of that type, but again, it is not normally necessary.

- No matter what you do in terms of the type specified and type passed in, the differences in speed should be negligible.

Best regards
The following user(s) said Thank You: PhilippeG

Please Log in or Create an account to join the conversation.

More
23 Nov 2020 13:58 - 23 Nov 2020 14:04 #9219 by PhilippeG
Hi OpcLabs

Can you tell me the efficient (fastest) method to write MultiItemValues
  • use DAItemValueArguments with passing an variant object value :
    object oTestVal =1;
    oEasyDAClient.WriteMultipleItemValues(new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments[]
    {
    new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments("OPC server Test",new DAItemDescriptor("Demo.test","/Demo.test"),oTestVal),
    });
  • use DAItemValueArguments with passing a type object value :
    int iTestVal = 1;
    oEasyDAClient.WriteMultipleItemValues(new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments[]
    {
    new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments("OPC server Test",new DAItemDescriptor("Demo.test","/Demo.test"),iTestVal),
    });
  • use DAItemValueArguments with passing requestDataType and a type object value:
    int iTestVal = 1;
    oEasyDAClient.WriteMultipleItemValues(new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments[]
    {
    new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments("OPC server Test",new DAItemDescriptor("Demo.test","/Demo.test",
    requestedDataType: OpcLabs.BaseLib.ComInterop.VarTypes.I4),iTestVal),
    }
  • use DAItemValueArguments with passing a string value:
    string sTestVal = "1";
    oEasyDAClient.WriteMultipleItemValues(new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments[]
    {
    new OpcLabs.EasyOpc.DataAccess.OperationModel.DAItemValueArguments("OPC server Test",new DAItemDescriptor("Demo.test","/Demo.test"),
    sTestVal),
    }
Do i need to convert the value before passing it in parameters?

If I pass a string value, ty

Regards,
Last edit: 23 Nov 2020 14:04 by PhilippeG. Reason: add another method

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.054 seconds