1. 实现功能
一个流水线的视觉检测项目,当待检测工件到达工位,传感器检测到位,PLC接收到信号,触发上位机上的拍照按钮,进行图像采集。
2. 上位机设计
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 xktComm;
using xktComm.Common;
namespace 西门子PLC触发相机拍照上位机设计
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
xktComm.SiemensS7 objS7 = new SiemensS7();
public bool IsConnect;
CPU_Type CPU;
private void Form1_Load(object sender, EventArgs e)
{
IsConnect = objS7.Connect("192.168.0.30", CPU_Type.S71200,0,1);