Quantcast
Channel: Measurement Studio for VC++ topics
Viewing all 652 articles
Browse latest View live

NI Daqmx 17 and FGEN 17 Isuues with Microsoft VS 2010 C++ Projects

$
0
0

Hi all

I am using MS VS 2010 along with NI DAQmx and NI FGEN for some time without any problem. However, when i updated older  DAQmx and FGEN (Version 16 and before) with newer version 17, i got a strange problem in MS VS 2010.

 

The problem is whenever, i try to edit or write code (in c++ e.g.), it takes too much time to even write/edit a single line code. The cursor pointer halt and continues to blink for some time even for single change in code. 

 

As i uninstall Version 7, the problem vanishes but as soon as i reinstall this version, same problem starts to occur. I have also tried to uninstall and reinstall MS VS 2010 many times but could not rectify this problem.

 

Note: As far as functionality is concerned, MS VS 2010 works fine with Version 17 (C APIs of DAQmx and FGEN are working fine), only problem is during writing/editing the code.

 

Kindly help me in this regard

 

Thanks


Analog Pulse Trigger

$
0
0

All,

Given the code from the counter generate pulse, does anyone know how to trigger a voltage analog input collection using this pulse as the starting point?  The two hardware modules for the counter and voltage input are on the same chassis.  I want to queue the analog input and wait until the pulse is received.  Then, generate the pulse when I choose, through say a button click, which will start the voltage collection at the same time.  Needs to be through this pulse, as another device uses this pulse to start acquiring.  Currently I start both tasks back to back in the code as such:

DAQmxErrChk(DAQmxStartTask(taskHandle2));
DAQmxErrChk(DAQmxStartTask(taskHandle1));

were task2 is my pulse and task1 is my AIvoltage, but this is off by a certain number of milliseconds.

 

Any advice would be appreciated.  Thanks,

Synchronizing PCI 6281 and USB-6281 vs. two PCI 6281 cards

$
0
0

Hi,

 

I would like to configure a measurement system using two DAQs. 

 

One PCI 6281 card will get strain gauge signals from SCXI-1000 chassis. 

The other DAQ card will be used for analog and digital I/O. 

 

I have used an USB-6281 card for analog and digital I/O using buffered tasks. 

 

I guess if would I set two devices in a C program, I may call functions using two device IDs.

 

What would be a better choice for synchronizing process using the two DAQs?

 

Will there be any differences?

 

 

Best regards,

 

Byeong-uk.

Counter Output NI sample code not working..

$
0
0

Hi, 

 

I tried to run a sample program given in the following directory,

 

\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Generate Pulse\Dig Pulse Train-Cont-Buff-Implicit,

 

which is a buffered pulse output program with pre-determined duty ratios.

However, an error says that the counter writing function cannot be started before the task is started.

 

I am using USB-6281 M-series DAQ. Is this sample program not suitable to my device?

How can I then use such pre-determined duty arrays or real-time duty updates?

 

I am really looking forward to hearing from you..

 

Thank you.

 

Byeong-uk, Im.

 

ViSession contents

$
0
0

Hello,

 

Does anyone know what types of variables/functions/parameters are contained by a ViSession object?

Also, does a declaration ViSession m_InstrSession; initialize all of them properly?

I am trying to reproduce the single sweep example, in order to remotely control a ZNB8 model.
It's not working, returning me errors, as seen in the attached screenshot. 

I am suspecting that it has to do with some of the variables in the m_InstrSession object, the rest seem pretty standard. 

Any ideas?

 

Many thanks in advance. 

 

Panos from Impedans

 

 

Where can I download NI-IVI 1.61?

$
0
0

Hi, I was trying to install NI-Scope 2.0, but before I can install this software there is a prerequisite software that I need to install first, NI-IVI 1.61 or later.

 

Thank you.

ANSI C deployment missing dlls

$
0
0

Good morning,

I wrote a command line app using ANSI C header and lib files ( NIDAQmx.h and NIDAQmx.lib ). I am trying to deplying it but when I try to run it I get crash due to some missing dll.

 

