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

Support for legacy software migration?

$
0
0

We have a legacy software application currently running in Windows 2003 server (x86) which we are planning to move it to Windows 2012 server.

 

Our existing application uses the below mentioned MeasurementStudio components v6.0.3.597.

1. cwui.ocx
2. instrsup.dll
3. mesa.dll

 

Please let us know whether the same version of the MeasurementStudio components (32-bit) will be supported in Windows 2012 Server?

 

Regards,


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

Provia Max

$
0
0

https ketoavis com/provia-max/

 

Install Measurement Studio C++ MFC Legacy for 2010

$
0
0

Where is the download for the legacy Measurement Studio C++ MFC for 2010? 

VS2017 v15.9.24 compatibility with NIVISA v17.0

$
0
0

I have been running a Visual Studio windows app under VS2017 using the NIVISA v 17.0 USB drivers for several years. In just the last week the app has failed to run. Investigating the problem under the VS debugger, it fails to come out of the call establishing a VISA session with error trapping enabled to the NI Global Resource Manager and just sits in limbo under the debugger. The executable just disappears. without any indication it ran or attempted to run. The code is as follows:

 

Imports NationalInstruments.Visa

...

Try
     intSessionCount = Ivi.Visa.GlobalResourceManager.Find("?*").Count
  Catch ex As Exception

    ...

 

 MS released a VS update (v15.9.24)not to long ago.

 

Is there a compatibility issue with the versions or is there something else going on? 

 

Appreciate any clues on where to go from here.

 

Don

IMAQ IMG_ATTR_LAST_VALID_FRAME overflow

$
0
0

Everyone,

I am not sure if this is the correct forum for IMAQ C questions, please move this thread if necessary.

We are using NI-IMAQ 18.0 and a 1433 PCIe framegrabber to read data from a line camera.
When querying IMG_ATTR_LAST_VALID_FRAME using the GetAttribute call, we get the expected results, but after 28 bits (i.e. 

roughly 268435455 frames), the value wraps around to 0. This is unexpected (since the value is an uInt32), undocumented and has caused systems to fail at our customers.

We would therefore like to know if this 28-bit restriction applies to all NI framegrabbers and software versions and what exactly the range of the value is. Is 2^28-1 the highest value ever returned from the function?

Thank you and best regards,
Bart

 

Upgrade to Win10/Visual Studio 2019

$
0
0

Hello,

 

We would like to upgrade an application using NI libs to Win10/Visual Studio 2019. It does not look that the libs supporting this upgrade are backward compatible. Meaning, symbols like CNiNumEdit and CNi4882Device  that used to exist in the include and lib directories are no longer in the x64 lib directory or include directory. In fact, they are only included in the legacy package.

 

This leads us to a rewrite of our old application instead of upgrading it.

 

Is my conclusion correct? 

Data logging of Voltage, Current and temperature to Excel Sheet with Data acquisiton

$
0
0

Screenshot (75).png

Hi, I have been trying to get a data from myRIO and then put the values onto excel sheet but I couldn't do so, my program aims to get the value of only voltage and then manually calculate the current and temperature on another array and plot it in excel sheet but I couldn't do it so...

 

can I get some help, please?


NI-6731基于C#语言怎么生成一个方波?是否会用到外部时钟?

$
0
0

我们决定用NI-6731的板卡,对相机输出一个方波,在生成波形时,遇到了时钟的问题。 如何生成一个连续的方波是核心问题

两个通道,两个任务同时进行

$
0
0

使用6731板卡,对X-Y轴的振镜做一个控制,我们想要两个振镜同时运转,请问怎么实现?

制作包含NI visa32.dll等所有必要支撑dll的仪器控制安装包。

$
0
0
您好,
 
我有一个需求:用C++语言开发仪器控制程序,用的工具是Visual studio 2017。计划用NI公司提供的visa32.dll等动态链接库,但是又不想麻烦客户另外安装NI的VISA相关软件。
请问如何在我的安装包里包含一切必要的NI visa相关dll?  或者有别的方便的操作,请指示。谢谢。

How to make an VISA programe in Visual Studio2017 without explicitly install NI-VISA?

$
0
0

Hello,

 

I want to make a program to control instrument. I'd like to include the visa32.dll and so on , in my install package. And do not want to bother custom to install NI-VISA first.

 

How could I make it happen?

 

Thanks a lot in advance.

