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:
code  create  error  include  lib  library  main  math  project  properties  referenced main  studio  visual studio  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: Thu, 22 Feb 2018 22:58:46 GMT2018-02-22T22:58:46Z

 



Signal acquiring C program does not work for DAQmxBase on macos using daq 6008

Wed, 21 Feb 2018 15:14:10 GMT2018-02-21T15:14:10Z

So I am new to daqmxBase and daq .

 

What I want to achieve:

- To simply record voltage from the analog input channel of my daq device ( NI DAQ 6008 )

- Use a C program to do the same and compile it using  clang or gcc at the "terminal" of my macos

 

Software Details:

- macos High Sierra 10.13.3

- downloaded the nidaqmxBase 15 software for macos

 

C Program that I am trying to compile

http://www.ni.com/tutorial/5409/en/

- this code basically includes "NIDAQmx.h" which gives off an error so I changed it to "nidaqmxbase/NIDAQmxBase.h"

- also I changed all DAQmx functions to DAQmxBase functions

 

THE ERROR

- The C program simply would not compile and give the following error:

Undefined symbols for architecture x86_64:

  "_DAQmxBaseCfgSampClkTiming", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseClearTask", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseCreateAIVoltageChan", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseCreateTask", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseGetExtendedErrorInfo", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseReadAnalogF64", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseStartTask", referenced from:

      _main in daqmirror-da73d6.o

  "_DAQmxBaseStopTask", referenced from:

      _main in daqmirror-da73d6.o

ld: symbol(s) not found for architecture x86_64

 

 

I am new to C as well as the daqmxBase library so could you please suggest at to what is causing this error?

The code was directly copy pasted from the ni website and still it fails to compile.

Also, none of the examples compile . They too give the same error.




read timestamp from DAQ device

Sun, 11 Feb 2018 12:36:38 GMT2018-02-11T12:36:38Z

hi everyone

i need help...

i use the NI-PCI 6225 card.

I want to read the 1000 samples with the time of each sample. I used 

DAQmxConfigurLogging C API, but in the TDMS file that was generated, there was no time for each sample.

What should I do to achieve this?

Thanks




Checking device state through ANSI C

Thu, 01 Feb 2018 16:07:20 GMT2018-02-01T16:07:20Z

Hello,
Hardware: cDAQ-9174 with three modules, NI 9263(Outputs) and 2x NI 9215(Inputs).


In NI Max I can see the 'Status' of my devices and their modules, if they're plugged in or not.
I'd like to know how to get this device's status. In particular if it is connected to the computer, so I can tell the user "Duh.. the device isn't plugged in.". I should be able to tell if a device is disconnected or not and what modules are physically installed and in which slot. I've looked at DAQmx's functions NI-DAQmx C Reference Help for one that would report a "status" like property, but I couldn't find one.
Most device properties report the same independently of the device being connected to the computer or not, simply reports what's configured in NI Max.

Thanks




C sample to send CAM Message via Xnet and USB-8502 device

Mon, 25 Dec 2017 14:49:35 GMT2017-12-25T14:49:35Z

We have an USB-8502 with one CAN port. We are using it to communicate with an automobile ECU. We can successfully send and receive messages using NI-XNET Bus Monitor.

 

Now we need to make a C application to exchange custom CAN messages with the ECU via the USB-8502. Could you please help us with an sample code ?




DAQmx compatibility with MSVC 2015 compiler

Fri, 01 Dec 2017 15:35:41 GMT2017-12-01T15:35:41Z

Dear all,

 

I'm trying to realize a software in Cpp using the compiler MSVC 2015 64bit. But apparently the Nidaq.lib provided with my NI pcie card was compiled by a 32bit compiler (probably gcc since my testing software works properly when I use Mingw 32bits). is there another lib compiled for 64 bits compilers somewhere?

thanks in advance for you help




nivirtualbench.lib for Borland C++ builder

Tue, 28 Nov 2017 21:31:19 GMT2017-11-28T21:31:19Z

I am working on a project which involves integrating Virtual Bench into an existing desktop application that was developed by our customer using Borland C++ Builder.

