Quantcast
Channel: Measurement Studio for VB6 topics
Viewing all 323 articles
Browse latest View live

DAQmxSetAIADCTimingMode function not defined

$
0
0

 

I have a typical task creation, setup, read and stop process in VB6 code. The acquisition part is shown below. This code fails to compile when I include the Timing Mode call (bold). Sub or Function not found. If I remove the bolded line the code runs correctly and acquires data. However the default mode is HighResolution and I want HighSpeed.

 

Note that all Timing Mode Constants and Functions appear in NIDAQmx.h, and I can in fact get this device to work in HighResolution or HighSpeed mode using python. However I'd rather not have to rewrite the entire VB6 application because of a single function call if I can avoid it.

 

So why is this function not found? btw - I'm using DAQmx 14.2 on Windows XP 32bit

 

 

' create task

DAQmxErrChk DAQmxCreateTask("", taskHandle)


'Add an analog input thermocouple channel to the task.
DAQmxErrChk DAQmxCreateAIThrmcplChan(taskHandle, "cDAQ-9214/ai:0", "", minTemp, maxTemp, DAQmx_Val_TemperatureUnits1_DegC, _
                                                                                   DAQmx_Val_ThermocoupleType1_J_Type_TC, DAQmx_Val_CJCSource1_BuiltIn, 25, "")

 

' set timing mode
DAQmxErrChk DAQmxSetAIADCTimingMode(taskHandle, Ksystem.txtAIDev.Text, DAQmx_Val_HighSpeed)

 

'Configure task for finite sample acquisition and read in data
DAQmxErrChk DAQmxCfgSampClkTiming(taskHandle, "OnboardClock", frequency, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, numSampsPerChannel)

' Set up required memory space
DAQmxErrChk DAQmxGetTaskNumChans(taskHandle, numChannels)
arraySizeInSamps = numSampsPerChannel * numChannels
ReDim data(arraySizeInSamps)

' start the task and read data
DAQmxErrChk DAQmxStartTask(taskHandle)
DAQmxErrChk DAQmxReadAnalogF64(taskHandle, numSampsPerChannel, timeout, fillMode, data(0), arraySizeInSamps, sampsPerChanRead, ByVal 0&)

 

'Call the StopTask module to stop the DAQmx task.
DAQmxErrChk DAQmxStopTask(taskHandle)
DAQmxErrChk DAQmxClearTask(taskHandle)


Installing NIMax on legacy system

$
0
0

I just installed NIMS6 ver 8.1.2 Enterprise Edition and in the process NIMax got left out due to a newer version being installed. However, NIMS6 was previously uninstalled and the executable for NIMax is longer resident, except in name only in the registry. How do I get NIMax reinstalled back onto this sytem? Is there a way to "trick" the installation into thinking/knowing that NIMax is NOT installed already? 

 

This is a Dell Optiplex 260 running WinXP Pro. Yes, it's old, but it is what I have to deal with.

 

Thanks for any assistance.

FPGA vector signal transceiver

$
0
0

NEED HELP ASAP  .   please advice , see included

 
The litepoint IQ 2015 has the RF xmt and rcv  COMBINED on one output port.
This is how we want our NI  unit  to operate.
 
NI  FPGA Vector Signal Transceiver (which is broken up into 2 RF ports).
I think the reason they did this is so you could use 2 80 GHz bandwith VST's
in parallel to get the 160 MHz 802.11AC full traffic.  In that case it
requires multiple in, multiple out.  But most of my applications, I need to
run Single in, Single out.. 
So I would like to combine the RF In, and RF out just for convenience. 
 
Do you have a RF  combiner for the NI  FPGA Vector Signal Transceiver unit 's two  outputs ?
 
Can  NI  FPGA Vector Signal Transceiver  software multiplex   2 signals 
in parallel , 160 MHz 802.11AC full traffic and WiFI / Btoooth 2.5 GHz full traffic
within a  2 80 GHz bandwith  ?
 
Thank you
 
Travis Lee
e mail : Leetr@us.panasonic.com
 

USB-6212 - Generating 1.2kHz Square Wave (VB6)

$
0
0

Hi, 

 

I am rewriting existing NI-DAQ VB6 code that was written for the NI-6062E to VB6 DAQmx code for the NI USB-6212.  In my legacy NI-DAQ VB6 code (written for the 6062E) I was successfully generating a 1.2kHz square wave.  However, when trying to generate the same square wave using NI Measurement & Automation Explorer and the NI USB-6212, I consistently receive the following error message: Onboard device memory underflow. Because of system and/or bus-bandwidth limitations, the driver could not write data to the device fast enough to keep up with the device output rate.  Below is a screenshot of the error.

 

SquareWaveError.JPG

 

 

I've tried a variety of combinations for the "Samples to Write" and "Rate (Hz)" parameters such that the resulting waveform would still be at 1.2kHz but I consistently receive this same error.  Based on my research, it seems like my computer is unable to write to the NI-USB 6212 the necessary samples at a rate quick enough for the NI-USB 6212's buffer to not become empty.  However, when I run the "ContGenVoltWfmIntClk" example provided by NI, I observe the 1.2kHz square wave on my oscilloscope when using the following parameters. 

 

NIExampleSquareWave.JPG

 

 

