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

ASYST

$
0
0

Kan noen hjelpe meg?

Jeg har funnet fram noen 25 år gamle datafiler fra programsystemet ASYST 2.0 (dos) som jeg gjerne skulle ha lest.   Alt datautstyret fra dengang er kondemnert.  Hver fil inneholder ett array som deklarert:  REAL DIM[ 1000 ] ARRAY TEST.

Har forsøkt notepad++, word etc, men har ikke lyktes.

Ville vært svært takknemlig om noen kunne lese filene og konvertere dem til excel (helst) eller notepad++

Mvh

Magne

--

Professor emeritus Magne Waskaas, dr.philos

University of South-Eastern Norway

Faculty of Technology, Natural Sciences and Maritime Sciences

Kjoelnes Ring 56, P.O. box 203, N-3901 Porsgrunn, Norway

Telephone: +47 35026200

Cellphone: +47 93036286


Help Project!!

How to set the number of samples to process per second?

$
0
0

I created the source as below...

 

DAQmxCreateTask("", &m_task[0]);
DAQmxCreateAIAccelChan(m_task[0], "cDAQ9189-1DD988AMod1/ai0:2, cDAQ9189-1DD988AMod2/ai0:2, cDAQ9189-1DD988AMod3/ai0:2, cDAQ9189-1DD988AMod4/ai0:2, cDAQ9189-1DD988AMod5/ai0:2", "", DAQmx_Val_PseudoDiff, 0.0, 200.0, DAQmx_Val_AccelUnit_g, 50, DAQmx_Val_mVoltsPerG, DAQmx_Val_Internal, 0.004, NULL); DAQmxCfgSampClkTiming(m_task[0], "", 100, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000); DAQmxRegisterEveryNSamplesEvent(m_task[0], DAQmx_Val_Acquired_Into_Buffer, 100, 0, EveryNCallback, this);
DAQmxStartTask(m_task[0]);

I thought there were 100 samples per second of the sample collected 100, callback sample 100, but there is not.

How do I need to implement it in code?
I want to receive only the specified number every second.

 

 

Specifying Channel Read order Ni-DAQmx.

$
0
0

Hi, I am currently upgrading C code from Ni-DAQ legacy to the Ni-DAQmx format and was wondering if it is possible to specify a channel read order? ie. reading channels 1,7,2,7,3,7,4,7,5,7,6,7 in that specific order? Any help is appreciated

pure life nutrition reviews: pure life walmart!

$
0
0

A few of the general population are going underneath the things which are not alright for the body and those that do work out, its consequences are appallingly moderate and bounteous of your time taking. That is the reason here is one arrangement where one ought to receive he supplements and the items which are especially made for the people to shred the fat from their body.

https://works.bepress.com/supplements-world/3/

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;
}
}
}

Help with problems when calling C++ DLLs

$
0
0

Using ts to call the C++ module DLL written by vs. The parameters of the function have not been displayed. Is my interface written in C++ wrong?Sincerely ask for help捕.PNGThis is my module editing interface, there is no function variable a, b获.PNGThis is my Cpp捕获.PNGThis is my header file捕.PNGThis is my module editing interface, there is no function variable a, b

SetReadChannelsToRead/Reading channels in a specfic order.

$
0
0

I have been trying to update our Ni-DAQ legacy scripts to Ni-DAQmx scripts and have encountered one large problem. I am trying to perform an Analog Block Read. The channel number and order is determined by some parameters supplied by another program. These values are contained in an array such as 0,7,1,7,2,7... etc where 7 is used to "zero" the voltage in between reads. This process works with 7 channels, but when I switch to a DAQ with 14 or 28 channels,I receive error 200082, which provides useless information in my opinion to solving the problem. I am wondering if there is a maximum amount of channels that can be specified in DAQmxSetReadChannelsToRead. The function in question is below, but some parameters may not be referenced. 

 

 

 

