- Added QRValidation vision control system - Includes CapCleaningControl UI components - WebSocket-based barcode validation system - Support for Crevis PLC integration - Test projects for PLC emulator, motion, IO panel, and Modbus 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.1 KiB
C#
46 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using Modbus.Device;
|
|
using System.Net.Sockets;
|
|
|
|
namespace Test_Modbus
|
|
{
|
|
public partial class Form1 : Form
|
|
{
|
|
public Form1()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
|
|
ModbusIpMaster master;
|
|
TcpClient client;
|
|
|
|
private void button1_Click(object sender, EventArgs e)
|
|
{
|
|
client = new TcpClient();
|
|
client.SendTimeout = 2000;
|
|
client.ReceiveTimeout = 2000;
|
|
client.Connect("192.168.1.90", 502);
|
|
|
|
if(client.Connected)
|
|
{
|
|
master = ModbusIpMaster.CreateIp(client);
|
|
master.Transport.ReadTimeout = 2000;
|
|
master.Transport.WriteTimeout = 2000;
|
|
|
|
var listI = master.ReadInputRegisters(0, 1);
|
|
master.WriteSingleRegister(0, 2);
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|