Is the reason for the difference in behavior between each program due to additional overhead associated with attempting to generate the waveform by running NI Measurement & Automation Explorer?  If not, what are other potential causes for the behavior observed above?

 

Thanks,

 

Scott

daqmx 9.0.2 core installation error

$
0
0

Hello.

I'm trying to install the NI MAQ 902 Core Run-time package on my Windows 7 Professional 64bit (running as VM).  During the installation process, I'm getting an error "The NI MXS 4.6.0 installation has failed with the following error. Error 1722. There is a problem with this Windows Installer package.  A program run as part of the setup did not finish as expected......".

When I continue with the installation, the process runs to the end and I get a message that the installation failed, and that I should fix the error and try again. However it seems that the package was installed after all. The driver is installed and all the supporting files are present.  Also, what is interesting is that when I uninstall the National instrument software, and run the installer again, I do not get the error.  It only happens on ther first run.

 

Anybody has an idea what this may be?  And what can I do to fix this issue?

Thank you so much. 

Internal Routing Capabilities of USB 6212

$
0
0

Hi,

 

I am transitioning legacy NI-DAQ VB6 code written for the NI-6062E to DAQmx VB6 code which will now utilize the USB-6212.    From what I understand, the constant "ND_INT_AO_CH_1" (which is utilized in my legacy code) internally routes analog output channel 1 to the analog to digital converter.  Similiarly my understanding is the constant "ND_INT_AI_GND" internally routes analog input ground to the analog to digital converter.  I thought that I would be able to acheive a similiar result in DAQmx by utilizing the set of constants shown below (src: http://zone.ni.com/reference/en-XX/help/370466V-01/mxdevconsid/mseriesinterchan/). However, I wanted to confirm whether this approach is correct and if so, what are the appropriate contants in DAQmx that I should be utilizing in my code?  

 

 

Capture.JPG

 

 

Below is the relevant code snippet that I am rewriting.  

 

 

Public Function VoltageGet(ND_INT_AO_CH_1, Voltage As Double, Optional ResetCh As Boolean = True) As String
'// Returns the voltage measured on a given channel
    '// Configure channel for single-ended, bipolar operation
    iStatus = AI_Configure(iDevice, ND_INT_AO_CH_1, 1, 0, 0, 0)
    If iStatus <> 0 Then
        VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
        Exit Function
    End If
    If ResetCh Then
        '// Read in internal ground reference to dissipte any capactive charge left on the mux
        iStatus = AI_VRead(iDevice, ND_INT_AI_GND, -1, Voltage)
        If iStatus <> 0 Then
            VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
            Exit Function
        End If
        Delay 0.1
    End If
    '// Read in voltage of specfied channel
    iStatus = AI_VRead(iDevice, ND_INT_AO_CH_1, -1, Voltage)
    If iStatus <> 0 Then
        VoltageGet = "ERROR_DAQ - " & iStatus & " " & GetDAQError(iStatus)
        Exit Function
    End If
    VoltageGet = "PASS"
    Exit Function
End Function

 

qtp

$
0
0

Am a new bee in QTP automation script. I have two text files. One (Check.txt) is with fault code and description and another is (Ex.txt) with so many details along with fault code and fault snap shot. I need to compare both file that frst file fault code and description is available in second or not. Kindly suggest any code . Can perform this with array comparison ?

I need to filter in second file for specific content.
 
 
Thanx a lot in advance !!

VB6 with NI 9237

$
0
0

I am trying to run the VB6 sample program AckIntClk with an NI 9237 Daq module.   I get the following error “Error: -200431 Selected physical channel does not support the measurement type required by the virtual channel you are creating” 

I specify the channel as “cDaq1Mod1/ai0”.  What is the proper syntax or is this program not compatible with this DAQ? 

Any help woudl be appreciated.  Thanks

 

 


VBA dll labview Array

$
0
0

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

Signal verus Voltage

$
0
0

I have some basic questions.

 

Purpose:

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.

 

Thanks

David

      

data acquisition Ni - 6341USB, using drivers NIDAQmx on VB.net

$
0
0

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 VB.net

 

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)
      

  Do
            For I As Integer = 0 To Ns - 1        

            Vel(I) = v(I) * kV
    

        Next
            'writer.WriteMultiSample(True, Vel) 'synchronous
           

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

myTask.WaitUntilDone()
           

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

a CWGraph is an 'evaluation copy'

$
0
0

Hi,

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?

 

thanks!

 

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 "

ibsta=&H 8000iberr = 7

$
0
0

Hello

 

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

 

VBA Excel

$
0
0

Hello,

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)

  

Please convert from VB.net to VB6

$
0
0

Hello, 

 

we got a bit of code to read out data coming to a NI pci dio 32hs device. It is written in vb.net, 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!


EXCEl VBA USB and LAN

$
0
0

Hello,

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.

Thanks,

Leyo Joseph

Datagrid question

$
0
0

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 VB.net only show 1 line of data (the lastest). Is it possible to display all measured data in the Datagrid?

thanks a lot!

Changing to Local mode

$
0
0

Hello,

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" <As per manual this command takes back to Local mode

PMO.IO.Close

Set PMO.IO = Nothing

 

Thanks,

Leyo

 

CWSerial TIMEOUT

$
0
0

Hello,
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
Daniele

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

$
0
0

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.

 

 

  

saludos!

Viewing all 323 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>