this should be possible.
// This example shows how to write a value into a single item, specifying its requested data type.
using OpcLabs.BaseLib.ComInterop;
using OpcLabs.EasyOpc.DataAccess;
namespace DocExamples
{
namespace _EasyDAClient
{
partial class WriteItemValue
{
public static void RequestedDataType()
{
var client = new EasyDAClient();
client.WriteItemValue("", "OPCLabs.KitServer.2", "Simulation.Register_I4", 12345,
VarTypes.I4); // <-- the requested data type
}
}
}
}
// Shows how to write into multiple OPC items using a single method call, specifying their requested data types.
using System;
using System.Diagnostics;
using OpcLabs.BaseLib.ComInterop;
using OpcLabs.BaseLib.OperationModel;
using OpcLabs.EasyOpc.DataAccess;
using OpcLabs.EasyOpc.DataAccess.OperationModel;
namespace DocExamples
{
namespace _EasyDAClient
{
partial class WriteMultipleItemValues
{
public static void RequestedDataType()
{
var client = new EasyDAClient();
Console.WriteLine("Writing multiple item values...");
OperationResult[] resultArray = client.WriteMultipleItemValues(new[] {
new DAItemValueArguments("", "OPCLabs.KitServer.2", "Simulation.Register_I2", 12345)
{ ItemDescriptor = { RequestedDataType = VarTypes.I2}}, // <-- the requested data type
new DAItemValueArguments("", "OPCLabs.KitServer.2", "Simulation.Register_R4", 234.56)
{ ItemDescriptor = { RequestedDataType = VarTypes.R4}} // <-- the requested data type
});
for (int i = 0; i < resultArray.Length; i++)
{
Debug.Assert(resultArray[i] != null);
if (resultArray[i].Succeeded)
Console.WriteLine("Result {0}: success", i);
else
{
Debug.Assert(resultArray[i].Exception != null);
Console.WriteLine("Result {0}: {1}", i, resultArray[i].Exception.GetBaseException().Message);
}
}
Console.WriteLine("Reading multiple item values...");
ValueResult[] valueResultArray = client.ReadMultipleItemValues("OPCLabs.KitServer.2",
new DAItemDescriptor[] { "Simulation.Register_I2", "Simulation.Register_R4" });
for (int i = 0; i < valueResultArray.Length; i++)
{
Debug.Assert(valueResultArray[i] != null);
Console.WriteLine("valueResultArray[{0}]: {1}", i, valueResultArray[i]);
}
}
}
}
}