PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
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 System.IO;
using System.Threading;
using OnlineSigmatek;
using PLCM3Example;
namespace STS_Current_Clamp_Logger
{
public partial class frmMain : Form
{
public const int NUM_CHANNELS = 3;
public short handle;
public static short status;
public frmMain()
{
InitializeComponent();
string IPAddress = "";
System.Text.StringBuilder str = new System.Text.StringBuilder(80);
str = null;
IPAddress = "10.0.0.57:80";
status = Imports.OpenUnitViaIp(out handle, str, IPAddress);
if (handle == 0)
{
MessageBox.Show("Unable to open device");
}
else
{
MessageBox.Show("Device opened successfully");
}
}
private void btnClose_Click(object sender, EventArgs e)
{
Imports.CloseUnit(handle);
Application.Exit();
}
private void timer1_Tick(object sender, EventArgs e)
{
uint[] values = new uint[NUM_CHANNELS];
status = Imports.GetValue(handle, (Imports.enPLCM3Channels)1, out values[0]);
txtL1.Text = Convert.ToString(values[0]/1000);
status = Imports.GetValue(handle, (Imports.enPLCM3Channels)2, out values[1]);
txtL2.Text = Convert.ToString(values[1] / 1000);
status = Imports.GetValue(handle, (Imports.enPLCM3Channels)3, out values[2]);
txtL3.Text = Convert.ToString(values[2] / 1000);
}
}
}