Subscribe: Measurement Studio for VC++
http://forums.ni.com/rss/board?board.id=231
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
analog  code  control  daq  daqmx val  daqmx  measurement studio  measurement  mfc  path  return  studio  time  val  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 (3)

Feed Details and Statistics Feed Statistics
Preview: Measurement Studio for VC++

Measurement Studio for VC++ topics



Measurement Studio for VC++ topics



Published: Tue, 19 Sep 2017 22:51:47 GMT2017-09-19T22:51:47Z

 



HOW can i wrap the MPI parallel code into a DLL and use LabvIEW call it.

Wed, 23 Aug 2017 01:56:31 GMT2017-08-23T01:56:31Z

hi,I write my algorithm in C language by MPI (process-level parallel ). After that, I want to wrap the parallel code into a DLL(dynamic link library) and embed the DLL to LabVIEW. But the MPI must be started by mpiexec command. So, if I wrap the MPI code into a DLL, I cannot run the MPI code. can  LabVIEW support to process-level parallel in a DLL?  Can you give me some advice or else to run the MPI parallel code or else? Look forward for you replying.




NI6509 Watchdog timer expires prematurely

Tue, 15 Aug 2017 23:00:43 GMT2017-08-15T23:00:43Z

Hello,

I am using the Watchdog functionality of NI6509 PCI board.

The problem I am experiencing is that Watchdog time sometime expires prematurely.

Especially if I stop the watch dog and restart it again.

Please see the attached NI6509Controller.cpp, where I am defining following functions:

1) SetupWatchDogTask 

2) StopBoardTask

3) RunWatchDogThread

 

Basically my thread is running the thread function RunWatchDogThread, waiting to receive following commands:

- WD_START, WD_PUMP, WD_STOP  and calls the functions as described in the code.

Usually I am starting the Watchdog with timeout = 5s and start pumping with command WD_PUMP.

At some time I am stopping it by sending WD_STOP command, 

By this point the functionality works fine.

Next time I start the Watchdog( WD_START with 5s ), it stops prematurely within a second.

Could you please help?

Thanks in forward,




Install Measurement Studio C++ MFC Legacy for 2010

Tue, 08 Aug 2017 16:15:32 GMT2017-08-08T16:15:32Z

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




SCPI command not found

Fri, 21 Jul 2017 07:49:25 GMT2017-07-21T07:49:25Z

I am developping a auto-test program according to GPIB to connect to E4404B, spectrum analyzer, than I found some example code here, 

 

/*Reset the instrument*/
viPrintf(viESA,"*RST\n");
/*Set Y-Axis units to dBm*/
viPrintf(viESA, "UNIT(image) OW DBM\n");
/*Set the analyzer center frequency to 50MHZ*/
viPrintf(viESA,"SENS:FREQ:CENT 50e6\n");

 

the strange thing is that "UNIT(image) OW DBM" can not be found anywhere, in standard SCPI command or instrument specified command, does anyone can explain where this command comes from?




Suggestions for Accurate digital sampling and control program using M-series DAQ

Fri, 07 Jul 2017 16:23:36 GMT2017-07-07T16:23:36Z

Hi,   Recently, I found a method to develop a digital control program on C or C++, which uses the M-series NI DAQ device just as like other microprocessor units(e.g. ARM). My device is NI-USB 6281. I have searched for many example codes and manuals from NI.   I would like to share this for those who struggle to configure the DAQ settings for a digital control program such as a conventional PID control or a Linear Quadratic Regulator.   This program uses internal hardware clock to make sampling time. Since the M-series usb devices don't support any hardware-timed non-buffered actions, sampling tasks are based on buffered operation.     A counter is used as a reference clock for analog input or analog output.   Analog input task has an event call back function each time it gets an sample in its buffer.   This event function works as an interrupt service routine which increases a count value for soft-timed loop in every iteration. It fetches a sample from the buffer in the loop.   Analog output task writes dummy samples before it starts, and it regenerates output when the user calls the write functions in the loop. The major problem was that the analog output task is so hard to handle using NI-DAQs. They almost consume all of the loop sampling times. If one tries to use a OnDemand mode,(fully soft-timed mode) it will take about 2ms or more.   The main do-while loop will act asynchronously though the control script will be executed only once by the flag. This ensures the idling time for control code. (Using only flag to block the main code is really vulnerable, though. I would expect that someone could solve this and help me)   Using this looping method, I could achieve up to 1800Hz sampling rate without any time-delays. However, as the main soft-timed loop depends on the speed of processor, one could get only up to 1000Hz or 1500Hz. Nevertheless, this program ensures a rich sampling rate compared to the soft-ware timed program using Windows times.   If you have any inquiries or suggestions, please feel free to reply.   Best regards,   Byeong-uk, Im.   Im, Byeong UkMS Course |Active Aeroelasticity And Rotorcraft Lab. Mechanical And Aerospace Engineering |Seoul National University 1 Gwanak-Ro, Gwanak-Gu, Seoul, 151-744, Bd. 301, Room 1357 Tel:82-2-880-1901 |C.P.:82-10-2439-0451 |W:http://helicopter.snu.ac.kr  [...]



