資源簡介
雷賽運(yùn)動(dòng)控制卡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?csLTDMC;
namespace?IO
{
????public?partial?class?Form1?:?Form
????{
????????private?ushort?_CardID?=?0;
????????private?ushort?_CANStatus?=?0;
????????private?ushort?_CANNum?=?0;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????short?num?=?LTDMC.dmc_board_init();//獲取卡數(shù)量
????????????if?(num?<=?0?||?num?>?8)
????????????{
????????????????MessageBox.Show(“初始卡失敗!“?“出錯(cuò)“);
????????????}
????????????ushort?_num?=?0;
????????????ushort[]?cardids?=?new?ushort[8];
????????????uint[]?cardtypes?=?new?uint[8];
????????????short?res?=?LTDMC.dmc_get_CardInfList(ref?_num?cardtypes?cardids);
????????????LTDMC.dmc_read_inbit(0?1);
????????????if?(res?!=?0)
????????????{
????????????????MessageBox.Show(“獲取卡信息失敗!“);
????????????}
????????????_CardID?=?cardids[0];
????????????//
????????????timer1.Start();
????????}
????????private?Label?GetINLabel(int?index)
????????{
????????????string?txt?=?index.ToString();
????????????foreach?(Label?_label?in?groupBox1.Controls)
????????????{
????????????????if?(_label?!=?null?&&?_label.Text?==?txt)
????????????????{
????????????????????return?_label;
????????????????}
????????????}
????????????return?null;
????????}
????????private?Label?GetOUTLabel(int?index)
????????{
????????????string?txt?=?index.ToString();
????????????foreach?(Label?_label?in?groupBox2.Controls)
????????????{
????????????????if?(_label?!=?null?&&?_label.Text?==?txt)
????????????????{
????????????????????return?_label;
????????????????}
????????????}
????????????return?null;
????????}
????????private?Label?GetCANINLabel(int?index)
????????{
????????????string?txt?=?index.ToString();
????????????foreach?(Label?_label?in?groupBox5.Controls)
????????????{
????????????????if?(_label?!=?null?&&?_label.Text?==?txt)
????????????????{
????????????????????return?_label;
????????????????}
????????????}
????????????return?null;
????????}
????????private?Label?GetCANOUTLabel(int?index)
????????{
????????????string?txt?=?index.ToString();
????????????foreach?(Label?_label?in?groupBox6.Controls)
????????????{
????????????????if?(_label?!=?null?&&?_label.Text?==?txt)
????????????????{
????????????????????return?_label;
????????????????}
????????????}
????????????return?null;
????????}
????????private?void?SetLabel(Label?label?bool?status)
????????{
????????????if?(label?!=?null)
????????????{
????????????????if?(status)
????????????????{
????????????????????label.BackColor?=?Color.Red;
????????????????}
????????????????else
????????????????{
????????????????????label.BackColor?=?Color.Green;
????????????????}
????????????}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-07-09?08:55??例8_IO\
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\
?????文件?????????187??2017-12-04?00:00??例8_IO\IO\App.config
?????文件???????56255??2017-12-04?00:00??例8_IO\IO\Form1.Designer.cs
?????文件????????7579??2017-12-04?00:00??例8_IO\IO\Form1.cs
?????文件????????6011??2017-12-04?00:00??例8_IO\IO\Form1.resx
?????文件????????3816??2017-12-04?00:00??例8_IO\IO\IO.csproj
?????文件???????69703??2017-12-04?00:00??例8_IO\IO\LTDMC.cs
?????文件?????????514??2017-12-04?00:00??例8_IO\IO\Program.cs
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\Properties\
?????文件????????1334??2017-12-04?00:00??例8_IO\IO\Properties\AssemblyInfo.cs
?????文件????????2856??2017-12-04?00:00??例8_IO\IO\Properties\Resources.Designer.cs
?????文件????????5612??2017-12-04?00:00??例8_IO\IO\Properties\Resources.resx
?????文件????????1089??2017-12-04?00:00??例8_IO\IO\Properties\Settings.Designer.cs
?????文件?????????249??2017-12-04?00:00??例8_IO\IO\Properties\Settings.settings
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\bin\
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\bin\Debug\
?????文件???????46080??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.exe
?????文件?????????187??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.exe.config
?????文件???????65024??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.pdb
?????文件???????22472??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.vshost.exe
?????文件?????????187??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.vshost.exe.config
?????文件?????????490??2017-12-04?00:00??例8_IO\IO\bin\Debug\IO.vshost.exe.manifest
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\obj\
?????目錄???????????0??2019-07-09?08:55??例8_IO\IO\obj\Debug\
?????文件????????1711??2017-12-04?00:00??例8_IO\IO\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????7254??2017-12-04?00:00??例8_IO\IO\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件?????????180??2017-12-04?00:00??例8_IO\IO\obj\Debug\IO.Form1.resources
?????文件?????????180??2017-12-04?00:00??例8_IO\IO\obj\Debug\IO.Properties.Resources.resources
?????文件????????5538??2017-12-04?00:00??例8_IO\IO\obj\Debug\IO.csproj.FileListAbsolute.txt
?????文件?????????975??2017-12-04?00:00??例8_IO\IO\obj\Debug\IO.csproj.GenerateResource.Cache
............此處省略9個(gè)文件信息
評(píng)論
共有 條評(píng)論