UltimaSerial UltimaSerial ActiveX Control (FREE)
 


 


 


 








 


 

Supported Devices: 

DATAQ's  DI-155, DI-145, DI-149, DI-148, DI-150, DI-151, DI-154, DI-158, DI-190, DI-194RS, DI-195B, DI-710, DI-715B, DI-718B, DI-718Bx, RS232 or USB modules

Dataforth's USB-based isoLynx SLX 718

Find out how to program DI-155/145/149

We highly suggest DataqSDK.NET Class if you are starting a new project on products supported by the class. 

Since the new DATAQSDK.NET is providing an advanced .NET programming interface, UltimaSerial ActiveX project is now in frozen state, meaning no more development to support newer Dataq USB device nor to improve its functionality for existing products. We are focusing our effort on WinDaq addons

Operating System

Windows 98/Me/2000/XP/2003/Vista/Server 2008/7/NT

32 or 64-bit?

Like other ActiveX controls, UltimaSerial ActiveXs are 32-bit components, you must select 32-bit code option when using 64-bit compilers. Both 32-bit and 64-bit Windows runs 32-bit applications properly. 

Programming Language Requirement: 

The included samples are mostly from VB6. For examples in other programming languages, please visit our classroom

What needs to install when deploying the software

  1. If USB devices are used, install DATAQ's USB drivers

  2. Copy UltimaSerial.ocx and other ActiveX used in your project to windows\system32 directory and register them using the command line: REGSVR32.EXE <filename>.OCX /S

  3. Confirm the target computer have the latest MFC42.DLL  in windows\system32

List of Properties: 

AcquisitionMode, AvailableData, CommPort, ChannelCountDevice, EventLevel, Key, MaskOutDigitalBits, MatchSerialNumber, PChannel, PGain, PostTriggerLength, PreTriggerLengthRawData, SampleRate, SerialNumberSquareWaveOutputTriggerChannel, TriggerLevel, TriggerStatus

List of Methods:  

AnalogInput, DACOutput, Data2Volt, DigitalInput, DigitalOutput, GetDataPt, GetDescription, GetData, GetDataEx, GetDataFrame, GetDataFrameEx, MapErrorMessage, ResetCounter, ScanDevice, SetDescription, SetDIODir, SetLimitLines, Start, Stop, TransitionalCounter

List of Events: 

DriverError, GapInDataStream, LimitLine, NewData, Trigger

Why choose Ultimaserial:

UltimaSerial comparing to DataqSDK

License:  

Freeware

We highly suggest DataqSDK.NET Class if you are starting a new project on products supported by the class. 

WinDaq add-ons is the only UltimaSerial product being supported actively, all other software products are in FREEZE state, meaning no more modification nor active support

Properties: 

AcquisitionMode  (integer) specifies the mode of acquisition, which includes unconditional, trigger on rising edge of an analog or digital input, trigger on falling edge of an analog or digital input, acquire when signal above a threshold level of an analog input, acquire when signal below a threshold level of an analog input, acquire when transitional counter reaches a predefined value, etc. A trigger event will be fired when the trigger condition is met.

Applicable Devices: All

Valid Acquisition Mode:

0 = NoCondition (default)
1 = OnEdgeLow2High
2 = OnEdgeHigh2Low
3 = WhenAboveLevel
4 = WhenBelowLevel

Note: In Mode 3 & 4: 

PreTriggerLength should be zero
PostTriggerLength should be zero if all data points above the level should be captured, or one if only the first one should be captured

AvailableData: This function reports how many available new data points have filled the buffer since the last time data was retrieved using GetData. 


Syntax:     variable=Ultimaserial1.AvailableData

Variable: Integer

Applicable Devices: All

ChannelCount: Lets you write the number of channels you want to be enabled or read the number of channels that are currently enabled. The default is 1 channel. If you enter a number that is higher than the number of possible channels for the data acquisition instrument you are using, ChannelCount will be reset to 1. (For example, since a DI-194 has 4 possible channels, and you request 10 channels, only one channel will be enabled.)

Syntax:     Ultimaserial1.ChannelCount=variable (Writes the number of channels to be enabled)
                variable=Ultimaserial1.ChannelCount (Reads the number of currently enabled channels)

Variable: Integer

Applicable Devices: All, with special notation for 194/154/145 users

For DI-194/154/145 Users:

