Blow is the sample code I want o invoke command to meter how i can achieve,
0x01 is on and 0x02 is off like this
static void SendDlmsCommand(string ipAddress, int port, string logicalName, string command)
{
GXDLMSClient client = new GXDLMSClient();
client.IPAddress = ipAddress;
client.Port = port;
try
{
// Connect to the smart meter.
client.Open();
// Authenticate if needed.
// ...
// Select the desired object by logical name.
GXDLMSObject meter = client.Select(logicalName);
// Invoke the command on the meter.
GXReplyData reply = client.Action(meter, command);
// Handle the response from the meter.
// ...
Console.WriteLine("Command sent successfully.");
}
catch (Exception ex)
{
Console.WriteLine("An error occurred: " + ex.Message);
}
finally
{
client.Close();
}
}
Hi, That depends on the…
Hi,
That depends on the object that you want to invoke, but you can use Method.
Something like this:
GXReplyData reply = client.Method(meter, 1, null);
BR,
Mikko
Which method I want to call…
Which method I want to call exactly can you please provide a sample code or class.
Hi, That depends on the…
Hi,
That depends on the object that you want to invoke. WHat object you want to use?
BR,
Mikko
see 0x01 is On command or…
see 0x01 is On command or 0x02 is off Command, I want to send to client how I can do this
Hi, You don't send just on…
Hi,
You don't send just on or off command. You need to define what COSEM object you want to use. For that reason, you need to know the logical name and object type.
BR,
Mikko
could you please provide a…
could you please provide a sample code for execute off or on command it would be save my time.
Hi, I assume that you want…
Hi,
I assume that you want to use Disconnect control to open and close the valve.
GXDLMSDisconnectControl dc = new GXDLMSDisconnectControl();
ReadDataBlock(dc.RemoteDisconnect(client));
ReadDataBlock(dc.RemoteReconnect(client));
BR,
Mikko