UltimaSerial How to use ActiveX in Visual C#.NET
USB-based DI-148, DI-158, DI-710, DI-715B & DI-718B are now supported by Ultimaserial

158u.jpg (11869 bytes)

Let UltimaSerial unleash the power of your Windaq Starter kit!

 

UltimaWaterfall

UltimaWaterfall

 

FFT1024

FFT1024

 

XChart

 

Ultimaserial Classroom

Lessons on how to use UltimaSerial

 

download.jpg (1018 bytes) Downloads

 

Registration.jpg (4365 bytes)

info@ultimaserial.com

 

 

The following is a step-by-step lesson on how to use ActiveX in Microsoft Visual C#.NET

In this lession, we will use Ultimaserial ActiveX to develop a data acquisition application to use  DATAQ's Starter kit DI-158 via USB port. 

Before we start, please download and install UltimaSerial

1) Run Microsoft Visual Studio.NET

2) Start a New Project. Select Visual C# Projects. Give a name MyTest to the project, hit OK

3) A form is created

4) Move the cursor to the toolbox (left pane) and click right button

5) From the popup menu, select "Add/Remove Items..."

6) In the dialogue box "Customize Toolbox", select COM components tab

7) Check both Ultimaserial and DQChartX, hit OK

8) Add Ultimaserial and DQChartX components to the form, along with two buttons, named Start and Stop

9) Double click on the two buttons to create codes (you will need to switch between the tabs of form1.cs* and form1.cs[Design]* to do so)

10) Back in form1.cs[Design]* tab, select Ultiamserial icon, in its property pane, select Event tab, which looks like a lightning. 

11) Double click on NewData event, now Visual Studio.NET should generate codes should be like this:

private void Start_Click(object sender, System.EventArgs e)
{
}

private void Stop_Click(object sender, System.EventArgs e)
{
}

private void axUltimaSerial1_NewData(object sender, AxULTIMASERIALLib._DUltimaSerialEvents_NewDataEvent e)
{
}


12) Add our codes:

private void Start_Click(object sender, System.EventArgs e)
{
axUltimaSerial1.Device=ULTIMASERIALLib.enumDeviceType.DI158;
axUltimaSerial1.CommPort=ULTIMASERIALLib.enumComPort.USB;
axUltimaSerial1.SampleRate=20;
axUltimaSerial1.ChannelCount=1;
axUltimaSerial1.AcquisitionMode=0;
axUltimaSerial1.Start();

}

private void Stop_Click(object sender, System.EventArgs e)
{
axUltimaSerial1.Stop();
}
private void axUltimaSerial1_NewData(object sender, AxULTIMASERIALLib._DUltimaSerialEvents_NewDataEvent e)
{
axXChart1.Chart (axUltimaSerial1.GetData());
}

 

Last update: 12/17/07

Copyright: 2000-2005  www.UltimaSerial.com