using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SimensProdave6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (CSimensProdave6_S7.InitNetwork() == false)
            {
                this.label1.Text = CSimensProdave6_S7.ErrorsText;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            byte[] ret=CSimensProdave6_S7.DB_Read_Prodave(0, 1, 98, 1);
            if (ret == null)
            {
                this.label1.Text = CSimensProdave6_S7.ErrorsText;
            }
            else
            {
                textBox1.Text = ret[0].ToString();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            byte[] ss = new byte[1024] ;
            ss[0] = 2;
            CSimensProdave6_S7.DB_Write_Prodave(0, 1, 0, 1,ss);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            byte[] aa=new byte[3]{11,22,33};
            int[] ii=new int[3];
            Array.Copy(aa, ii, 3);
        }
    }
}