DLLEXPORT union data_val CALLBACK AIBConfig(void)
{
union data_val dev, mode, polarity, samp, gain, chvect, SampRate, ScanRate, ret;
int16* gains;
int16* vect;
int i;
int error = 0;
int32 read = 0;

// Configure all analog input ports for double buffered data collection.
get_param_val(&dev, ING, FIRST); // Retrieving Parameters from Splot
if (dev.i < 1 || dev.i > MAXDEV)
sntx_err(OUT_OF_RANGE);
AIBdev = dev.i;
get_param_val(&mode, ING, MID);
get_param_val(&polarity, ING, MID);
get_param_val(&samp, ING, MID);
if (samp.i < 0)
sntx_err(OUT_OF_RANGE);
nsamp[dev.i] = samp.i;
if (minpeakind == 0)
minpeakind = samp.i / 20; // default to match previous hard coded value
get_param_val(&gain, PTRT, MID);
if (gain.pv.p == NULL)
sntx_err(NULL_PTR);
if (gain.pv.pinfo->btype != SHRT)
sntx_err(TYPE_MISMATCH);
nchan[dev.i] = gain.pv.pinfo->dim[0];
gains = (int16*)gain.pv.p;
get_param_val(&chvect, PTRT, MID);
if (chvect.pv.p == NULL)
sntx_err(NULL_PTR);
if (chvect.pv.pinfo->btype != SHRT)
sntx_err(TYPE_MISMATCH);
if (chvect.pv.pinfo->dim[0] != (int)nchan[dev.i])
sntx_err(INDEX_OUT);
vect = (int16*)chvect.pv.p;
get_param_val(&SampRate, DUB, MID);
get_param_val(&ScanRate, DUB, LAST);

// allocate buffers
nibufsize[dev.i] = nchan[dev.i] * nsamp[dev.i] * 2; // *2 for double buffered
if (piBuffer[dev.i] != NULL)
free(piBuffer[dev.i]);
piBuffer[dev.i] = (int16*)malloc(nibufsize[dev.i] * sizeof(int16));
if (piBuffer[dev.i] == NULL)
sntx_err(OUT_OF_MEM);
if (piHalfBuffer[dev.i] != NULL)
free(piHalfBuffer[dev.i]);
piHalfBuffer[dev.i] = (int16*)malloc(nibufsize[dev.i] / 2 * sizeof(int16));
if (piHalfBuffer[dev.i] == NULL)
sntx_err(OUT_OF_MEM);
if (piXferBuffer[dev.i] != NULL)
free(piXferBuffer[dev.i]);
piXferBuffer[dev.i] = (int16*)malloc(nibufsize[dev.i] / 2 * sizeof(int16));
if (piXferBuffer[dev.i] == NULL)
sntx_err(OUT_OF_MEM);
if (diff[dev.i] != NULL)
free(diff[dev.i]);
diff[dev.i] = (int*)malloc(nchan[dev.i] * sizeof(int));
if (diff[dev.i] == NULL)
sntx_err(OUT_OF_MEM);


for (i = 0; i < (int)nchan[dev.i]; i++) // Assigning respective gains to channels
{
switch (gains[i])
{
case 1:
{
voltsLow[i] = (float)-5;
voltsHigh[i] = (float)5;
}
break;
case 2:
{
voltsLow[i] = (float)-2.5;
voltsHigh[i] = (float)2.5;
}
break;
case 5:
{
voltsLow[i] = (float)-1;
voltsHigh[i] = (float)1;
}
break;
case 10:
{
voltsLow[i] = (float)-0.5;
voltsHigh[i] = (float)0.5;
}
break;
case 20:
{
voltsLow[i] = (float)-0.25;
voltsHigh[i] = (float)0.25;
}
break;
case 50:
{
voltsLow[i] = (float)-0.1;
voltsHigh[i] = (float)0.1;
}
break;
case 100:
{
voltsLow[i] = (float)-0.05;
voltsHigh[i] = (float)0.05;
}
break;
default:
voltsLow[i] = (float)-5;
voltsHigh[i] = (float)5;
break;
}
}
time_step[dev.i] = 1.0 / ScanRate.d; // Calculating timestep
error = DAQmxCreateTask("", &taskHandle); // Creating Task
handleError(error, taskHandle);

for (i = 0; i < (int)nchan[dev.i]; i += 2)
{
char devAIB[256]; // Retrieving dev/chan # from splot
sprintf_s(devAIB, 256, "dev%d/ai%d", dev.i, vect[i]);
char inputMode[256]; // Retrieving dev/chan # from splot
sprintf_s(inputMode, 256, "DAQmx_Val_%d", mode.i);

if (vect[i] == LOOPBACKCH)
continue;
if (mode.i == 0) // Setting the terminal configuration
{
error = DAQmxCreateAIVoltageChan(taskHandle, devAIB, "", DAQmx_Val_Diff, voltsLow[i], voltsHigh[i], DAQmx_Val_Volts, NULL);
handleError(error, taskHandle);
}
else if (mode.i == 1)
{
error = DAQmxCreateAIVoltageChan(taskHandle, devAIB, "", DAQmx_Val_RSE, voltsLow[i], voltsHigh[i], DAQmx_Val_Volts, NULL);
handleError(error, taskHandle);
}
else if (mode.i == 2)
{
error = DAQmxCreateAIVoltageChan(taskHandle, devAIB, "", DAQmx_Val_NRSE, voltsLow[i], voltsHigh[i], DAQmx_Val_Volts, NULL);
handleError(error, taskHandle);
}
}
char controlChannel[256]; // Retrieving dev/chan # from splot
sprintf_s(controlChannel, 256, "dev%d/ai%d", dev.i, LOOPBACKCH);
error = DAQmxCreateAIVoltageChan(taskHandle, controlChannel, "", DAQmx_Val_Diff, -5, 5, DAQmx_Val_Volts, NULL); // Might not be always ai7? Therefore might need to be fixed to receive from splot.
handleError(error, taskHandle);
error = DAQmxCfgSampClkTiming(taskHandle, NULL, ScanRate.d, DAQmx_Val_Rising, DAQmx_Val_ContSamps, nibufsize[AIBdev]/2); // Configuring the Sample timing
handleError(error, taskHandle);
error = DAQmxSetAIConvRate(taskHandle, SampRate.d); // Modifying the AI convert clock rate
handleError(error, taskHandle);
error = DAQmxRegisterEveryNSamplesEvent(taskHandle, DAQmx_Val_Acquired_Into_Buffer, 2048, 0, EveryNCallback, NULL); // Creating Callback event
handleError(error, taskHandle);
error = DAQmxRegisterDoneEvent(taskHandle, 0, DoneCallback, NULL); // Creating done event
handleError(error, taskHandle);

char chanreadstr[2048];
char tempchread[80];
char rvect[2048];
chanreadstr[0] = '\0';

for (i = 0; i < (int)nchan[dev.i] - 1; i++)
{
//if (vect[i] == LOOPBACKCH)
//continue;
sprintf_s(tempchread, 80, "dev%d/ai%d, ", AIBdev, vect[i]);
strcat_s(chanreadstr, tempchread);
}
sprintf_s(tempchread, 80, "dev%d/ai%d", AIBdev, LOOPBACKCH);
strcat_s(chanreadstr, tempchread);
error = DAQmxSetReadChannelsToRead(taskHandle, chanreadstr); // Setting specific array of channels to read
handleError(error, taskHandle);
//error = DAQmxGetReadChannelsToRead(taskHandle, rvect, 2048);
//handleError(error, taskHandle);
error = DAQmxStartTask(taskHandle); // Starting the task
handleError(error, taskHandle);

ret.i = error;
return ret;


Help in new project !!

$
0
0

Hi, my name is Gerardo and I want to see if they gave me their opinion on what software they would recommend me to build a coordinate measuring machine.

御社Measurement Studio C++での使用

$
0
0

お世話になっております。

株式会社ニコンの早坂と言う者です。

 

御社

 

Measurement Studio Visual C++ MFC Legacy Support R3 Enterprise for Visual Studio 2010

 

を従来より使わせて頂いており、

この度、そのソフトリソースを活用して、

新規の装置の開発を検討しております。

 

その際に、

Visual Studio2017

の「VC++」のコーディングベースで

継続して、開発していても問題ありませんでしょうか?

 

2016年当時も「VC++」のサポートについて

徐々に無くなっていく方向とお聞きしていたので、

教えて頂きたく思っております。

 

以上、よろしくお願いいたします。

 

*********************************

株式会社 ニコン ( 水戸製作所 )

生産本部 設備技術開発部

第一設備開発課 第二開発係

早坂 崇(Takashi HAYASAKA

Takashi.Hayasaka@nikon.com

住所:〒310-0843

       茨城県水戸市元石川町276-6

外線:(029)240-1163

*********************************

御社Measurement Studio C++での使用

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:

 

 

 

NIDAQmx.h头文件和库文件NIDAQmx.lib

$
0
0

各位兄台,

  请问哪里可以下载到NIDAQmx.h头文件和库文件NIDAQmx.lib呢?小弟需要这两个文件在VS2008上用C++编程,谢谢!

NIDAQmx.h头文件和库文件NIDAQmx.lib

$
0
0

Who know where to download nidaqmx. h header file and library file nidaqmx. lib

USB-8502 CAN fail to read

$
0
0

We are using USB-8502 for CAN communication with our motor. we have write some code to write and read the can data.

the code runs fine at first, but the USB-8502(Port2) fail to read after 10 minute.

we try to read the data from X-Net Monitor instead of using the code, but USB-8502 fail to read data with X-Net as well.

Below is the application for our code:

Port1: reading and write alternately .(No failure found)

Port2: reading and write alternately with a background thread.(fail to read after some time.)

Attached is some test we do to analysis the failure(Monitor the CAN data with another Peak-System CAN):

Picture1: Write with X-Net using Port2, the data send out normal. and we get reply (0x581h).

Picture2: Write with Peak-System CAN, check the if there is data received from USB-8502.(there is reply from the monitor but the X-NET fail to read)

This situation continue until we plug off/on the USB connector.

We know that this should have something related to our code, but we are wondering: 

What kind of error would cause USB-8502 fail to read till a reset?

 

 

 

 


NI 408X Ajust

$
0
0

Hello,

i'm trying to ajust the NI-4081 DMM following the Calibration Manual. It still fails at the calling of

niDMM_CalAdjustMisc Function with Setting to NIDMM_EXTCAL_MISCCAL_VREF_DC_VOLTAGE.

 

 I previously done the same for the NI-4071 and everyting worked like a charm. but the Setting type  was NIDMM_EXTCAL_MISCCAL_VREF

 

So my question is:  is there a fundamental difference between these two Parameters? I could  find some Information here  about    the NIDMM_EXTCAL_MISCCAL_VREF  but still nothing about the other one. Could somebody helps me please.

 

Best Regard

 

 

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.

 

Download nidaqmxbase for macos ?

$
0
0

Hi all,

 

i received a new mac at work and want to continue working on our C application that uses nidaqmxbase. This app is both mac and windows, but I can not find the downlod anymore for nidaqmxbase headers, frameworks & libraries on mac !

 

i always get to this point :

 

http://www.ni.com/en-us/support/downloads/drivers/download.ni-daqmx.html#311818 

 

but there is no choice for Operating System (only windows) ! Can anyone point me to the macos download ?

 

 

many thanks !

standalone download of niDAQmx ?

$
0
0

Hi all,

 

is there a way to download the installer for niDAQmx and copy it onto a stick to install on a lab computer that has no network access ? The official download installer is here :

 

https://www.ni.com/en-au/support/downloads/drivers/download.ni-daqmx.html#311818

 

but this is simply a mini-installer that downloads more stuff. I would like to download on my office desk PC and then move the downloaded result to the lab and install there. Like a CD that came with our NI hardware, but which doesn't work anymore (damaged)

DAQmxCfgSampClkTiming多通道数据采集

$
0
0

DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle, "", 10000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000)); 个人理解: 范例中10000是采样频率10kHZ,1000代表每通道采集1000点 DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(taskHandle, DAQmx_Val_Acquired_Into_Buffer,1000 , 0, EveryNCallback, NULL)); 同理:1000是缓存区数据到1000后执行回调函数,但是这个数必须能被缓存区整除,所以不能是256这样的数据,所以如果我想实现多通道数据连续采集,且每通道数据都是采样频率256HZ,也就是一秒采集256个点应该如何实现呢?还是说回调函数只能是采集回来100,200,250,400,500,1000这样的数据? 谢谢

Viewing all 660 articles
Browse latest View live


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