When you specify the channel count in UltimaSerial, like:
UltimaSerial.ChannelCount = 2, you enable channel 1 & 2.
or, UltimaSerial.ChannelCount = 4, you enable channel 1 & 2 & 3 & 4.

If you need to enable channels with different combination, you can use
UltimaSerial.ChannelCount = 100 + H
where H is the binary channel selector, i.e

H=1 enable channel 1
H=2 enable channel 2
H=3 enable channel 1 & 2
H=4 enable channel 3
H=5 enable channel 1 & 3
H=6 enable channel 2 & 3
H=7 enable channel 1 & 2 & 3
H=8 enable channel 4
H=9 enable channel 1 & 4
H=10 enable channel 2 & 4
H=11 enable channel 1 & 2 & 4
H=12 enable channel 3 & 4
H=13 enable channel 1 & 3 & 4
H=14 enable channel 2 & 3 & 4
H=15 enable channel 1 & 2 & 3 & 4

You cannot use PChannel, PGain property to change the channel and gain allocation table

For DI-148/158/710/715 Users:

Please use PChannel, PGain property to change the channel and gain allocation table

CommPort: Specify the COMM port (serial port) you want to use or find out which one you are currently using. (Serial port 1 is the default.)

Syntax:     Ultimaserial1.CommPort=variable (Writes serial port) click here if you have problem with this
                variable=Ultimaserial1.CommPort (Reads serial port)
Variable:    Integer

Applicable Devices: All

COM port supported by UltimaSerial:

0 = USB, if you wish Ultimaserial to find the device for you.
1 = COM 1:
2 = COM 2:
3 = COM 3:
4 = COM 4:

To use multiple serial devices on multiple COM port, you need to insert multiple UltimaSerial control in your VB form. 

If multiple USB-based device like DI-145/148/158/71x exist, consider paring SerialNumber and  MatchSerialNumber to select a device

Device: Specify the Dataq serial data acquisition device model number you are going to use or find out which one you are currently using. (DI-194 is the default.)


Syntax:     Ultimaserial1.Device=variable (Writes Device Model Number) click here if you have problem with this
                variable=Ultimaserial1.Device (Reads Device Model Number)
Variable:     Integer

Applicable Devices: All

Devices Supported  by UltimaSerial:

194 = DI-194 (8 bit device) & DI-194RS (10 bit device)
190 = DI-190
195 = DI-195B
154 = DI-154RS
150 = DI-150RS
151 = DI-151RS

USB-based devices:

145 = DI-145 (12 bit result, but around10 bit resolution)
149 = DI-149U
155 = DI-155
148 = DI-148U & DI-148UP (10 bit resolution)
158 = DI-158U (12 bit resolution)
710 = DI-710U (14 bit resolution)
715 = DI-715BU (14 bit resolution)
718 = DI-718B (14-bit resolution)

Note: Regarding DI-145 and DI-194 compatibility

EventLevel: The event NewData fires whenever a set number, or more, of new data points have been gathered. The EventLevel property allows you to specify when you want the NewData event fired. The specified integer must be between 0 and 32,767.  For example, if you specify "100" as the integer for EventLevel, the NewData event fire whenever 100 or more new data points have been gathered. Default value is 20.

A value of 0 will not  fire the NewData event. In this case, you should use Timer to pace the acquisition

Syntax:     Ultimaserial1.EventLevel=variable

Variable: Integer

Applicable Devices: All

Key: There are multiple functions for this property

Syntax:     Ultimaserial1.key=variable

Variable: String

Applicable Devices: All

  1. It serves as the entry point for the superkeys of site license

    • Example: UltimaSerial.Key = "T1c2f345"     'assuming T1c2f345 is your superkey

    • UltimaSerial.Key = "ALICE13"    'The key to enable all four channels of DI-194.

  2. It resets the counter for DI-149 and DI-155

    • Syntax: UltimaSerial.Key = "r"     

  3. If you are using first version of DI-194, you need to have a "key" (a hex number) from DATAQ instruments to enable more than one channel. To enable multiple channels on DI-194, you must provide the Key before you Start the device. Recently, DATAQ drops the requirement of purchasing the key to enable multiple channels when you write your own programs (WinDaq still requires it), you can enter "ALICE13" in the key property to enable multiple channels for older version of DI-194. 

    • The new version of DI-194, called DI-194RS (ship since Aug, 2001) does not require a key to enable all the channels.

    • The Key to enable multiple channel on the DI-194 is NOT the same as the Key to register UltimaSerial.

