PLC Tag Read Pass through without Tag in Kepware Database - C#, VB, or Python
Trying to pull data from an AB Plc using Kepware without having a TAG in the Kepware Database. Looking for a way to just pass-through the READ request. I know the below code snippet works just fine, however, the tag "YourPLCTag" needs to be in Kepware DB. I just want to access "YourPLCTag" without the tag being in Kepware.
var serverUrl = new Uri("opc.tcp://localhost:4840");
// Connect to the OPC server
using (var client = new OpcClient(serverUrl))
{
client.Connect();
// Read PLC value
var nodeId = "ns=2;s=YourPLCTag"; // Replace with your PLC tag
var value = client.ReadNode(nodeId);
// Do something with the value...
client.Disconnect();
}