How I can run DLL generate from Labview in my MFC project?

Fri, 07 Jul 2017 09:38:25 GMT2017-07-07T09:38:25Z

Hi,

   Now, I need to use a dll ,which generated from labview,  to my MFC project. It seems like this, when I click a button on my MFC , pop the  application front panel (as see in the labveiw) . Anyone knows how can achieve it?




ANSI C example : "DAQmx Error: No device by the given name was found."

Wed, 21 Jun 2017 12:04:22 GMT2017-06-21T12:04:22Z

Hi everybody,

 

I'm trying to build and run a DAQmx ANSI C example, which is "/Analog Out/Generate Voltage/Cont Gen Volt Wfm-Ext Clk" (Windows 7 Pro, NI-DAQmx 17.1.0, NI-MAX 17.0.0).

 

I modify it to correspond to my PXIe-6361 virtual card and to build and run it without Visual Studio but just with gcc on Cygwin.

Here is attached the modified code and a screenshot of my virtual card configurations on MAX.

 

It builds but when I run it, it says : "No device by the given name was found" without any error code.

Nano@Nano-PC ..Gen Volt Wfm-Ext Clk-old $make && ./ContGen-ExtClk.exe
gcc.exe -g   -c -o ContGen-ExtClk.o ContGen-ExtClk.c
gcc.exe -g -o ContGen-ExtClk ContGen-ExtClk.o -lnidaqmx
TEST1
DAQmx Error: No device by the given name was found.
Explanation:
No device by the given name was found.
End of program, press Enter key to quit

I think the problem occurred during this function "DAQmxWriteAnalogF64"; because my TEST2 is not printed.

 

I don't know what's the problem and I didn't find any solution on the internet for this error message.

Do you have any idea?

 

Thanks and have a nice day.




Reading data through NI PCIe-8381 in Visual C++

Tue, 13 Jun 2017 07:37:40 GMT2017-06-13T07:37:40Z

Hi,
I would like to seek some guidance in accessing NI PCIe-8381 card using Visual C++.
The issue is that I need to read the data in my C/C++ application directly through the PCI-8381 card instead of LabView. This card is plugged in a general purpose PC and this card is connected to NI PXI-8381 card in PXI station.
I read online that DAQmx library lets you access NI cards this way, but I couldn't find any reference for PCIe-8381 as a support device.
Any guidance/help would be highly appreciated.
Kind Regards,
Bilal




CWButton Control classic image

Thu, 08 Jun 2017 12:21:07 GMT2017-06-08T12:21:07Z

Hi,

im using a CWButton control, classic style, with image, in an MFC dialog.   I want the image to appear "floating" on the black background but there is a thin silver frame around outside of perimeter that i cant change its color or delete it.   How can i do this?




Error 1304 happened on Win7 x86 while installing the package made by NI Measurement Studio Installer Builder

Fri, 19 May 2017 19:40:21 GMT2017-05-19T19:40:21Z

Hi,

 

We made the Installer package with the help of NI Measurement Studio Installer Builder. The Installer ran properly on Win7 x64 without any issue. But when we ran the Installer package on Win7 x86, an Error 1304 would pop-up to block the installation.

Has anybody encountered similar issue before? How to solve this problem? Please. advise.