MaskOutDigitalBits (Boolean) when set, the digital bits will be masked out from the data stream (default: false)

Applicable Devices: All

PostTriggerLength  (integer) specifies the number of scans after the trigger point, 1 to 8000 scans can be specified. 0 is for free-run after the trigger condition is met. (default: 100). The sum of PreTriggerLength and PostTriggerLength should not be higher than 8000.

Applicable Devices: All

Valid PostTriggerLength: 0 to 8000, where 0 means infinity.

Note: In AcquisitionMode  =3 & 4: 

PostTriggerLength should be zero if all data points above the level should be captured, or one if only the first one should be captured

PreTriggerLength (integer) specifies the number of scans before the trigger point, 0 to 8000 scans can be specified (default: 100). The sum of PreTriggerLength and PostTriggerLength should not be higher than 8000.

Valid PreTriggerLength: 0 to 8000

Note: In AcquisitionMode  =3 & 4: 

PreTriggerLength should be zero

Applicable Devices: All

SampleRate: The sample rate determines how fast the sampled data is reported per channel. When you specify a sample rate, an attempt is made to report data at that sample rate. When this is not possible, the data will be reported at the closest achievable rate to the sample rate you requested. The actual sample rate can then be read after you run Start method.


Syntax:     Ultimaserial.SampleRate=variable (Writes Sample Rate)
                Ultimaserial.Start 
                variable=Ultimaserial.SampleRate (Reads actual Sample Rate)
Variable: Double

Applicable Devices: All

The minimum rate for DI-149/155 is 11.4 Hz due to its protocol

The minimum throughput rate for other 1xx is: 9.5E-06 Hz

