Subscribe: Measurement Studio for VB6
Added By: Feedage Forager Feedage Grade B rated
Language: English
data  error  excel vba  excel  labview  measurement studio  program  signal  studio  task  time  usb  vba  visual basic  visual 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Measurement Studio for VB6

Measurement Studio for VB6 topics

Measurement Studio for VB6 topics

Published: Fri, 23 Mar 2018 15:51:00 GMT2018-03-23T15:51:00Z


Data socket, iTools OPC Server and Active X.

Wed, 21 Mar 2018 09:00:20 GMT2018-03-21T09:00:20Z

Dear All,

 I have a data logging application, written in LabVIEW, which reads temperature data from OPC server, every second, using the data socket VIs.


 The problem which I am experiencing, is that the Data socket drivers use Active X and this runs in the User thread.  Hence front panel activity on the PC can affect this one second timing. For example, if I open a file dialogue data reading will halt until the dialogue is closed. 


Has anyone come across an alternative way to read from OPC server without this problem?  Dot net, or TCPIP maybe? 







Simultanously input read and output write signals via VBA / DAQmx same time at different sample rates

Fri, 26 Jan 2018 10:19:53 GMT2018-01-26T10:19:53Z

This seems to be a fundamental mesurement topic to me. I recently working on my first DAQmx project for a automotive testing company using Excel 2013 VBA. I am trying to generate a voltage signal and simultanously sample voltage and current signals at different sample rates.


Based on some old confusing posts in this forum and due to driver error message "The specified resource is reserved. The operation could not be completed as specified.", i was afraid, if i have to install a second DAQ board in to my PC, to aquire additional inputs or to let additional tasks run simultanously, i.e. at different sample rates?


One of these confusing posts are found in topic "Re: DAQmx digital slow compared to Trad DAQ" from member Jonathan_Brumley, which is mentionen here as "principal software architect for the NI-DAQmx driver framework". So it should be relevant Information.


He said: "With DAQmx, you can have input and output tasks at the same time as long as the tasks are not reading and writing at the same time."


Is that correct and what does this mean in practice, if so?


This would be disappointing. But I did more investigation and tried out program code to run a write-task and read-task at the same time for analog-voltage-signals on a 6259 Card (M-Series) and it worked!
The only thing what doesn't work - so far i understand the concepts - is reading on multiple channels at different speeds at the same time, due to limited count on timing engines. The documentation says somewhere, there is exactly one timing engine for each subsystem on most of the NI-cards. For example as subsystems on a 6259 i see AnalogIn, AnalogOut, DigitalIn, DigitalOut, Counter1 and Counter2, if i understood it correctly (also reflected in the count of DMA-channels available/reserved using a PCI-card version of the 6259).
So for me it's possible to generate a signal via output while reading another signal via inputs the same time!


But not reading many inputs at different rates. Still i find this disappointing, that only one timing engine per subsystem is available on most NI-cards.


And even more frustrating i find the fact, that an analog-input task couldn't be started, while another analog-input task at another sample rate is already running, even the second task is using aquisition mode ON DEMAND only! This means, i cannot even read a slowly varying temperature signal not even once per minute, while i have a high-speed input task running. This limitation shouldn't exist on a high class hardware.
Or does anybody know a work around how to AnalogIn highspeed signal and lowspeed signals same time without adding the low-speed signal to the high speed signals task, which would cause a lot of redundant data and bus traffic? At least reading single values without timing (just on demand only) should be possible.


4 Point Calibration - I need help.

Thu, 21 Dec 2017 16:04:20 GMT2017-12-21T16:04:20Z

So this doesn't use Measurement Studio but I am dealing with VB.

I have a system that the original author used four points to 'calibrate' a system.  His code is not even remotely what you would call calibration.  The four known points, however, tell me that the system has nothing perpendicular nor parallel.

Using four known points, what are the equations to back-track to an origin and calibrate this thing?  It is an X-Y plane, no Z dimension involved.

The last time I needed to do this kind of math Ronald Reagan was the President.

Excel VBA missing References with LabVIEW LLB

Mon, 11 Dec 2017 15:01:03 GMT2017-12-11T15:01:03Z



I have an Excel file with VBA macros (not Measurement Studio VB6) calling a LabVIEW LLB and have no issues on my Developer's PC. When I transfer the Excel file to another computer that only has NI-MAX and LabVIEW run-times (see screenshots), Its telling me that I'm Missing References to some LabVIEW.


First of all, can LLB be called and used without a LabVIEW license?