I have attached the Screenshot for this Error and also the log created during the installation and the Merge Modules I added in the Installer for your reference. Appreciate your attention and help in advance.

 

Thanks,

Kevin 




Measurement Studio C++ MFC Legacy for visual C++ 2010

Sat, 13 May 2017 13:30:07 GMT2017-05-13T13:30:07Z

Hi,

How can I install Measurement Studio C++ MFC Legacy in VIsual C++ 2010? 

 

Please help me (image) ((((

 

Thank you very much!

 




Programming for NI USB 6221 by MFC (Visual C++)

Fri, 12 May 2017 02:50:56 GMT2017-05-12T02:50:56Z

Hi,

I have NI USB 6221 M-Series DAQ DEVICE. I want to programming for it by MFC (VISUAL C++). I use the Visual Studio 2013.

Thus, How can I do it? Who can guide to me step  by step?  Please help me?

 

Thank you very much!

 

Best,

 

Lam.

 




NI-DAQmx Base : Synchronize PC clock (QueryPerformanceCounter) with PCI 6221 analog input

Wed, 10 May 2017 11:33:50 GMT2017-05-10T11:33:50Z

I'm running a loop in windows7 which periodically polls the parallel port for a TTL signal while continuously reading samples at 1KHz for approx 1 hour. As a test, I split the incoming TTL and *also* read it as an analog signal. To my amazement, when I put the results next to each other after the test was done, i noticed that the time of the TTL and the time inside the analog data was NOT THE SAME.

 

more specifically, the timestamp of the TTL-up in my mainloop was 100msec *before* the timestamp in the analog data where I saw the voltage go up !

 

after much teeth-grinding and googling, I found that this is most likely caused by the PC clock drifting : http://www.windowstimestamp.com/description

 

my question is now : how can I sync this ? I have several options :

 

- use the library from http://www.windowstimestamp.com/description but that is quite a bit of work and will require additional DLLs to be installed

- figure out a way to use the clock of the 6221 card inside my mainloop where I poll the parallel port. 

 

is that possible ? Is there a way to ask the time of a TaskHandle ? Or should I use the 

DAQmxRegisterEveryNSamplesEvent() routine to do this ?




Convert std::string to LV path to apply to an dll generated from labview

Wed, 10 May 2017 11:24:08 GMT2017-05-10T11:24:08Z

Hi.

I am working with a dll-function generated from LV which needs an path type.

I would like to convert a std::string to LV-path and tried the following code.

 

    std::string v_PathAsString_o = "C:\\_work\\PowerSupply.ini";
    const char * v_path_pc = v_PathAsString_o.c_str();
    const char ** v_path_ppc = &v_path_pc;
    Path * v_Path_po = NULL;
    char **filename = 0;
    MgErr v_status_o = FStringToPath((ConstLStrH)v_path_ppc, v_Path_po);
    // v_status_o will be set to 2 (mFullErr)
    // v_Path_po remains 0x00000000

 

After sucessful compile and run I got status from FStringToPath() back and was set to mFullErr.

I cannot imagine that my Windows 7 PC is having trouble with memory space.

 

What is the right way to get a LV path variable?




How can I get NiVisa100D.lib?

Mon, 08 May 2017 10:45:07 GMT2017-05-08T10:45:07Z

First,please  allow me to introduce myself,I am a Chinese,my English is very poor,sorry to make you laught at me.

 

When I debugged my C project,the VS2012 signaled an error as the follow figure.But there is not  NiVisa100D.lib In my computer.I need help.

 

 

(image)




Control of two voltage channel by same triggering signal

Thu, 13 Apr 2017 17:56:56 GMT2017-04-13T17:56:56Z

Hello, I'm trying to control two galvo-mirrors by DAQmx. 

I wanted to use same triggering signal for both of mirrors, so I did the below tasks for both of mirrors. 

Create task->Create voltage channels->Receive clk signal from external source->

Create internal triggering->Write voltage to mirror->start task

The code is as below, but there is an error when DAQmxWriteAnalogF64 function is run sequentially.

Is there anything wrong? Thank you (image)  

 

int hr;
if((hr = DAQmxCreateTask("",&_hMirrorB)) < 0)
return hr;
if((hr = DAQmxCreateTask("",&_hMirrorC)) < 0)

return hr;
if((hr = DAQmxCreateAOVoltageChan(_hMirrorB, DAQ_AO0,"", _cfg.bscanMin,
_cfg.bscanMax, DAQmx_Val_Volts, "")) < 0)
return hr;

if((hr = DAQmxCreateAOVoltageChan(_hMirrorC, DAQ_AO0,"", _cfg.cscanMin,
_cfg.cscanMax, DAQmx_Val_Volts, "")) < 0)
return hr;
if((hr = DAQmxCfgSampClkTiming(_hMirrorB, DAQ_EXT, EXT_CLK,
DAQmx_Val_Falling, DAQmx_Val_ContSamps, _cfg.N0)) < 0)
return hr;

if((hr = DAQmxCfgSampClkTiming(_hMirrorC, DAQ_EXT, EXT_CLK,
DAQmx_Val_Falling, DAQmx_Val_ContSamps, _cfg.N0)) < 0)
return hr;
if((hr = DAQmxCfgDigEdgeStartTrig(_hMirrorB, DAQ_INT, DAQmx_Val_Rising)) < 0)
return hr;

if((hr = DAQmxCfgDigEdgeStartTrig(_hMirrorC, DAQ_INT, DAQmx_Val_Rising)) < 0)
return hr;
if((hr = DAQmxWriteAnalogF64(_hMirrorB, _cfg.N0, 0, 10.0,
DAQmx_Val_GroupByChannel, (float64*)_bscanWaveform, NULL, NULL)) < 0) {
return hr;
}

if((hr = DAQmxWriteAnalogF64(_hMirrorC, _cfg.N0, 0, 10.0,
DAQmx_Val_GroupByChannel, (float64*)_bscanWaveform, NULL, NULL)) < 0) {
return hr;
}

 

if((hr = DAQmxStartTask(_hMirrorB)) < 0)
return hr;

if((hr = DAQmxStartTask(_hMirrorC)) < 0)
return hr;




Measurement studio options for c++ in Visual Studio 2013

Mon, 03 Apr 2017 20:31:44 GMT2017-04-03T20:31:44Z

Greetings, I have installed Visual Studio 2013 and Measurement Studio 2015. When I try to select a new project with C++, there are no measurement studio options to select. However, if I select Visual Basic or Visual C#, both have measurement studio templates. Do I need to install something more?

Thanks,

Jack




Triggered AI Task Question

Mon, 20 Mar 2017 20:02:20 GMT2017-03-20T20:02:20Z

I would like to acquire data from multiple channels, started from an analogue trigger. The example program Acq-IntClk-AnlgStart is almost what I need but I have a question...

 

Once I have read the acquired data and read it using DAQmxReadAnalogF64, I would like to re-arm the trigger ready to acquire more data when the trigger conditions are met. I need to do this rcontinuously. What do I need to do to re-arm? Do I need to call DAQmxStopTask and/or DAQmxStartTask.

 

Thanks

 

Tony

 




Adding multiple channels to a task

Wed, 08 Mar 2017 14:32:32 GMT2017-03-08T14:32:32Z

Hi,

 

I have several thermocouple input modules in a Compact DAQ chassis and I would like to read all channels on EVERY module within the same task. All of the examples I have seen using DAQmxCreateAIVoltageChan() show the syntax to add all channels on a single module (e.g. "ai0:7") Is it possible to add channels from more than one module to a task in a single line or will I need to call DAQmxCreateAIVoltageChan() once for every module?

 

Thanks.

 




Thermocouple Channel influenced by other Voltage Channel

Thu, 02 Mar 2017 14:02:44 GMT2017-03-02T14:02:44Z

Hello,

I am using the BNC-2120 and a K-type Thermocouple (TC). On the software side I use C/C++ and DAQmx to acquire the temperature and some analog input signals (AI). While I was setting up the input channels, I noticed some odd behaviour.

If I create the TC-channel before the AI-channels, everything seems to be fine as the TC shows a reasonable temperature trend. But if I do it the other way round, the last AI-channel, that I created right before the TC-channel, is influencing my temperature measurement. That means, if I record some voltage increase on the AI-channel, my temperature will go up significantly.

 

Can someone explain to me why this is happening?

 

PS: All channels are part of the same task.