I have a CommanderForm which opens and closes TCP connection and can open JournalRecordForm which reads modbus page information via opened tcp connection. I want that JournalRecordForm tried read information after opening only once and only if tcp connection is up. If tcp connection is down then it do nothing. If I press UpdateJournalButton then JournalRecordForm must try receive data, but if some records already presented it must not double the similar ones.

Code:
using ModBusHelper;
using NModbus;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static ModBusHelper.ModBusProfile;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace Configurator
{
    public partial class JournalRecordForm : Form
    {
        ModBusCommands CommandsHelper = new ModBusCommands();
        ModBusFunctions ModbusFunctionsHelper = new ModBusFunctions();
        ModBusExporterLinker ExporterLinkerHelper = new ModBusExporterLinker();
        ModBusProfile ProfileHelper = new ModBusProfile();

        CommanderForm CommanderForm;

        DataTable JournalRecordsDataTable = new DataTable();
        DataTable JournalRecordDataTable = new DataTable();

        private Tuple<TcpClient, IModbusMaster> _connection;

        public JournalRecordForm(CommanderForm CommanderFormInstance, List<ModBusProfile.journal_record> Filtered_Journal_Records, Tuple<TcpClient, IModbusMaster> connection)
        {
            InitializeComponent();

            this.CommanderForm = CommanderFormInstance;
            this._connection = connection; // Initialize your connection

            JournalRecordDataTableInitialization();

            JournalRecordsDataTableInitialization(Filtered_Journal_Records);
            JournalRecordsDataGridView.SelectionChanged += JournalRecordsDataGridView_SelectionChanged;

            try
            {
                Database.Journal_Record = ProfileHelper.journal_record_Read(_connection.Item2);

                int RecordCounter = 0;
                foreach (ModBusProfile.journal_record record in Database.Journal_Record)
                {
                    if (record.hdr.rtype == 0)
                    {
                        continue;
                    }

                    else if (record.hdr.rtype == 1)
                    {
                        if (record.hdr.subtype == 0)
                        {
                            JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Отключение выключателя", UnixTimeStampToDateTime((record.hdr.stamp.slo + (record.hdr.stamp.ns * 0.000000001))) });
                            Database.Filtered_Journal_Records.Add(record);
                            RecordCounter++;
                            continue;
                        }

                        else if (record.hdr.subtype == 1)
                        {
                            JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Включение выключателя", UnixTimeStampToDateTime((record.hdr.stamp.slo + (record.hdr.stamp.ns * 0.000000001))) });
                            Database.Filtered_Journal_Records.Add(record);
                            RecordCounter++;
                            continue;
                        }
                    }

                    else if (record.hdr.rtype == 2)
                    {
                        JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Обнуление счетчика ресурса", UnixTimeStampToDateTime((record.hdr.stamp.slo + (record.hdr.stamp.ns * 0.000000001))) });
                        Database.Filtered_Journal_Records.Add(record);
                        RecordCounter++;
                        continue;
                    }
                }
            }
            catch (Exception modbusEx)
            {
                MessageBox.Show($"Ошибка получения записей журнала СКРВ: {modbusEx.Message}", "Ошибка ModBus соединения", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }

        public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)
        {
            // Unix timestamp is seconds past epoch
            DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
            dateTime = dateTime.AddSeconds(unixTimeStamp).ToLocalTime();
            return dateTime;
        }

        private void JournalRecordsDataTableInitialization(List<ModBusProfile.journal_record> Filtered_Journal_Records)
        {
            JournalRecordsDataTable.Columns.Add("Номер записи", typeof(int));
            JournalRecordsDataTable.Columns.Add("Событие", typeof(string));
            JournalRecordsDataTable.Columns.Add("Дата", typeof(DateTime));

            foreach (DataColumn Column in JournalRecordsDataTable.Columns)
            {
                Column.ReadOnly = true;
            }

            int RecordCounter = 0;
            foreach (ModBusProfile.journal_record record in Filtered_Journal_Records)
            {
                if (record.hdr.rtype == 0)
                {
                    continue;
                }

                else if (record.hdr.rtype == 1)
                {
                    if (record.hdr.subtype == 0)
                    {
                        JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Отключение выключателя", UnixTimeStampToDateTime(record.hdr.stamp.ns) });
                        RecordCounter++;
                        continue;
                    }

                    else if (record.hdr.subtype == 1)
                    {
                        JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Включение выключателя", UnixTimeStampToDateTime(record.hdr.stamp.ns) });
                        RecordCounter++;
                        continue;
                    }
                }

                else if (record.hdr.rtype == 2)
                {
                    JournalRecordsDataTable.Rows.Add(new object[] { RecordCounter, "Обнуление счетчика ресурса", UnixTimeStampToDateTime(record.hdr.stamp.ns) });
                    RecordCounter++;
                    continue;
                }
            }

            JournalRecordsDataGridView.DataSource = JournalRecordsDataTable;
        }

        private void JournalRecordDataTableInitialization()
        {
            List<ModBusProfile.journal_record> journal_record = ExporterLinkerHelper.journal_record_Default;

            JournalRecordDataTable.Columns.Add("Канал", typeof(int));
            JournalRecordDataTable.Columns.Add("Накопленное значение расхода ресурса (%)", typeof(float));
            JournalRecordDataTable.Columns.Add("Количество отключений", typeof(ushort));
            JournalRecordDataTable.Columns.Add("Количество включений", typeof(ushort));
            JournalRecordDataTable.Rows.Add(new object[] { 0, journal_record[0].rcntv[0].Racc, journal_record[0].rcntv[0].ofcnt, journal_record[0].rcntv[0].oNacnt });
            rcntvDataGridView.DataSource = JournalRecordDataTable;
        }

        private void JournalRecordsDataGridView_SelectionChanged(object sender, EventArgs e)
        {
            ShowJournalRecordInformation();
        }

        private void ShowJournalRecordInformation()
        {
            if (JournalRecordsDataGridView.CurrentRow == null) return;

            if (Database.Filtered_Journal_Records.Count > 1)
            {
                int selectedRecordNumber = JournalRecordsDataGridView.CurrentRow.Index + 1;

                ModBusProfile.journal_record SelectedRecord = Database.Filtered_Journal_Records[selectedRecordNumber];

                // Тип события - rtype / substype
                if (SelectedRecord.hdr.rtype == 1)
                {
                    if (SelectedRecord.hdr.subtype == 0)
                    {
                        EventTypeTextBox.Text = "Отключение выключателя";
                    }

                    else if (SelectedRecord.hdr.subtype == 1)
                    {
                        EventTypeTextBox.Text = "Включение выключателя";
                    }
                }
                else if (SelectedRecord.hdr.rtype == 2)
                {
                    EventTypeTextBox.Text = "Обнуление счетчика ресурса";
                }

                // Дата события - stamp.slo / stamp.ns
                SloTextBox.Text = SelectedRecord.hdr.stamp.slo.ToString();
                NsTextBox.Text = SelectedRecord.hdr.stamp.ns.ToString();

                // Дополнительные данные - udt
                UdtTextBox.Text = SelectedRecord.hdr.udt.ToString();

                // Значение тока соответствующего аналогового канала на момент события - Ii
                IiTextBox.Text = SelectedRecord.Ii.ToString();

                // Значение износа выключателя в данном [от|в]ключении - Ri
                RiTextBox.Text = SelectedRecord.Ri.ToString();

                // Аккумулированные значения износа выключателя для каждого контакта  - rcntv
                if (SelectedRecord.rcntv.Length > JournalRecordDataTable.Rows.Count)
                {
                    for (int i = 1; i < SelectedRecord.rcntv.Length; i++)
                    {
                        JournalRecordDataTable.Rows.Add(new object[] { i, 0 });
                    }
                }
                else if (SelectedRecord.rcntv.Length < JournalRecordDataTable.Rows.Count)
                {
                    int current_row = JournalRecordDataTable.Rows.Count - 1;
                    while (SelectedRecord.rcntv.Length < JournalRecordDataTable.Rows.Count)
                    {
                        JournalRecordDataTable.Rows[current_row].Delete();
                        current_row--;
                    }
                }

                for (int z = 0; z < SelectedRecord.rcntv.Length; z++)
                {
                    JournalRecordDataTable.Rows[z][1] = SelectedRecord.rcntv[z].Racc;
                    JournalRecordDataTable.Rows[z][2] = SelectedRecord.rcntv[z].ofcnt;
                    JournalRecordDataTable.Rows[z][3] = SelectedRecord.rcntv[z].oNacnt;
                }

                rcntvDataGridView.DataSource = JournalRecordDataTable;
            }
        }   
    }
}