I cannot find any information about the missing References or how I can get them.

The LabVIEW 2011 code is created using DAQmx 14.5.1, which has seen no compatibility issue with DAQmx 9.3.5 in the past.








use a USB6001 DAQ in a visual basic application

Fri, 17 Nov 2017 03:07:55 GMT2017-11-17T03:07:55Z

Can you answer these questions for me …………..?


  1. My goal is to make a DAQ based automated tester – I will stimulate a circuit and measure and evaluate the circuit’s response. I am new to the USB-6001 DAQ and fairly new to Visual Basic.
  2. How do I get a USB-6001 DAQ to talk to/listen to a Visual Basic application? I am using Visual Studio 2017.  If there is a better Visual Basic version, please advise.
  3. Where is there reference information to learn how to use a USB-6001 DAQ with a Visual Basic application?
  4. Is there a WAIT command (a time delay and to free up CPU resources) for Visual Basic as there is for LabView? What is it’s name in Visual Basic?

Problems with export styles of measurement studio activex component

Wed, 11 Oct 2017 08:50:28 GMT2017-10-11T08:50:28Z

I have problems with exporting style to .cwx file. It finishes with error. Can me help somebody?

CWGraph plotarea align with CWSlide

Mon, 28 Aug 2017 08:30:27 GMT2017-08-28T08:30:27Z


In my software GUI, there is a CWSlide which needs to align with CWGraph plotarea.

Based on the search in this forum, I think it is not possible to retrieve the plotarea X-coordinate from CWGraph class since it is not Exposed.

Anybody can give some idea? Anyway the exact X position is not necessary to me, what I need is to set CWSlide.X = CWGraph.Plotarea.X and CWSlide.width = CWGraph.plotrea.width

Thanks very much!!!

NI USB device memory underflow (error 88709)

Tue, 21 Mar 2017 21:31:45 GMT2017-03-21T21:31:45Z

I'm communicating with a USB-6251 and a USB-6221 with a VB6 program. When I jump up to a higher sampling rate, after a couple hours the program will return with an error 88709, saying that the onboard device memory underflowed. What's odd is that it only appears on some computers, and at different rates. Some computers can run for days before the problem occurs, others it never occurs at all, and others it crashes within minutes or hours.


I've been trying for a while to locate what is causing the error to no avail, and am looking for a different solution. What I'd like to do is have the program catch the error, and when the error occurs, just clear the data stream and allow the program to continue instead of having the program crash. Does anybody know how I can do this in VB?

Alguna daq que pueda obtener datos analogos de una celda de fuerza?

Wed, 08 Mar 2017 16:08:50 GMT2017-03-08T16:08:50Z

tengo una aplicacion donde tengo que medir la fuerza por medio de una celda de fuerza marca futek y quiero saber si existe alguna daq capaz de tomar el dato.






Mon, 06 Mar 2017 12:25:40 GMT2017-03-06T12:25:40Z

for the first time I'm trying to use the CWSERIAL control.
it works but i have only a problem:
I'm using the control with a battery instrument and i'm not able to find the way to understand when the device is powered off , before the timeout error appear. in the NI program sample i've not found indication. the device i'm try to control, send a string after my request.
Some Help?
Best regards

Changing to Local mode

Sat, 04 Feb 2017 18:40:38 GMT2017-02-04T18:40:38Z


I am using   Excel VBA for instrumentation with visacomm. I have sissues taking back the instruments to local mode after completeion of the data collection. For example, the bleow code is for  Recalling a state  keysight power meter N1912A and move to local mode. For some reason this is not taking back the power meter to Local mode.

Dim PMO As VisaComLib.FormattedIO488

Set PMO = New VisaComLib.FormattedIO488

 Set PMO.IO = ioMgr.Open("PMO")

PMO.WriteString "*RCL 4"
PMO.WriteString "SYST:LOC"


Set PMO.IO = Nothing





Datagrid question

Fri, 09 Dec 2016 09:36:03 GMT2016-12-09T09:36:03Z

Dear all,

I just began designing a temperature measuring system with a NI USB TC-01 device. The code is based on the example located at "c:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DotNET4.0\Analog In\Measure Voltage\AcqMultVoltageSamples_SWTimed\VB\MainForm.vb".

However, the Datagrid in only show 1 line of data (the lastest). Is it possible to display all measured data in the Datagrid?

thanks a lot!


Thu, 17 Nov 2016 18:46:21 GMT2016-11-17T18:46:21Z


