PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
//connect tc-08
short handle = Imports.TC08OpenUnit();
if (handle == 0)
{
Imports.TC08CloseUnit(1);
textBox1.AppendText("Device is disconnected ");
button1.Text = "Connect";
textBox2.AppendText(Convert.ToString(handle));
}
else
{
Imports.TC08OpenUnit();
textBox1.AppendText("Device opened successfully " );
button1.Text = "Disconnect";
textBox2.AppendText(Convert.ToString(handle));
}
}
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
//connect tc-08
short handle = Imports.TC08OpenUnit(); //Code to open the device
if (handle == 0)
{
Imports.TC08CloseUnit(1);
textBox1.AppendText("Device is disconnected ");
button1.Text = "Connect";
textBox2.AppendText(Convert.ToString(handle));
}
else
{
Imports.TC08OpenUnit();
textBox1.AppendText("Device opened successfully ");
button1.Text = "Disconnect";
textBox2.AppendText(Convert.ToString(handle));
}
}
Code: Select all
private void button2_Click(object sender, EventArgs e)
{
SetChannels();
GetValues();
}
Code: Select all
void SetChannels()
{
short channel;
short ok;
for (channel = 0; channel <= USBTC08_MAX_CHANNELS; channel++)
{
ok = Imports.TC08SetChannel(_handle, channel, TC_TYPE_K);
}
}
Code: Select all
unsafe void GetValues()
{
short status;
short chan;
float[] tempbuffer = new float[9];
short overflow;
// label the columns
for (chan = 1; chan <= USBTC08_MAX_CHANNELS; chan++)
{
textBox6.AppendText("Chan{" + chan + "}: " );
}
status = Imports.TC08GetSingle(_handle, tempbuffer, &overflow, Imports.TempUnit.USBTC08_UNITS_CENTIGRADE);
textBox7.AppendText(Convert.ToString(status)); // checking the value
if (status == PICO_OK)
{
for (chan = 1; chan <= USBTC08_MAX_CHANNELS; chan++)
{
textBox5.AppendText("{0:0.0000} " + tempbuffer[chan]);
}
Thread.Sleep(1000);
}
status = Imports.TC08Stop(_handle);
}
Code: Select all
if (status == PICO_OK)
Code: Select all
if (status == 0)
Hitesh wrote:Hi Solarity,
When the status is equal to 0, try calling the dll's usb_tc08_get_last_error() function and let me know what that function returns.
Does the device work ok with the PicoLog software?
Regards,
Hello there Hitesh =)Hitesh wrote:Good to hear you fixed it!
Look forward to seeing the guide and program - you can submit it via the PicoApps page on our website.
Regards,
Hi there Hitesh,Hitesh wrote:Hi Solarity,
Thank you - we have received your completed form so an entry should appear on the PicoApps page in due course.
Regards,