We read the data from PLC without using PSN then the data pass to the PSN. Yes we used C# implementation.
here is the code.
`private async void timer1_Tick(object sender, EventArgs e)
{
var startTime = DateTime.Now;
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
try
{
List<float> data = await ReadDataRegisters(txtDataRegAddress, txtDataRegRdVal);
await Task.Delay(14);
txt200.Text = data[0].ToString();
var updatetracker = tracker.WithPosition(Tuple.Create(data[0], 0f, 0f));
psnServer.UpdateTrackers(updatetracker);
}
catch (Exception ex)
{
// Handle any exceptions from the tasks.
timer1.Enabled = false;
timer1.Stop();
MessageBox.Show($"An error occurred during data retrieval: {ex.Message}", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally
{
stopwatch.Stop();
var endTime = DateTime.Now;
System.Diagnostics.Debug.WriteLine($"Start Time: {startTime.ToString("HH:mm:ss.fff")}, End Time: {endTime.ToString("HH:mm:ss.fff")}, Execution Time: {stopwatch.ElapsedMilliseconds} ms");
}
}`