Running dependendy walker on the *.exe and searching a bit in the NI posts seems that I need the nicaiu.dll so I manually copied it from system32 to the binary level but I still get the crash when trying to run it. So I ran dependency walker again but this time on the nicaiu.dll and seems that the dll need the nispylog.dll that I don't have in my system.

 

I would have a help on this, I need to know which dlls do I need to deploy my ansi c command line applications and I also need those dlls please.

I compiled my app with VS2012 ( I don't use dot net, only ansi c ). The VS dependencies are there.

 

Thank you

Franco

Migrating NI MS VS6 to latest [obsolescence management]

$
0
0

One of my clients wants to update his existing MXI system based on Windows 7 to Windows 10 with new computer hardware.

The system is PXI connected over Fiber with MXI PCI card on a 3rd gen Intel Xeon based server. The software is written in VC++ 6 with I guess measurement studio 6.

According to my knowledge and internet, Measurement Studio VC++ 6.0 is not supported by windows 7 but my client has its working on Windows 7. Their OEM somehow Configured it to work with Windows 7.

 

What I am supposed to do is:

- Update their computer to newer 8th gen based system

- Update Windows 7 to windows 10.

- Since source code is available, make it run on latest Measurement Studio

- Newer computers usually do not have PCI slots, can I use PCIe to PCI converter and mount MXI on it?

 

How much of it is possible?


Compilation warning with MS13 dll in Visual Studio 2015

$
0
0

Hi,

 

We have an application built with Visual Studio 2015. This was migrated from Measurement Studio 2013 to Measurement Studio 2015 but used dlls were not updated to match MS2015.

We have following three dlls from MS13 and it all works fine.

Name ----------------------------- Version

NationalInstruments.Analysis.Enterprise.dll 13.0.45.242

NationalInstruments.Common.dll 13.0.40.188

NationalInstruments.NiLmClientDLL.dll 13.0.40.188

 

problem starts when I add following two MS13 dlls to my project

NationalInstruments.UI.dll 13.0.45.282

NationalInstruments.UI.Styles3D.dll 13.0.45.282

 

I start getting compilation error for version mistach with system installed MS15 Dlls

 

 Severity Code Description Project File Line Suppression State
Error Exception occurred creating type 'NationalInstruments.Restricted.AnalysisLicenser, NationalInstruments.Analysis.Enterprise, Version=13.0.45.242, Culture=neutral, PublicKeyToken=4febd62461bf11a4' System.IO.FileNotFoundException: Could not load file or assembly 'NationalInstruments.Common, Version=17.5.40.49153, Culture=neutral, PublicKeyToken=dc6ad606294fc298' or one of its dependencies. The system cannot find the file specified. AxisParameters C:\GIT\PTest\AxisParameters\Properties\licenses.licx 1

 

and below is 'liecense.licx' file

NationalInstruments.Restricted.AnalysisLicenser, NationalInstruments.Analysis.Enterprise, Version=13.0.45.242, Culture=neutral, PublicKeyToken=4febd62461bf11a4

 

and below is entry in .csproj file

<Reference Include="NationalInstruments.Analysis.Enterprise, Version=13.0.45.242, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Resources\NationalInstruments.Analysis.Enterprise.dll</HintPath>
</Reference>
<Reference Include="NationalInstruments.Common, Version=13.0.40.188, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Resources\NationalInstruments.Common.dll</HintPath>
</Reference>
<Reference Include="NationalInstruments.NiLmClientDLL, Version=13.0.40.188, Culture=neutral, PublicKeyToken=4febd62461bf11a4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Resources\NationalInstruments.NiLmClientDLL.dll</HintPath>
</Reference>

 

How to avoid conflict between application's MS13 dll and system installed MS15 dlls?

ReadDigital32 writing out of bounds of array and freezing computer?

$
0
0

Hello all, I am a graduate student will little programming experience trying to modify our lab's code to use a new detector which interfaces to the computer with a NI PCI-6534 card.  The code is written in Borland C++ builder 6 and uses the ANSI C library support provided with the NIDAQmx drivers. 

I have been able to get data, but have run into problems when trying to run experiments and retrieve many scans.  After taking so many scans, the computer will freeze up completely, as in you must hold down the power button for a hard reset.  How many scans before this occurs is tied to how many accumulations are requested, higher accumulations will freeze the computer in fewer measurements.  It seems to be somehow related to the NIDAQmx ReadDigital32 function writing outside of the allocated bounds of the buffer array, as the computer only freezes when I include this step while executing the program, and purposefully making the buffer much larger, say 100x, only delays the freezing.  I

 

This is the our code that reads the data, I only copied enough of the GetScanData() function to show where it puts the data from the GetRawData() function:

 

bool MultiChDetector::getRawData(uInt32 *dbuffer, int nRawScans) {

   if (nRawScans>5000)   {
   last_error = "Bad number of accumulations" ;
   return false;
   }
    MeasurementTask acq_task;
    //One 32bit channel with 16 bit upper and lower words
    DAQ_ERR( DAQmxCreateDIChan(acq_task.h(), DAQ_DEVICE"/port0_32", "Port32", DAQmx_Val_ChanForAllLines) );

    DAQ_ERR( DAQmxCfgSampClkTiming(
        acq_task.h(),
        NULL, //internal clock
        10e6, //10 MHz
        DAQmx_Val_Rising,
        DAQmx_Val_FiniteSamps, //DAQmx_Val_ContSamps
        MCHD_CH_AMT*nRawScans) );

    DAQ_ERR( DAQmxCfgBurstHandshakingTimingExportClock(
        acq_task.h(),
        DAQmx_Val_FiniteSamps, //DAQmx_Val_ContSamps
        MCHD_CH_AMT*nRawScans,
        10e6, //10 MHz
        "/"DAQ_DEVICE"/PFI4",
        DAQmx_Val_ActiveHigh, //the polarity for exported sample clock: active high or active low
        DAQmx_Val_High, //whether the task pauses while the signal is high or low
        DAQmx_Val_ActiveHigh) ); //the polarity for the Ready for Transfer event (System Ready)

    double timeout_sec = 10.0 + nRawScans/1e3; //sec timeout, 1e3 = 1 kHz

    bool interactive_wait = false;

 if(interactive_wait) {
    DAQ_ERR( DAQmxStartTask(acq_task.h()) );   // don't forget to Stop Task

   
    int time0=GetTickCount();
    unsigned long isDone=false;
    do {
        Application->ProcessMessages();

        DAQ_ERR( DAQmxIsTaskDone(acq_task.h(), &isDone) );

        if(isDone) {
            break;
        }
        if( (GetTickCount()-time0)> int(1000*timeout_sec) ) {
            Application->MessageBox("Error", "Multi-channel data not ready in time", MB_OK);
            break;
        }
    }
    while(!isDone);

  }

    int32 nRead = 0;
 
   DAQ_ERR( DAQmxReadDigitalU32(
        acq_task.h(),
        MCHD_CH_AMT*nRawScans,
        timeout_sec,
        DAQmx_Val_GroupByChannel,
        dbuffer,
        MCHD_CH_AMT*nRawScans,
        &nRead,
        NULL) );

    if (nRead != MCHD_CH_AMT*nRawScans) {
        last_error = "Less amount of data was read";
        return false;
    }
    if(interactive_wait) {
        DAQ_ERR( DAQmxStopTask(acq_task.h()) );
    }
    /*thr_buffer = buffer;
    thr_counter = nRawScans*MCHD_CH_AMT;
    thr_request_scan = true;
    while (thr_counter);
    return true;
}
.................................
bool MultiChDetector::getScanDataS(float *destBuffer, ScanType scanType, bool subtractBackground, bool divideReference) {
    bool requestOK;
    bool* bad_points;
    bad_points = new bool[MCHD_CH_AMT];
       int het_extra_pts = 0;
    if (scanType==SetPhase12){
    het_extra_pts=3;
    }


    double *raw_data = (double *)calloc(MCHD_CH_AMT, sizeof(double));
    double *norm_data = (double *)calloc(64, sizeof(double));
    uInt16 *buffer = (uInt16 *)calloc(MCHD_CH_AMT*(nScans+het_extra_pts), sizeof(uInt16));
    uInt32 *dual_buffer = (uInt32*)calloc(MCHD_CH_AMT*(nScans+het_extra_pts+200), sizeof(uInt32));  //Furman
    //uInt16 *externalch = (uInt16*)calloc(16), sizeof(uInt16));
    try {
        if (!getRawData(dual_buffer, nScans+het_extra_pts)) {
            return false;
        }

    for(int d=0; d<nScans*MCHD_CH_AMT; d+=128){ //Discarding extra data from 16 external inputs and unused channels (up to 256) and skip first channel
        for (int a=0; a<64; a+=16){             //Separating the upper and lower words of the 32 bit samples dbuffer[0]->buffer[16,0], etc.
                for (int b=0; b<8; b++){        //FIFO reads out even then odd channels 0246...1357
                        buffer[(2*a)+(2*b)+d]=(uInt16)dual_buffer[a+b+(d+1)];
                        buffer[(2*a+16)+(2*b)+d]=(uInt16)(dual_buffer[a+b+(d+1)]>>16);
                        buffer[(2*a)+(2*b+1)+d]=(uInt16)dual_buffer[a+(b+8)+(d+1)];
                        buffer[(2*a+16)+(2*b+1)+d]=(uInt16)(dual_buffer[a+(b+8)+(d+1)]>>16);
                }
        }
   }
.................................
if (scanType == AccumulationScan) {
            for (int s = 0; s < nScans; ++s) {
                for (int c = 0; c < MCHD_CH_AMT; ++c) {
                    raw_data[c] += buffer[MCHD_CH_AMT*s + c];
                    }
            }
            for (int c = 0; c < MCHD_CH_AMT; ++c) {
                raw_data[c] /= nScans;
                raw_data[c] *= MCHD_COEFF;
            }
...........
 __finally {
        free(raw_data);
        free(norm_data);
        free(buffer);
        free(dual_buffer);
        delete[] bad_points;
    }

    return true;
}

This is the system information form NI MAX:

Operating System(OS)                     Windows 7 Professional
OS Version                               6.01.7601
OS Info                                  Service Pack 1
Processor                                Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz / x86 Family 6 Model 60 Stepping 3 / GenuineIntel / 3299 MHz
Number of Processors                     4
Physical Memory                          3.20 GB of RAM
Drive C:\                                108 GB of 232 GB free
                                         
National Instruments Software:           Version:
                                         
CVI Run-Time                             8.1.1.361
NI-DAQmx Device Driver                   15.5.1f0
NI-DAQmx ADE Support                     15.5.1
NI-DAQmx MAX Configuration               15.5.1
NI I/O Trace                             15.0.0f0
IVI Compliance Package                   4.0
LabVIEW Run-Time 2012 SP1 f5             12.0.1
Measurement & Automation Explorer        15.3.0f0
Measurement Studio                       Visual Studio 2005 Support - See individual versions below.
     DotNET                               
          Common                         8.7.20.131
Measurement Studio                       Visual Studio 2010 Support - See individual versions below.
     DotNET                               
          Common                         15.1.40.49152
          Common (64-bit)                15.1.40.49152
NI-USI                                   1.0.2
NI PXI Platform Services Configuration   15.0.0f1
NI PXI Platform Services Runtime         15.0.0f1
NI-PAL Software                          15.1.0
LabVIEW SignalExpress                    3.5
NI System Configuration                  15.3.0f0
NI-VISA                                  15.0.1
NI-VISA Runtime                          15.0.1
LabVIEW Run-Time 2014 SP1 f3             14.0.1
LabVIEW Run-Time 8.0.1                   8.0.1
LabVIEW Run-Time 8.2.1                   8.2.1
LabVIEW Run-Time 8.5.1                   8.5.1
LabVIEW Run-Time 8.6.1                   8.6.1
LabVIEW Run-Time 2009                    9.0.0
 
And finally, this is the version of the DAQmx library header:
/*============================================================================*/
/*                 National Instruments / Data Acquisition                    */
/*----------------------------------------------------------------------------*/
/*    Copyright (c) National Instruments 2003.  All Rights Reserved.          */
/*----------------------------------------------------------------------------*/
/*                                                                            */
/* Title:       NIDAQmx.h                                                     */
/* Purpose:     Include file for NI-DAQmx library support.                    */
/*                                                                            */
/*============================================================================*/
 
I know that I probably have not provided all needed information, I can attempt to describe further if needed, but as I said at the start, I really don't have much experience with computer programming
Thanks in advance for any help you may be able to provide.

ANSI C capturing samples from a NI-DAQmx continuously

$
0
0

Good morning to the forum,

I plugged a sinusoidal signal generator to my NI-DAQmx analog to digital board and I would develop an ansi-c application to read at regular intervals ( every x ms ) the sample of every channel ( the board has 32 channels )

 

I would have a help with this if possible

 

Thank you very much

 

Best Regards,

 

Franco

ANSI C: deal with something on every rising edge input

$
0
0

Hi everyone,

 

I need your help with this situation. Here is some information about my project.

NI USB-6501

NIDAQmxBase370, NIDAQ1501f3

Visual C++ 2008, Windows XP

 

What I need to do is:

There is a periodic signal input from the board to my computer.

The input period is ~ 330 ms. The pulse width is ~ 0.7 ms.

I need to deal with something every time the pulse appears.

 

I tried to do this by reading continuously, but some of the pulses were missed because my program can only deal with this data-reading thread every 1 ms.

 

Is there any smarter way to do this please?

 

I would have a help with this if possible.

 

Thank you very much!

 

Best Regards,

 

Liyan

an Issue Importing C++ dll library

$
0
0

HI all, 

THis is my first time n this form, Hopefully I am doing this right and I'm in the right place to ask the right question, 

I have a problem importing my VC++ dll to labview using the  tools>> import>>shared library.

The Issue is:-

When I navigate import>> shared library and follow the wizard and select my dll and my header file and hit next I can't see the functions in the my library. However if i go back and select shared library not in local machine and hit next I can see all the functions in my header files (which is a good step). but after following the wizard and it creates the subvi for my funcation and try to use it it errors out the following error 

"Call Library Function Node "Mydll" myfunction: function not found in library" The function name specified for this node cannot be found in the library. Right-click the Call Library Function node and select Configure, then choose the correct function name

 

I know that in my dll I have to instantiate an object then call my function as following :-

 

SNS  myObject

myObject.Myfunction ();

 

 

But I'm not sure how can i do that in Labview because the wizard generates subvis that calls myfunction"

 

 

Anyone here can help ? and I would like to find a solution without needing to write a C wrapper , I am sure there must be away to do that ????

 

 

Thanks

 

 

 

Error:C2664 in Visual Studio 2015

$
0
0

Using:

Visual Studio 2015 

NI-Usb6289

 

problme:C2664 'int32 DAQmxReadAnalogF64(TaskHandle,int32,float64,bool32,float64 [],uInt32,int32 *,bool32 *)': cannot convert argument 5 from 'float64 [2][1000]' to 'float64 []' .

 

if I use this function

"DAQmxErrChk(DAQmxReadAnalogF64(taskHandleTemperture, 1000, 10.0, DAQmx_Val_GroupByChannel, data, 2000, &read, NULL));",

the rule just can put in the one-dimensional array (only temperature or voltage), how can I use this function to read temperature and voltage in the same time?

this my initial contact, thank you for your help

 

 

complete code:http://codepad.org/rNTt12V2

A partial code:

int32 CVICALLBACK EveryNCallback1(TaskHandle taskHandleTemperture, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
{
int32 error = 0, written, j = 0;
char errBuff[2048] = { '\0' };
static int totalRead = 0, flag = 1, flag1 = 1, flag2 = 1;
int32 read = 0;
float64 data[2][1000], tmp, tmpT, dataVout[4000];
static float k = 0;
static float64 foreverbig;

 

/*********************************************/
// DAQmx Read Code
/*********************************************/
DAQmxErrChk(DAQmxReadAnalogF64(taskHandleTemperture, 1000, 10.0, DAQmx_Val_GroupByChannel, data, 2000, &read, NULL));

if (read > 0) {
for (int i = 0; i < 999; i++) {
fprintf(fp, "%0.3f %+0.4e %f\n", k, data[0][i], transferVoltage(data[0][i])); //Temperature 1
fprintf(fp1, "%0.3f %+0.4e\n", k, data[1][i]); //Voltage

k = k + 0.001;
}

 

for (int m = 0; m < 998; m++) {
for (int n = 0; n < 998 - m; n++) {
if (data[0][n + 1] > data[0][n]) {
tmpT = data[0][n];
data[0][n] = data[0][n + 1];
data[0][n + 1] = tmpT;
}
}
}

Future support

$
0
0

Hi all,

I'm starting again developing sw that interfaces with NI boards. In the past I used legacy Nidaq library under Visual Studio 6.0. Now I want to start again with a more up to date design. I'm thinking to Measurement Studio or only Nidaqmx libraries. There is a plan for a future support to Measurement Studio. Why the last update is for Visual Studio 2013? 


Creating a sub ms delay before acquisition

$
0
0

Hello,

 

I am currently working with the NI PXIe 6363 DAQ placed inside a PXIe-1073 chassis. I am controlling my DAQ using the DAQmx C API.

 

I want to initiate a precise delay on the sub millisecond scale before making an AI measurement. Since my computer is unlikely to offer such precision, I was hoping I could use the Onboard Clock of the chassis as a reference. Is there anyway I can initialize a delay on the PXIe DAQ using the clock of the chassis?

 

Thanks in advance,

 

Gabriel

Peak Detection Issue

$
0
0

CNiPeakDetector:Smiley Very HappyetectPeaks (Measurement Studio 2009 for VS2008) does not detect peaks anymore whereas CNiPeakDetector:Smiley Very HappyetectPeaks of Measurement Studio 6.0 didn’t have any problems for the same data to be analyzed.

Following workaround solves peak detection problem for small signals:

 

 

 

CAN Problem

NIVISIO8.H from old installation seems not to work in new installation

$
0
0

Hello

 

I'm software developer in Germany and have an old project, created by somebody else in 2009.

Our software uses a vision system. The camera is driven by our software, using commands like

imaqCreateImage, imaqSetImageSize, imaqEasyAcquire, imaqBCGTransform...

In general it works, the vision system delivers an image, which I can use.

But my customer  told me today, the settings like brightness, are not working any more.

The old installation was Win XP, and or software includes NIVISIO8.h

 

They changed the PC to a Win 7 PC and installed "NI Vision Acquisition Software 17.1" and  "NI Vision Runtime 2018"

 

Now my question is:

Is the NIVISIO8.h still the right choice?

Do I have to use another header file in my project?

Where can I receive the right one?

 

thanks for help

Sometimes NI VISA can't find USB-TMC device.

$
0
0

Hi,
I connect several USB Test and Measurement Devices to my PC and turn on these USB Test and Measurement Devices devices, then there is a case to not find some devices. I use NI-VISA 18.0 on windows 10. I tried some solutions but, it didn't resolve. I tried to change only NI-VISA version to 5.4, this problem doesn't occurred. But i should use NI-VISA 18.0 because of NI-VISA 5.4 doesn't support Windows 10.

 

Do you have any solution to solve this problem?

 

I tried disabling Fast Startup on Windows 10, updating USB Test and Measurement Device Driver. However, these solution did not lead to the resolution.

 

Viewing all 652 articles
Browse latest View live