资源简介
可以直接使用
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using S7TCPDLL;
namespace S71200_1500_300_400
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
S7Client client = new S7Client();
string TxtSlot path;
string TxtIP;
string TxtRack;
public void connectIP()
{
path = Application.StartupPath + @“\config.ini“;
TxtIP = IniFile.ReadIniData(“PlcComTCP“ “IP“ ““ path);
TxtRack = IniFile.ReadIniData(“PlcComTCP“ “Rack“ ““ path);
TxtSlot = IniFile.ReadIniData(“PlcComTCP“ “Slot“ ““ path);
int Rack = Convert.ToInt32(TxtRack); int Slot = Convert.ToInt32(TxtSlot);
client.SetConnectionType(3);
int Result = client.ConnectTo(TxtIP Rack Slot);
if (Result == 0)
{
timer1.Enabled = true;
ovalShape2.BackColor = Color.Transparent;
ovalShape1.BackColor = Color.Lime;
}
else
{
ovalShape2.BackColor = Color.Red;
ovalShape1.BackColor = Color.Transparent;
}
}
private void groupBox5_Enter(object sender EventArgs e)
{
}
private void Form1_Load(object sender EventArgs e)
{
connectIP();
}
private void Form1_FormClosed(object sender FormClosedEventArgs e)
{
this.Dispose();
}
private void timer1_Tick(object sender EventArgs e)
{
ovalShape1.Fillstyle = 1 - ovalShape1.Fillstyle;
byte[] EBBuffer = new byte[1];
int result = client.EBRead(0 EBBuffer.Length EBBuffer);
if(result==0)
{
////////////////状态检测/////////////////////
iO_INSTRUCTION1.AAValue = client.ReadBitIB(00);
iO_INSTRUCTION2.AAValue = client.ReadBitIB(10);
iO_INSTRUCTION3.AAValue = client.ReadBitQB(0 0);
iO_INSTRUCTION4.AAValue = client.ReadBitQB(1 0);
iO_INSTRUCTION5.AAValue = client.ReadBitMB(0 0);
iO_INSTRUCTION6.AAValue = client.ReadBitMB(100 6);
iO_INSTRUCTION7.AAValue = client.ReadBitDB(1 40 0 0);
iO_INSTRUCTION8.AAValue = client.ReadBitDB(1 40106);
////////////////报警监控/////////////////////
iO_INSTRUCTION9.AAValue = client.ReadBitIB(0 3);
iO_INSTRUCTION10.AAValue = client.ReadBitIB(0 6);
iO_INSTRUCTION11.AAValue = client.ReadBit
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 68724 2019-09-27 17:07 S71200_1500(C#VS2013)\ReadMeFirst(软件使用说明).docx
文件 533 2019-09-26 18:29 S71200_1500(C#VS2013)\ReadMeFirst.txt
文件 49 2019-09-26 22:28 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\config.ini
文件 57856 2019-09-27 14:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\HID.exe
文件 9728 2019-09-24 22:57 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\IO_INSTRUCTIONS.dll
文件 352256 2008-02-13 21:21 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\Microsoft.VisualBasic.PowerPacks.dll
文件 49664 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\S71200_1500_300_400.exe
文件 36352 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\S71200_1500_300_400.pdb
文件 22656 2019-09-26 18:49 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\S71200_1500_300_400.vshost.exe
文件 490 2016-07-16 19:44 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\S71200_1500_300_400.vshost.exe.manifest
文件 286720 2019-09-28 19:28 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\bin\Debug\S7TCPDLL.dll
文件 286720 2019-09-28 19:28 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\DLL\S7TCPDLL.dll
文件 7884 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Form1.cs
文件 43384 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Form1.Designer.cs
文件 23453 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Form1.resx
文件 33421 2019-09-26 18:47 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7460 2019-09-26 18:45 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 2695 2019-09-26 18:49 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.csproj.FileListAbsolute.txt
文件 977 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.csproj.GenerateResource.Cache
文件 16592 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.csprojResolveAssemblyReference.cache
文件 49664 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.exe
文件 11992 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.Form1.resources
文件 36352 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.pdb
文件 180 2019-09-26 18:48 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\obj\Debug\S71200_1500_300_400.Properties.Resources.resources
文件 11426 2019-09-26 18:45 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\ooopic_1569657111.ico
文件 500 2019-09-25 23:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Program.cs
文件 1362 2019-09-25 23:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Properties\AssemblyInfo.cs
文件 2890 2019-09-25 23:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Properties\Resources.Designer.cs
文件 5612 2019-09-25 23:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Properties\Resources.resx
文件 1106 2019-09-25 23:00 S71200_1500(C#VS2013)\S71200_1500\S71200_1500_300_400\S71200_1500_300_400\Properties\Settings.Designer.cs
............此处省略19个文件信息
相关资源
- S7.NET-EXE.rar
- C#使用ModbusTcp协议与西门子1200PLC通讯
- C#和西门子1200PLC通讯.zip
- C#和西门子PLC1200 以太网通讯
- 百度云C#开发实战1200例书和光盘
- C#开发实战1200例(第1、2卷Pdf)+第1卷
- [C#开发实战1200例第2卷].王小科等.扫描
- S7.NET.DLL及官方指导文件.rar
- C#开发实战1200例第2卷源码
- C#开发实战1200例第1卷源码
- 西门子S1200 与C#以太网通信,利用OP
- WinTcpS7_1K_dll
- 西门子PLC S7-300 400 1200 1500 TCP C#通讯组
- C#开发实战1200例(1卷)(带目录)
- C#使用sharp7读写S7-1200 寄存器模块数据
- C#开发实战1200例第一卷+第二卷+地址
- PMSM_sensorless_P1500
- 电脑与西门子S71200进行通信的VB6.0代码
- C#winform与西门子1200、1500系列PLC通讯
- 与S7-1200PLC实现TCP/IP通信
- C#与西门子S7-1200PLC通信
- C# OPC通信客户端(S7-1200 Control)
- 西门子PLC s-1200、s-1500通讯
- 开源 西门子PLC S7-200/300/400/1200/1500 T
- Siemens OPC_ua_client程序(S7-1500)
- s7-1500 连接PLC(西门子)并实现读取数
- C#语言实战1200例 第二卷
- C#与1500通讯
- PLC通信,可学习DLL Testing for S7-1200/1
- C# 和西门子S71200 1500 300 400 S7TCP 通信
评论
共有 条评论