Looking for C/C++ include files.

$
0
0

Hi,

I have been asked to fix a bug in a C++ program that uses the NI-488.2 driver.  The engineers that worked on the project before have all left the company. I have the source code to the project, but it appears they did not save the NI include files that are used in the project. So I can not find NiCommonComponent.h, NiGraph3DComponent.h, NiUiComponent.h and NiUiCommonComponent.h.

 

I searched this forum and I have seen others that are looking for various header files. It looked like I needed to down load "Measurements & Automation", when I looked for that; the NI site indicates that it is part of the other driver downloads. So I installed the NI-Visa driver. I selected the C/C++option as part of the install. But still no files. 

 

I am obviously missing something, either the wrong downloads or the wrong options.  This project is still being built with Visual Studio 6. No one knows why a newer version of Visual Studio is not being used.Maybe some license issue?

 

I have never worked with NI tools, so I know nothing about the program nor the NI products.

 

Thanks.

 

Is it a good idea to create an imperative language compiler targeted for LLVM with C++ using VS ?

$
0
0

I have compiler construction course in my university and we have to make a compiler as a final project. We chose C++ as our language and Yacc/Bison as Parser Dev tools (but compiler is for Imperative languages such as Pascal).

I have just started my 3rd year, today was the first lab and I don't know much yet about these things. Can I use Visual Studio 2019 as my IDE ? or I should install Linux and use something else?

Thanks in advance

Use DAQmxCreateAOVoltageChan() to create multiple output channels in VS2017

$
0
0

Hi, all:

I want to use c++ to control NI-USB-9263. 

First, when I create a single output channel as: 

DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,"cDAQ1Mod1/ao0","",0.0000,5.0000,DAQmx_Val_Volts,NULL));

There is no problem.

But when I want to create two output channels as:

for(;i<4000;i++)
data[i] = 5.0*(double)i/4000.0;
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,"cDAQ1Mod1/ao0","",0.0000,5.0000,DAQmx_Val_Volts,NULL));
DAQmxErrChk(DAQmxCreateAOVoltageChan(taskHandle, "cDAQ1Mod1/ao1", "", 0.0000, 5.0000, DAQmx_Val_Volts, NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",4000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,4000));
DAQmxErrChk (DAQmxWriteAnalogF64(taskHandle,4000,0,10.0,DAQmx_Val_GroupByChannel,data,&written,NULL));

......

an error occurs: attemped writing data that is too large or too small.

error code: -200561.

 

I am sure the voltage range is not beyond the limitation.

Could someone help to solve this question? Thank you so much.

 

Regards

Xiaoran


PXIe-1085 C code documentation

$
0
0

What C API do I use that can tell me how to get the serial from the PXIe-1085, and later send or retrieve data to any cards inserted?

 

Where can I find the C API for System Configuration API 17 functionality as well?

 

The readme for the PXI Platform Services 17.0 says to visit ni.com/info and enter the Info Code pximxisysmon." for more information about System Monitor features. This code does not exist.

 

Also, NI-DAQmx is the only API mentioned in the PXIe-1085 manual found here, is it only used for dynamic routing? Thanks.

 

Graphing RMS Voltages

$
0
0

In an AC circuit analysis how come graph only shows the DC voltage values but not RMS voltages?

Thanks

Visual studio without ni software

$
0
0

Hi!

 

I wanted to ask if there is a possibility of using NI hardware, but programming without any NI bought software. For example programming in Visual Studio without installing Measurement studio?

Is it a good idea to create an imperative language compiler targeted for LLVM with C++ using VS ?

$
0
0

I have compiler construction course in my university and we have to make a compiler as a final project. We chose C++ as our language and Yacc/Bison as Parser Dev tools (but compiler is for Imperative languages such as Pascal).

I have just started my 3rd year, today was the first lab and I don't know much yet about these things. Can I use Visual Studio 2019 as my IDE ? or I should install Linux and use something else?

Thanks in advance

Measurement Studio with Visual Studio 2019, MFC

$
0
0

Good day,

 

I'm looking for clarification on Measurement Studio compatibility with our current setup.

 

We have a C/C++ MFC application, originally built with Visual Studio 6, which links with a legacy version of Measurement Studio.

 

We're looking to port our application to use Visual Studio 2019, while keeping our C/C++ codebase.

 

Is this still supported today?

Viewing all 653 articles
Browse latest View live


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