I have run the virtual bench installer "NIVirtualBench1700f0.exe" and I have been able to operate the virtual bench using the packaged application. Also I have compiled the example code provided under visual studio and it is working fine.

But I am unable to link the virtual bench library when I compile using Borland C++ Builder. I have checked the install path for the library and found that the file named "nivirtualbench.lib" is missing from the ni folder where the borland library should be.

I attached screen shots below showing the folder locations for both the borland and visual studio library files.

It looks like the library is missing.

Does anyone know where I might be able to download the Borland library for virtual bench?

(image) (image)




how to check if measurement is done through SRQ

Thu, 23 Nov 2017 02:40:13 GMT2017-11-23T02:40:13Z

Here is the code, but it doesn't work, can anybody help?

 

main()

{

status = viOpenDefaultRM(&defaultRM);
status = viOpen(defaultRM, "GPIB0::18::INSTR", VI_NULL, VI_NULL, &viSA);
viSetAttribute(viSA, VI_ATTR_TMO_VALUE, 20000);
viClear(viSA);

viInstallHandler(viSA, VI_EVENT_SERVICE_REQ, myCallback, bufferHandle);
viInstallHandler(viSA, VI_EVENT_IO_COMPLETION, myCallback, bufferHandle);
viEnableEvent(viSA, VI_EVENT_SERVICE_REQ, VI_HNDLR, VI_NULL);
viEnableEvent(viSA, VI_EVENT_IO_COMPLETION, VI_QUEUE, VI_NULL);

//start porform channel power measurement....

viPrintf(viSA, ":INITiate:CHPower\n");
status = viWaitOnEvent(viSA, VI_EVENT_IO_COMPLETION, 30000, &etype, &eventContext);

 

if (status < VI_SUCCESS) {
/* Waveform not received...exiting */
free(bufferHandle);
viClose(defaultRM);
return;
}

//try to fetch channel power here, but it never get there.

viPrintf(viSA, ":FETCH:CHP:CHP?\n");
viRead(viSA, (ViBuf)buf, 20, &numRead);
}

 

//callback

ViStatus _VI_FUNCH myCallback(ViSession vi, ViEventType etype, ViEvent eventContext, ViAddr userHandle)
{

ViJobId jobID;
ViStatus status;
ViUInt16 stb;
status = viReadSTB(vi, &stb);
status = viReadAsync(vi, (ViBuf)userHandle, 1024, &jobID);
return VI_SUCCESS;

}

 




How to configure multiple AI channels scanning at differerent rates in Visual C++

Thu, 16 Nov 2017 10:36:23 GMT2017-11-16T10:36:23Z

Hi,

is it possible to scan multiple AI channels (e.g. 8) at different sampling rates each of them?

If yes, I am intersted in knowing the DAQmx C++ function that should be used to configure the rates this way.

I am using NI USB 6000-6001-6002 series cards.

Thanks.




problems adding header files

Tue, 31 Oct 2017 01:23:12 GMT2017-10-31T01:23:12Z

Hi, 

 

For my project I downloaded the Measurement software and installed the NI-488.2 drivers.

 

Now, at the end of my stdafx.h file I am trying to include the libraries from here:

 

 

#include "NiGraph3DComponent.h"
#include "Ni4882Component.h"
#include "NiCommonComponent.h"
#include "NiDAQmxComponent.h"
#include "NiDataSocketComponent.h"
#include "NiMathComponent.h"
#include "NiUiComponent.h"
#include "NiUiCommonComponent.h"
#include "NiUtilityComponent.h"
#include "NiVisaComponent.h"
using namespace NI;


However, when I try to compile it, it says all these header files cannot be found. How do I install these files or where do I find them so that I can include the libraries?

 

 

 

 



Get Values from NISysCfgTimestampUTC timestamp using C API

Thu, 19 Oct 2017 18:44:44 GMT2017-10-19T18:44:44Z

Hello,

I verify External Calibration is supported by the device,

 

NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertySupportsExternalCalibration, supportsECalBool);

 

 

and get a NISysCfgTimestampUTC  timestamp (struct unsigned int u32Data[4]) with zero values.

NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertyInternalCalibrationLastTime, lastExtCal);

 

My initial thought is I should just grab these values where each signifies year, month, day,

NISysCfgTimestampUTC  typdef to the function below from what I understand converts to seconds from 1970.

NISysCfgValuesFromTimestamp(lastExtCal, secondsSinceEpoch1970, fractionalSeconds);

 

 

I get  a large value secondsSinceEpoch1970 = 18446744071626706816 , fractionalSeconds = 0.0000

 

What am I doing wrong?




How to get Chassis serial number with system configuration C API?

Thu, 12 Oct 2017 20:34:16 GMT2017-10-12T20:34:16Z

I am able to get all of the hardware serial and alias information, but how do you specifically get the chassis itself?




Error Code 0XFFFB38OE

Wed, 11 Oct 2017 18:24:42 GMT2017-10-11T18:24:42Z

I am trying to create a simulated PXIe-1085, and import an .ini file because the given options do not display the PXIe-1085.

 

"Could not import chassis information Error Code 0XFFFB38OE"

 




PXIe-1085 C code documentation

Tue, 10 Oct 2017 21:37:45 GMT2017-10-10T21:37:45Z

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.

 




Use DAQmxCreateAOVoltageChan() to create multiple output channels in VS2017

Thu, 05 Oct 2017 17:21:43 GMT2017-10-05T17:21:43Z

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




What is the ID of an Attribute?

Thu, 05 Oct 2017 00:41:08 GMT2017-10-05T00:41:08Z

Hello,

 

I am trying to make a simple get call niRFSA_GetAttributeViString. Where can I find the ID of an Attribute?

 

I am trying to make a call to the NIRFSA_ATTR_SERIAL_NUMBER but this attribute is not working. I receive the error : -1074135028

IVI: (Hex 0xBFFA000C) Attribute ID not recognized

 




use labview dll in visual studio

Wed, 04 Oct 2017 23:29:51 GMT2017-10-04T23:29:51Z

Hi, all,

 

Questions:

I want to control Microsoft Visual Studio to use the dll which generated from labview. I have some problems here. I use labview 2017 and visual studio 2015.

 

1.

I create a test project and I create a math.vi to do mathematics addition. Then I use Build Specifications under project to create shared library.

 

2.

I create a win32 console application in visual studio and create a math project.

 

project -> properties -> configuration properties -> vc++ directories -> include directories: C:\Program Files\National Instruments\LabVIEW 2017\cintools was added

 

move SharedLib.lib to ...\Visual Studio 2015\Projects\math\math

project -> properties -> configuration properties -> vc++ directories -> library directories: Visual Studio 2015\Projects\math\math was added

 

project -> properties -> configuration properties -> Linker -> Input -> Addtional Dependencies: SharedLib.lib was added

 

move the ShareLib. h to ...\Visual Studio 2015\Projects\math\math and add it from header files in solution 'math'

 

3. motify the math.cpp file

#include "stdafx.h"
#include "SharedLib.h"

int main()
{
double k = Math(3.2, 4.5);
return 0;
}

 It could successfully compiled by visual studio and then I move the dll file under ...\Visual Studio 2015\Projects\math\math.

 

But, when I build it, it give me the following error:

 

Warning LNK4272 library machine type 'x64' conflicts with target machine type 'X86' math D:\Wenxu Documents\My Documents\Visual Studio 2015\Projects\math\math\SharedLib.lib 1 
Error LNK2019 unresolved external symbol _Math referenced in function _main math d:\wenxu documents\my documents\visual studio 2015\Projects\math\math\math.obj 1 
Error LNK1120 1 unresolved externals math d:\wenxu documents\my documents\visual studio 2015\Projects\math\Debug\math.exe 1 

 

 

All files are attached. I am pretty new to labview. Thanks for your help very much! I was confused on it for a couple days. I appreciate a lot if you could give me some hints.

Best




use labview dll in visual studio c++

Wed, 04 Oct 2017 22:57:19 GMT2017-10-04T22:57:19Z

Hi, all,

 

Questions:

I want to control Microsoft Visual Studio to use the dll which generated from labview. I have some problems here. I use labview 2017 and visual studio 2015.

 

1.

I create a test project and I create a math.vi to do mathematics addition. Then I use Build Specifications under project to create shared library.

 

2.

I create a win32 console application in visual studio and create a math project.

 

project -> properties -> configuration properties -> vc++ directories -> include directories: C:\Program Files\National Instruments\LabVIEW 2017\cintools was added

 

move SharedLib.lib to ...\Visual Studio 2015\Projects\math\math

project -> properties -> configuration properties -> vc++ directories -> library directories: Visual Studio 2015\Projects\math\math was added

 

project -> properties -> configuration properties -> Linker -> Input -> Addtional Dependencies: SharedLib.lib was added

 

move the ShareLib. h to ...\Visual Studio 2015\Projects\math\math and add it from header files in solution 'math'

 

3. motify the math.cpp file

#include "stdafx.h"
#include "SharedLib.h"

int main()
{
double k = Math(3.2, 4.5);
return 0;
}

 It could successfully compiled by visual studio and then I move the dll file under ...\Visual Studio 2015\Projects\math\math.

 

But, when I build it, it give me the following error:

 

Warning LNK4272 library machine type 'x64' conflicts with target machine type 'X86' math D:\Wenxu Documents\My Documents\Visual Studio 2015\Projects\math\math\SharedLib.lib 1
Error LNK2019 unresolved external symbol _Math referenced in function _main math d:\wenxu documents\my documents\visual studio 2015\Projects\math\math\math.obj 1
Error LNK1120 1 unresolved externals math d:\wenxu documents\my documents\visual studio 2015\Projects\math\Debug\math.exe 1

 

 

All files are attached. I am pretty new to labview. Thanks for your help very much! I was confused on it for a couple days. I appreciate a lot if you could give me some hints.

Best




niRFSA_init

Wed, 04 Oct 2017 22:24:10 GMT2017-10-04T22:24:10Z

Hello,

 

I have followed the correct instructions to import the correct nirfsa.lib and my paths are correct.

When I comment out this line, my program compiles fine.

niRFSA_init ("PXI1Slot2", VI_TRUE, VI_FALSE, &session)

 

I am trying to build a simple driver to connect I receive the error below.

error:

LNK2019 : Unresolved external symbol _sprint referenced in function _LoadDLLIfNeeded

 

Where else I should be looking for any libs or directories? What am I missing?
I referenece the
\Include
\WinNT\Visa\include additional libraries as well as

 

\Lib\msc

For the nirfsa .lib dependencies




Reading calibration time

Fri, 22 Sep 2017 08:32:13 GMT2017-09-22T08:32:13Z

Hello everybody

 

I try to read the latest calibration time from a instrument in my PXI chassi using C++

functions in nisyscfg.h. Below is a code snippet

NISysCfgTimestampUTC lastTimeCalibrated;

 NISysCfgUInt64 secondsSinceEpoch1970;
double fractionalSeconds;

NISysCfgGetResourceProperty(resource, NISysCfgResourcePropertyExternalCalibrationLastTime, &lastTimeCalibrated);
NISysCfgValuesFromTimestamp(&lastTimeCalibrated, &secondsSinceEpoch1970, &fractionalSeconds);

After the call a get (Copied from my debugger)

secondsSinceEpoch1970    2212122498    NISysCfgUInt64
        lastTimeCalibrated    @0x28fb38    NISysCfgTimestampUTC
            u32Data    @0x28fb38    unsigned int [4]
                [0]    2685816    unsigned int
                [1]    829144320    unsigned int
                [2]    2    unsigned int
                [3]    1    unsigned int
        fractionalSeconds    0.19305020570769565    double

I have read in the  usergoups that NI starts time calculation from 1904 and not 1970

but anyway i can't get the value of

secondsSinceEpoch1970    2212122498

to be correct. NI MAX says some date in 2016....

 

Anyone that knows what i am doing wrong ??

2212122498 Seems to be in the 2040-mm-dd

 

best regards

  Håkan

 

 




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.