PicoScope 7 Software
Available on Windows, Mac and Linux
PicoScope 7 Software
Available on Windows, Mac and Linux
OEM & custom applications
PicoScope, Pico data logger and RF products can be used as components in custom applications and OEM projects.
A to Z of PC oscilloscopes
Everything you need to know about PC oscilloscopes from Advanced Triggers to Zooming.
A to Z of Data Loggers
Everything you need to know about PC-based data loggers from Alarms to Zooming.
Application Notes
Details of some of the many applications for Pico data logger and oscilloscope products.
How do I measure...?
Find out how you can measure using Pico products
Videos
Showing you how to get the most out of PicoScope oscilloscope software.
Documentation
Up-to-date versions of the documentation supplied with your products in PDF format.
Educational Experiments
Our library of science experiments suitable for use with oscilloscope and data logging products.
PicoApps
Want to share hints, tips and code with other developers? Show your Pico-based products to the world.
Newsletter
Archive of our monthly Test and Measurement Newsletters.
Post by davidpruitt »
Code: Select all
static void Main()
{
//Open the scope, set the channel, and set a trigger.
short scopeHandle = Imports.OpenUnit();
Imports.SetChannel(scopeHandle, Imports.Channel.ChannelA, 1, 1, Imports.Range.Range_20V);
Imports.SetTrigger(scopeHandle, (short)Imports.Channel.ChannelA, 0,
(short)Imports.ThresholdDirection.Rising,
0, 0);
//Set the timebase
int time_interval = 0;
short time_units = 0;
int max_samples;
short result = Imports.GetTimebase(scopeHandle, 7, 1024, out time_interval,
out time_units, 0, out max_samples);
int time_indisposed_ms = 0;
Imports.RunBlock(scopeHandle, 1024, 7, 1, out time_indisposed_ms);
while(Imports.Isready(scopeHandle) == 0) { /* loop until ready */ }
//Read values from event on scope
short[] values = new short[1024];
short overflow = 0;
long num_values_returned = Imports.GetValues(scopeHandle, values, null, null, null, out overflow, 1024);
//Write values to file
StreamWriter writer = new StreamWriter("values.txt");
for (int i = 0; i < 1024; i++)
{
writer.WriteLine(values[i].ToString());
}
writer.Close();
Imports.CloseUnit(scopeHandle);
}
[The extension cs has been deactivated and can no longer be displayed.]
Post by davidpruitt »
Return to “.Net Languages (C#, VB.Net, .)”