Note: 

  1. Regarding DI-145 and DI-194 compatibility

  2. To use sample rate higher than 240s/s on DI-145, the device should be shipped after mid 2012 (the exact date can't be determined due to overlaps of new and old models) . 

  3. Please note the front-end circuit of DI-145 has a low-pass filter and it may not respond ideally for high frequency signals.

SerialNumber: This returns the serial number of the device after you Start the device successfully.  If multiple USB-based device like DI-148/158/71x/145 are in use, consider paring SerialNumber and  MatchSerialNumber to select a device

Note: For DI-1xx, you must run Start method successfully before you will have a valid SerialNumber.

Variable: String

Applicable Devices: All, but DI-194 and 154 do NOT have unique serial numbers for each device.

SquareWaveOutput  (Boolean) When set, a pre-programmed square wave will be output on a pre-defined Digital channel (D2 for DI-194), which can be fed back to an analog channel for demo purpose. Sorry, but the pattern of the square wave cannot be controlled.

Applicable Devices: DI-194/154 only

Note: With Ultimaserial (rev 3), you use change this property after Start is invoked to turn on/off the square wave, but it may create a garbage data point in the waveform.

TriggerChannel  (integer) specifies the member in PChannel list or a member in DigitalInput where the trigger condition takes place, which includes all available analog channels, digital channels and transitional event counters. 

Applicable Devices: All

Valid Trigger Channel:

 0 = PChannel1
1 =  PChannel2
2 =  PChannel3
3 =  PChannel4
...
15 = PChannel16

100 =  Digital0
101 =  Digital1
102 =  Digital2
...
107 = Digital7

The following use DigitalPort as Counter

200 =  L2HCounter0
201 =  L2HCounter1
202 =  L2HCounter2
...
207 = L2HCounter7

300 =  H2LCounter0
301 =  H2LCounter1
302 =  H2LCounter2
...
307 = H2LCounter7

TriggerLevel  (integer) specifies the threshold for trigger mode (default: 0)

Applicable Devices: All

Valid numbers:

Analog channels: -32768 to 32768
Digital channels: 0 and 1
EventCounters: Any positive numbers

TriggerStatus  (integer) returns the states of trigger mode

Applicable Devices: All

Possible returns:

0 = Filling PreTrigger Buffer
1 = Waiting for initial state
2 = Waiting for level crossing
3 = Filling PostTrigger Buffer
4 = TriggerDone 

Methods:

int AnalogInput  (int channel) returns the immediate reading from an enabled analog channel. You must use the ChannelCount property to enable the appropriate channel before you can invoke this method to get the readings from a specified channel. For example, to read from channel 0, 1, 2 and 3 of DI-194, you must have ChannelCount=4, also you must use the Key to enable multiple channel setting on the DI-194.

Applicable Devices: All

Valid channel: 0, 1, 2, 3 and more for UltimaSerial (version 2)

DI-190 has two analog channels (0, 1)
DI-150RS has two analog channels (0, 1)
DI-151RS has two analog channels (0, 1)
DI-154RS has four analog channels (0, 1, 2 and 3)
DI-194 has four analog channels (0, 1, 2 and 3)
DI-195B has two analog channel (0)

Max/Min Readings of the duration for UltimaSerial (version 2 or higher)

To catch the Maximum reading of a specified channel in the duration of the test (from the moment Start method is invoked to the moment of this method is invoked), add 1000 to the valid channel count mentioned above. i.e. 1000, 1001, 1002 and 1003

To catch the Minimum reading of a specified channel in the duration of the test (from the moment Start method is invoked to the moment of this method is invoked), add 2000 to the valid channel count mentioned above. i.e.  2000, 2001, 2002 and 2003 

To convert the AD Readings, check here.

void DACOutput (data)   outputs via the DAC on DI-148/158. This method must be invoked after Start

Applicable Devices: DI-148/158 only

0000 = 0.0 volt
7FF8 = 1.2 volt

The DACs are not calibrated.

Data2Volt converts binary data according  to the equation

Applicable Devices: DI-71x only. Other device will be treated as input range of +/-10V

Since the newer DATAQ starter kits support non-voltage inputs, such as Rate, Counter and Digital, this method is obviously obsolete.

int DigitalInput (int channel) returns the states of digital channels. This method must be invoked after Start 

You may need to invoke SetDIODir or use Dataq Hardware Manager to configure the direction of DIO port first

Valid channel: 0, 1, ... 8.

Applicable Devices: All

DI-190 has two digital channels (0, 1) labeled as Dig 0 & Dig 1
DI-151RS has two digital channels (0, 1) labeled as Dig 0 & Dig 1
DI-154RS has two digital channels (0, 1) labeled as D0 &  D1 (D2 is always a square wave output)
DI-194 has three digital channels (0, 1, 2) labeled as D0,  D1 & D2
DI-195B has one digital channel (0) labeled as DIN

DI-145 has 2 digital channels (I)
DI-148 has 4 digital channels (I/O)
DI-158 has 4 digital channels (I/O)
DI-710/715 has 8 digital channels (I/O)

If you try to access the digital channel which is not available on the device, the result is meaningless (see below for further explanation)

For some devices, digital inputs, same as transitional counters, are only available when a digital channel is enabled in the scan list:

DI-145, DI-190, DI-151, DI-154, DI-194, DI-195: No need to enable digital channels in scanlist. D0 & D1 are always available

DI-148 and 158: Only D0 & D1 are available if digital channel is not enabled. To access D2 & D3, digital channel must be enabled.

DI-7xx: Digital channel must be enabled to access the digital inputs

To enable a digital channel, you need to use codes like this:

UltimaSerial.Device = 148
UltimaSerial.CommPort = 0
UltimaSerial.AcquisitionMode = NoCondition
UltimaSerial.PChannel(0) = DIG_Chn
UltimaSerial.ChannelCount = 1
UltimaSerial.EventLevel = 2

UltimaSerial.SampleRate = 20
UltimaSerial.Start

.......

void DigitalOutput (data) outputs via Digital output port if the direction of DIO port is set up to be output. This method must be invoked after Start

You may need to invoke SetDIODir or use Dataq Hardware Manager to configure the direction of DIO port first

Applicable Devices: DI-148/158/710/715/718 only

Port

Bit

0

1

D7

7

low

high

D6

6

low

high

D5

5

low

high

D4

4

low

high

D3

3

low

high

D2

2

low

high

D1

1

low

high

D0

0

low

high

dio = 0

If DO7isHigh Then diodir = diodir + 128
If DO6isHigh Then diodir = diodir + 64
If DO5isHigh Then diodir = diodir + 32
If DO4isHigh Then diodir = diodir + 16
If DO3isHigh Then diodir = diodir + 8
If DO2isHigh Then diodir = diodir + 4
If DO1isHigh Then diodir = diodir + 2
If DO0isHigh Then diodir = diodir + 1

UltimaSerial.DigitalOutput dio

GetData ensures waveform data continuity by passing a continuous stream of data to your program. GetData returns waveform data as a variant of two dimension 16-bit integer array. 

Syntax:     Dim A as variant

                A=Ultimaserial1.GetData

Applicable Devices: All

To access the data returned by GetData, you can take a look at the following example (If you are using VB.NET, please also check this one out):

Dim Channel1

Private Sub Command1_Click()

UltimaSerial.Device = 151
UltimaSerial.CommPort = 1
UltimaSerial.ChannelCount = 2

UltimaSerial.SampleRate = 240
UltimaSerial.EventLevel = 2
UltimaSerial.Start


End Sub

Private Sub UltimaSerial_NewData(ByVal Count As Integer)

V = UltimaSerial.GetData() 'The data will be returned to V as a variant 

cn = UBound(V, 1)    'cn  = number of channel -1
pts = UBound(V, 2)    'pts = number of data -1

ReDim Channel1(0, 0 To pts ) As Integer   
'create an array to accept channel1

For i = 0 To pts 
    Channel1(0, i) = V(0, i)    'Extract channel 1 from V
Next

DQChart1.Chart (Channel1)    'Plot channel 1

End Sub

                

GetDataEx: GetDataEx returns waveform data to an integer array as binary data. As long as you don't ask for more than what UltimaSerial has in its buffer,  GetDataEx, ensures waveform data continuity by passing a continuous stream of data to your program. For most C programmers, a variant of integer array returned by GetData is not what they would like to handle. In this case, it will be much easier to use GetDataEx to place the data directly to a pre-defined integer array.

Applicable Devices: All

Syntax:     Dim A(1000) as integer
                Ultimaserial1.GetDataEx A(0), Count

where A(0) is a pointer to the 16-bit integer array, A. Count, an integer, is the number of data points, not scans, that you are requesting (32,767 maximum). 

The data will be aligned with the first channel. If you enable more than one channel, you will have to sort out the data for each channel yourself. The order of data points is: Ch1, Ch2, Ch1, Ch2, Ch1, Ch2, .... (assuming you enable two channels)

Note: 
1) Make sure you have enough data available before you copy it.
2) Make sure the array allocated is large enough to store all the data requested.

