資源簡介
歐姆龍NX7不再支持FINS通訊,目前還沒詳細的協議,這個動態庫是本人歷經一年時間開發出來的,提供給大家調試使用(可在VS平臺使用,并有例子),若要在執行文件使用還得聯系我.其他常用的PLC也有,穩定性好,都支持斷線自動重連.
代碼片段和文件信息
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?NXPLC;
namespace?NXDemo
{
????public?partial?class?frmMain?:?Form
????{
????????NXPLC.Omron?NX_PLC?=?new?Omron(“192.168.250.1“?44818);
????????///?
????????///?//先要在NX的PLC里面定義變量名為“測試1“的16位整形數據并且設定為公開
????????///?
????????public?frmMain()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????MessageBox.Show(“先要在NX的PLC里面定義變量名為[測試1]的16位整形數據并且設定為公開.\r\n若有疑問可聯系作者93632888@qq.com“);
????????}
????????private?void?btnAddQuery_Click(object?sender?EventArgs?e)
????????{
????????????NX_PLC.AppendToQuery(true?“測試1“);
????????????timer1.Enabled?=?true;
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????lblValue.Text?=?NX_PLC.ReadList[“測試1“].bData.ToString();
????????}
????????private?void?btnWrite_Click(object?sender?EventArgs?e)
????????{
????????????UInt16[]?bd?=?{?88?};
????????????bd[0]?=?Convert.ToUInt16(txtValue.Text.Trim());
????????????NX_PLC.AppendToWrite(bd?false?“測試1“);
????????}
????}
}
- 上一篇:stdio.h 庫函數
- 下一篇:銀行家算法&多級隊列調度算法內含源碼
評論
共有 條評論