I have been using EXCEL VBA to communicate and collect data from my test instruments using EXCEl VBA macros on GPIB bus. I have two modules from NI installed in my Excel VBA ( NI-488 DLL entry function declarations and This module contains the variable declarations,
' constant definitions, and type information that
' is recognized by the entire application.). This is working fine.

Now I am connecting many of my new instruments by LAN and USB. I want  to use excel VBA to talk to these instruments on LAN and  USB and collect data. Please help me on this. Is there any  excel vba modules I can download (Similar to GPIB modules I mentioned earlier) from NI  fo this LAN and USB communication?

Appreciate your help.


Leyo Joseph

Please convert from to VB6

Mon, 24 Oct 2016 12:19:21 GMT2016-10-24T12:19:21Z



we got a bit of code to read out data coming to a NI pci dio 32hs device. It is written in, but our measurement software runs in vb6. Is it possible to convert this code to vb6? 



newTask = New Task()
'Create a task that uses all digital ports as a single channel.
newTask.DIChannels.CreateChannel("Dev1/Port0_32", "", ChannelLineGrouping.OneChannelForAllLines)
newTask.Timing.ConfigureHandshakingBurstExportClock("/Dev1/PFI4", 10000000, DigitalLevelPauseTriggerCondition.High, ReadyForTransferEventLevelActiveLevel.ActiveHigh, SampleClockPulsePolarity.ActiveHigh, SampleQuantityMode.FiniteSamples, 128 * numScans.Value)
reader = New DigitalSingleChannelReader(newTask.Stream)

'Wait until all desired samples are read.
newData = reader.ReadMultiSamplePortUInt32(-1)

Thanks in advance!

VBA Excel

Tue, 09 Aug 2016 08:39:09 GMT2016-08-09T08:39:09Z


I am using Excel VBA and visa32.dll to communicate with dmm Keithley2700 by using serial port. However it seems that I cannot write/read to/from the equipment. Below are the codes that I am struggling and stuck. I really appreciate any advice or sharing some example. Thank you.


Dim stat As ViStatus
Dim defaultRM As ViSession
Dim instr As ViSession
Dim retCount As Long
Dim sesn As ViSession
Dim buffer As String
Dim idnResult As String

stat = viOpenDefaultRM(defaultRM)
If (stat < VI_SUCCESS) Then
Rem Error initializing VISA...exiting
Cells(1, 3).Value = Error
Exit Sub
End If

stat = viOpen(defaultRM, "ASRL3::INSTR", 0, 50, sesn)
stat = viSetAttribute(sesn, VI_ATTR_TMO_VALUE, 5000)
stat = viWrite(sesn, "*IDN?", 5, retCount)
stat = viRead(sesn, idnResult, 72, retCount)

Cells(1, 4).Value = idnResult

stat = viClose(sesn)
stat = viClose(defaultRM)


ibsta=&H 8000iberr = 7

Sun, 17 Apr 2016 15:50:27 GMT2016-04-17T15:50:27Z



I have written an application in visual basic 6.0 which tests for the correct operation of a controller via USB.

I get the following error message


Unable to open Device

Ibsta= &H

8000iberr = 7


What I want to know is: -


What is the failure?

Is it to do with the routine of calls to the device?



Any help on this matter would be greatly appreciated


a CWGraph is an 'evaluation copy'

Thu, 14 Apr 2016 19:59:12 GMT2016-04-14T19:59:12Z


I use "windows 8.1, VB6, Measurement &  automation"  to work for  a long time, everything is running well, but my computer broken last mouth,

then I refresh my computer and reinstall all program,

1. install VB6 with windows 8, (upgrade to windows 8.1     2 day late)

2. install NI driver 9.0.2  ( support VB6)

3. install " Measurement Studio 8.1.2 Enterprise Edition for Visual studio 6.0 " from Labview 2010 DS2 DVD ( no install Labview)

the message show "Runtime Error!  Program: H:\Distributions\MS_VS6\setup.exe      R6025 - pure virtual function call" then exit


I use my software setup file to install  & run my software( try register old version to the computer),the .exe file working well,

 when I open the software with VB6 to edit,  it show cwui error "error loading control. A newer version needed. the default setting for the control will be used." 

and CWGraph is 'evaluation copy' ( the other component ex: CWButton,CWNumEdit  is OK ), How can I fix? somebody can help?




ps: Labview 2010 DS2 DVD not for windows 8 but it's last version with  " Measurement Studio 8.1.2 Enterprise Edition for Visual studio 6.0 "

data acquisition Ni - 6341USB, using drivers NIDAQmx on

Tue, 05 Apr 2016 09:49:11 GMT2016-04-05T09:49:11Z

Hi there, i have a problem using MyTask.Timing function.


I would like to know how I can controll the samplerate frequency; while using MyTask i noticed that it doesn't make the expected cycles but only the first.

I can only control the data sampling rate on Matlab with the .Rate option, but  i couldn't control it directly using


Thank You.


Private Sub btSTART_Click(sender As Object, e As EventArgs) Handles btSTART.Click

        NC = NumericUpDown1.Value 'numero di cicli

        Dim cycleIndex As Integer = 0

        If isJustHomed = True Then

xHome = Math.Round(AxMintController1.get_Pos(0) * CConv, 4)

End If

   Dim Vel(Ns - 1) As Double

        AxMintController1.set_Suspend(0, 0) 'Remove "hold"  to the engine

HoldBox.Checked = False

        Dim myTask As New Task                                 ' Assign a name to "task"

myTask.AOChannels.CreateVoltageChannel(ComboBoxMo.Text, "MOTOR", Convert.ToDouble(tbminMo.Text), Convert.ToDouble(tbmaxMo.Text), AOVoltageUnits.Volts)

myTask.Timing.ConfigureSampleClock("", TextBox7.Text, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples)

        Dim writer As AnalogSingleChannelWriter = New AnalogSingleChannelWriter(myTask.Stream)

            For I As Integer = 0 To Ns - 1        

            Vel(I) = v(I) * kV

            'writer.WriteMultiSample(True, Vel) 'synchronous

writer.BeginWriteMultiSample(True, Vel, Nothing, Nothing) 'Asynchronous


xStop = Math.Round(AxMintController1.get_Pos(0) * CConv, 4)
            NC -= 1
            Label3.Text = NC
            TextBox11.Text = xStop - xHome
        Loop While NC <> 0

Signal verus Voltage

Sat, 02 Apr 2016 22:50:14 GMT2016-04-02T22:50:14Z

I have some basic questions.



Obtain the RPM value off of Chrylers CCD bus using ODB_I


What I've done

I've written a VB program to interface with the RS232 port using the API.

Researched the CCD bus  -- twisted pair with one wire (+), the other wire (-) -- running at 2.5 volts

I know the baud rate of the CCD bus signal.


What I think I Understand.

I believe (??) the signal is part of (i.e. rides on) the voltage.  Hence the signal -- RPM of interest -- needs to be extracted from the voltage.

Still doing research on the header and trailer bytes (or bits) and the identifying byte which will indicate that the RPM is the next data in sequence


Questions (What I don't understand)


1)   How do I connect the CCD bus to my RS232 port.?


2)  How do I go about separating the signal from the voltage so I don't kill my computer?