To convert the AD Readings to voltage (assuming you are using -10 to +10V input range, which is the default for most of the serial devices):

For 14-bit devices like DI-71x :

Voltage = (FullScale/Gain) * (ADReading >>2)/8192

where >>2 means to shift the data to the right for 2 bits. In VB, you can use INT (ADReading/4)

For DI-158 :

Voltage = (FullScale/Gain) * (ADReading >>4)/2048

where >>4 means to shift the data to the right for 4 bits. In VB, you can use INT (ADReading/16)

For 12-bit devices like DI-195B, DI-190, DI-150RS, DI-151, DI-154RS and DI-148:

Voltage = 10 * (ADReading >>4)/2048

where >>4 means to shift the data to the right for 4 bits. In VB, you can use INT (ADReading/16)

For 8-bit devices like DI-194:

Voltage = 10 * (ADReading >>8)/128

where >>8 means to shift the data to the right for 8 bits. In VB, you can use INT (ADReading/256)

For 10-bit devices like DI-194RS:

Voltage = 10 * (ADReading >>6)/512

where >>6 means to shift the data to the right for 6 bits. In VB, you can use INT (ADReading/64)

If you don't mind the little error caused by the integer calculation (up to 1 LSB of the ADC), you can always use:

Voltage = 10 * ADReading/32768

variant GetDataFrame (int Count)  returns the most recent specified number of data frames as acquired by the control to a variant without affecting the continuity of the data stream. One frame is equivalent to one sample of each active channel. Click here to find out how to extract the data from the variant.

Applicable Devices: All

Variables: Count is an integer and defines the number of scans you are requesting. The maximum number of scans you can request is 8,000.

For example: UltimaSerial.GetDataFrame Count 

int GetDataFrameEx (short * Array, int Count) returns the most recent specified number of data frames as acquired by the control  to an integer array without affecting the continuity of the data stream. One frame is equivalent to one sample from every active channel. GetDataFrameEx returns binary data. If you enable more than one channel, you will have to sort out the data for each channel yourself. The order of data points is: Ch1, Ch2, Ch1, Ch2, Ch1, Ch2, .... (assuming you enable two channels)

Applicable Devices: All

For example:: UltimaSerial.GetDataFrameEx A(0),Count

