资源简介
VS2013三菱PLC通讯
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Sample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
#region “Processing of Open button“
private void btn_Open_Click(object sender EventArgs e)
{
int iReturnCode; //Return code
int iLogicalStationNumber; //LogicalStationNumber for ActUtlType
//Displayed output data is cleared.
ClearDisplay();
//
//Processing of Open method
//
try
{
//When ActProgType is selected by the radio button
if (rad_ActProgType.Checked)
{
//Set the value of ‘UnitType‘ to the property(UNIT_QNUSB).
axActProgType1.ActUnitType = 0x16;
//Set the value of ‘ProtocolType‘ to the property(PROTOCOL_USB).
axActProgType1.ActProtocolType = 0x0D;
//Set the value of ‘Password‘.
axActProgType1.ActPassword = txt_Password.Text;
//The Open method is executed.
iReturnCode = axActProgType1.Open();
//When the Open method is succeeded make the EventHandler of ActProgType Controle.
if (iReturnCode == 0)
{
txt_LogicalStationNumber.Enabled = false;
}
}
//When ActUtlType is selected by the radio button
else
{
//Check the ‘LogicalStationNumber‘.(If succeeded the value is gotten.)
if (GetIntValue(txt_LogicalStationNumber out iLogicalStationNumber) != true)
{
//If failed this process is end.
return;
}
//Set the value of ‘LogicalStationNumber‘ to the property.
axActUtlType1.ActLogicalStationNumber = iLogicalStationNumber;
//Set the value of ‘Password‘.
axActUtlType1.ActPassword = txt_Password.Text;
//The Open method is executed.
iReturnCode = axActUtlType1.Open();
//When the Open method is succeeded disable the TextBox of ‘LogocalStationNumber‘.
//When the Open method is succeeded make the EventHandler of ActUtlType Controle.
if (iReturnCode == 0)
{
txt_LogicalStationNumber.Enabled = false;
}
}
}
//Exception processing
catch (Exception except
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 28816 2013-11-20 10:58 Sample\Backup\Form1.cs
文件 32333 2013-11-20 10:58 Sample\Backup\Form1.Designer.cs
文件 7213 2013-11-20 10:58 Sample\Backup\Form1.resx
文件 473 2013-05-07 14:27 Sample\Backup\Program.cs
文件 1268 2013-05-07 14:27 Sample\Backup\Properties\AssemblyInfo.cs
文件 2841 2013-05-07 14:27 Sample\Backup\Properties\Resources.Designer.cs
文件 5612 2013-05-07 14:27 Sample\Backup\Properties\Resources.resx
文件 1091 2013-05-07 14:27 Sample\Backup\Properties\Settings.Designer.cs
文件 249 2013-05-07 14:27 Sample\Backup\Properties\Settings.settings
文件 4442 2013-11-20 10:58 Sample\Backup\Sample.csproj
文件 900 2013-05-07 14:27 Sample\Backup\Sample.sln
文件 40960 2017-01-23 14:49 Sample\bin\Debug\AxInterop.ActProgTypeLib.dll
文件 13312 2017-01-23 14:49 Sample\bin\Debug\AxInterop.ActUtlTypeLib.dll
文件 45056 2017-01-23 14:49 Sample\bin\Debug\Interop.ActProgTypeLib.dll
文件 15872 2017-01-23 14:49 Sample\bin\Debug\Interop.ActUtlTypeLib.dll
文件 24576 2017-01-23 14:50 Sample\bin\Debug\Sample.exe
文件 34304 2017-01-23 14:50 Sample\bin\Debug\Sample.pdb
文件 22704 2017-01-25 20:25 Sample\bin\Debug\Sample.vshost.exe
文件 490 2015-06-04 12:48 Sample\bin\Debug\Sample.vshost.exe.manifest
文件 28816 2017-01-25 11:38 Sample\Form1.cs
文件 32333 2013-11-20 10:58 Sample\Form1.Designer.cs
文件 7213 2013-11-20 10:58 Sample\Form1.resx
文件 40960 2017-01-23 14:49 Sample\obj\Debug\AxInterop.ActProgTypeLib.dll
文件 13312 2017-01-23 14:49 Sample\obj\Debug\AxInterop.ActUtlTypeLib.dll
文件 12350 2017-01-24 09:55 Sample\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6343 2017-01-23 14:57 Sample\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 45056 2017-01-23 14:49 Sample\obj\Debug\Interop.ActProgTypeLib.dll
文件 15872 2017-01-23 14:49 Sample\obj\Debug\Interop.ActUtlTypeLib.dll
文件 1262 2017-01-25 20:25 Sample\obj\Debug\Sample.csproj.FileListAbsolute.txt
文件 847 2017-01-23 14:50 Sample\obj\Debug\Sample.csproj.GenerateResource.Cache
............此处省略29个文件信息
- 上一篇:通信专业英语缩写
- 下一篇:附和闭合左右角导线附合导线自动计算表可修改站数
评论
共有 条评论