3)  How do I determine whether the CCD bus is putting out an analog or digital signal?

      If analog I know I'll need an analog to digital converter.


4)  Anything else that I should know but haven't asked.





VBA dll labview Array

Thu, 31 Mar 2016 10:01:50 GMT2016-03-31T10:01:50Z

I created a function in LabVIEW, and I  call it  from VBA ( Access in my case , but it would be the same from Excel). The idea is to pass parameters , and get back an array.

In the option of communicating with the function in VI , I have no problems, but when I compile and I try it with a  dll, It doesn´t work.


I´m only able to use double or integer parameters, but when I try to pass an array or cluster, I´m not able.


In the zip, it is the labview project , and two dll created differently ( in the word there is an explanation of both possibilities)


I have also added the Access to see the VBA code .


Anyway , I copied the VBA code :






Private Declare Function Salvar Lib "C:\ComunicacionVBA\SharedLib.dll" (ByVal y As Double, ByVal x As Double, ByRef Vector As Variant, ByRef Longitud As Integer) As Double
Private Declare Function Salvar2 Lib "C:\ComunicacionVBA\SharedLib2.dll" (ByVal y As Double, ByVal x As Double, ByRef Vector As Variant) As Double

Private Sub Comando2_Click()
Dim x, y As Double
Dim Vector As Variant
Dim Longitud As Integer

x = 1
y = 2

x = Salvar(y, x, Vector, Longitud)

MsgBox (x)

MsgBox (Longitud)

MsgBox (Vector)

End Sub

Private Sub Comando3_Click()
Dim x, y As Double
Dim Vector As Variant

x = 1
y = 2

x = Salvar2(y, x, Vector)

MsgBox (x)

MsgBox (Vector(0))

End Sub