A(0) is a pointer to the 16-bit integer array, A. Count, an integer, is the number of data points, not scans, that you are requesting (30,000 maximum). The data will be aligned with the first channel.

To convert the AD Readings, check here.

GetDataPt Instead of using GetData and GetDataEx, you can use GetDataPt to retrieve one data point at a time. This function is provided for primitive programming language that doesn't support variant output or array transfer. 

Applicable Devices: All

GetDescription gets the Description of the USB-based device, to change the description, use SetDescription. This method must be invoked after Start

Applicable Devices: DI-148/158/710/715/718 only

MapErrorMessage  (int errorcode) as string maps the error code returned by the control to a brief description of the problem. Here is the map if you want to do it yourself:

Applicable Devices: All

-1: Invalid device name
-2: Invalid COMM port
-3: Invalid channel count. Original channel count is unmodified
-4: Sample out of possible range
-5: Invalid channel count. Channel count is changed to 1
-10: Trigger Level too high, and will be changed to 32767
-11: Trigger Level too low, and will be changed to -32768
-12: This trigger mode does not use pre- nor post- trigger length
-13: Unsupported trigger mode
-14: Unsupported trigger channel
-15: This channel does not support alarm setting
-998: Failed to communicate to the device
-999: Failed to send key to DI-194
-1000: Invalid key to DI-194! Channel Count changes to 1
-3000: Failed to create monitoring process, please poll the data from VB Timer function
-800: COM port is not available

MatchSerialNumber if this is set. A pre-assigned Serialnumber must be matched before the device is open. This feature is useful when multiple 710/158/148s/145 are connected to the same PC. 

Applicable Devices: DI-145/148/158/710/715/718 only

Note: Only the first eight characters are used in the comparison.

PChannel(index) changes Programmable Channel allocation table, or scanlist if you are using Dataq's term. This method must be invoked before Start

Applicable Devices: DI-145/148/149/155/158/710/715/718 only. Please note, DI-145/149/155's channel assignment must be in low to high order, meaning you cannot have PChannel(0)=1, PChannel(1)=0, but you can have PChannel(0)=2, PChannel(1)=8

When Ultimaserial is first loaded, the channel allocation table is 1, 2, 3,...16 (all single-ended), all with gain index of 0.

  • For DI-710/715/718

    If you need to alter it to 1 SE, 3DIFF, 2SE, 4DIFF, invoke the following codes

    PChannel(0)=CH01_SE

    PChannel(1)=DIFF_03

    PChannel(2)=CH02_SE

    PChannel(3)=DIFF_04

  • For DI-149/155. 

    Please note, DI-145/149/155's channel assignment must be in low to high order, meaning you cannot have PChannel(0)=1, PChannel(1)=0, but you can have PChannel(0)=2, PChannel(1)=8

    Always use CH0x_SE channels. The DIFF channels are reserved for devices that requires two SE channels to form a DIFF channel, like DI-710

    Channel 8 is always digital input, Channel 9 is always Rate input, and Channel 10 is always a 14-bit Counter input. Please refer to DI-149 protocol or DI-155 protocol for more detail

PGain(index) changes Programmable Gain table. This method must be invoked before Start. The default value for gain index is 0

Applicable Devices: DI-155/DI-149/148/158/710/715/718 only

PGain goes in parallel with PChannel.

If we have the following codes:

PGain(0)=0

PGain(1)=1

PGain(2)=2

PGain(3)=3

along with the above codes for PChannel, we assign the lowest gain for 1SE, second lowest gain for 3DIFF, 3rd gain for 2SE, and 4th gain for 4DIFF

For DI-149 and DI-144, the rate channel has gain control. Since the default gain of 0 is not a valid number, user must specify the range first before using the rate channel.

Gain Index Rate Range
1 10000
2 5000
3 2000
4 1000
5 500
6 200
7 100
8 50
9 20
10 10
11 5
Others  N.A.

Please refer to DI-149 protocol or DI-155 protocol for more detail

RawData if set, internal digital calibration on DI-148/158/71x will not be applied. When RawData is set to TRUE, the lowest two bits of the first channel contains the state of D0 and D1

Applicable Devices: DI-148/158/710/715/718 only

void ResetCounter (int channel, int edge) resets a specified transitional counter

Applicable Devices: All

Valid channel: 0, 1 and 2 for digital channel 0, 1 and 2
Valid edge: 0, 1, where 0 is low-to-high transition, 1 is high-to-low.

