„DMM” változatai közötti eltérés
A Fizipedia wikiből
1. sor: | 1. sor: | ||
− | Good Will Instek GDM 8246 | + | Programming the Good Will Instek GDM 8246 digital multimeter using C# language. [[Fájl:DMM.zip | Példaprogram]] |
<syntaxhighlight lang=csharp> | <syntaxhighlight lang=csharp> |
A lap jelenlegi, 2019. szeptember 6., 13:47-kori változata
Programming the Good Will Instek GDM 8246 digital multimeter using C# language. Fájl:DMM.zip
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; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { // Init COM port serialPort1.PortName = "COM1"; serialPort1.BaudRate = 9600; serialPort1.DataBits = 8; serialPort1.StopBits = System.IO.Ports.StopBits.One; serialPort1.Parity = System.IO.Ports.Parity.None; serialPort1.Open(); } private void button1_Click(object sender, EventArgs e) { // Reads ID serialPort1.WriteLine("*idn?"); IDtextBox.Text = serialPort1.ReadLine(); } private void button2_Click(object sender, EventArgs e) { // Reads Displayed Value serialPort1.WriteLine(":VAL?"); ValuetextBox.Text = serialPort1.ReadLine(); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { // Close Serial Port serialPort1.Close(); } } }