The availability of a transitional counters can be found in here

ScanDevice (index) finds the available DI-148/158/710/715 devices connected to your PC. This feature is useful when multiple 710/158/148s are connected to the same PC. 

Applicable Devices: DI-148/158/710/715/718 only

To initiate the search, set index =0. If a device is found, the return value is a positive number, which is the device's virtual COMM port +1, then you can use this number as the index number to search for the next device. If none is found, the return value is -1:

i = 0
UltimaSerial.Device=710
Do Until i = -1
    i = UltimaSerial.ScanDevice(i)
    If i <> -1 Then
        s = Format$(UltimaSerial.Device) + " " + UltimaSerial.SerialNumber
        List1.AddItem (s)
    End If
Loop

SetDIODir(data) sets the direction of DIO port for DI-148/158. This method must be invoked after Start

For DI-71x, please use Dataq Hardware Manager instead to set the direction of DIO port

Applicable Devices: DI-148/158 only

Port

Bit

0

1

D7

7

output

input

D6

6

output

input

D5

5

output

input

D4

4

output

input

D3

3

output

input

D2

2

output

input

D1

1

output

input

D0

0

output

input

diodir = 0

If DIO7isInput Then diodir = diodir + 128
If DIO6isInput Then diodir = diodir + 64
If DIO5isInput Then diodir = diodir + 32
If DIO4isInput Then diodir = diodir + 16
If DIO3isInput Then diodir = diodir + 8
If DIO2isInput Then diodir = diodir + 4
If DIO1isInput Then diodir = diodir + 2
If DIO0isInput Then diodir = diodir + 1

UltimaSerial.SetDIODir diodir

The availability of a digital inputs can be found in here

SetLimitLine (int type, int threshold) specifies the type of monitoring and threshold to be used in LimitLine operation. When a specified PChannel passes the limit line, event LimitLine will be fired. Each channel can have two limit lines, one for high limit and one for low limit. This method must be invoked before Start

Applicable Devices: All

Valid type:

0 = PChannel1Below
1 = PChannel1Above
2 = PChannel2Below
3 = PChannel2Above
4 = PChannel3Below
5 = PChannel3Above
6 = PChannel4Below
7 = PChannel4Above
...

Start: Start to acquire data.

Syntax: Ultimaserial1.start

Applicable Devices: All

Stop acquiring data.

Syntax:     Ultimaserial1.stop

Applicable Devices: All

void TransitionCounter (int channel, int edge) returns the contents of transitional counters. 

Applicable Devices: All

Valid channel: 0, 1 and 2 for digital channel 0, 1 and 2
Valid edge: 0, 1, where 0 is low-to-high transition, 1 is high-to-low.

Using the digital channels of the device as a transitional counter, we have:

DI-190 has two  low-to-high transitional counters, and two high-to-low transitional counters
DI-151RS has two  low-to-high transitional counters, and two high-to-low transitional counters
DI-154RS has two  low-to-high transitional counters, and two high-to-low transitional counters
DI-194 has three low-to-high transitional counters, and three high-to-low transitional counters
DI-195B has one low-to-high transitional counters, and one high-to-low transitional counters
...

The availability of a transition counter is the same as the foot note of digital inputs

 Events:

DriverError: Fired when an error is detected by the control. 

-1: Device not supported

-2: CommPort outside of range, which are from 0 to 64 for physical comm port, up to 255 for USB-based virtual comm port

-3: ChannelCount outside of range

-4: SampleRate >14400 or SampleRate<0

-10: Trigger level too high

-11: Trigger level too low 

-12: Invalid pre or post trigger length

-13: Invalid trigger channel

-800: Failed to open a physical COM port or find the USB device after scanning all possible virtual COM port

-999: Failed to issue command to the device

-998: Failed to send the unlock key to some older DATAQ devices or failed to send out the scanlist to new devices

-1000: Failed to match the key on some older DATAQ devices

-1234: Failed to start scanning

-3000: Failed to create a Timer 

 

 

GapInDataStream indicates a gap is detected in the data stream

LimitLine (Time as string, Channel as integer) indicates a pre-specified LimitLine is passed.

NewData: Fired when the number of new data points are equal to or higher than what is specified in the property of EventLevel.

Trigger (Timer as string) returns the closest moment of  triggering the monitoring process can determine.

 

Last update: 02/28/22

© www.ultimaserial.com