Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

create spreadsheet automatically

hi

 can we create spredsheet automatically aftersome time and save current data which i arrived from daq ni card

its is possible ?

i wnt to create spreasheet automatically with current date and save data which arrived from ni daq card and for next dar same procedure is follow

this info. is save in one specific folder

any one is there plz help me

send any link which automatically create current data spredsheet and save data

plzSmiley Happy 

0 Kudos
Message 1 of 12
(4,984 Views)

I don't have a link that will automatically solve the problem, but I have an idea.

 

Use your favorite programming language with the NIDAQmx libraries to create a comma-seperated text file (csv).

When you create the file, seperate the data values that you read from the nidaq by a comma.

Every spreadsheet program (excel?) will read the csv file put the different values in different cells.

You can then use the spreadsheet program to analyze the data, etc.

 

Hope this helps.

 

-Mike

usb daq boards 

Message 2 of 12
(4,977 Views)

hi

tell code in c

i am beginner in c

tell me how to create automatically shreadsheet with current date and save data which i acuqired from daq 

plzSmiley Surprised 

0 Kudos
Message 3 of 12
(4,964 Views)

ok, here is a simple code in c that reads 3 channels from a NIDAQ card and writes data to a CSV file which can be read by Excel.

The sample rate is 10 khz. 1000 samples per channel.

 

 

#include <stdio.h>#include "NIDAQmx.h"#define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }int main(int argc, char *argv[]){ int32 error=0; TaskHandle taskHandle=0; int32 read,i; float64 data[3000]; char errBuff[2048]={'\0'}; FILE *f1; /*********************************************/ /*/ DAQmx Configure Code /*********************************************/ DAQmxErrChk (DAQmxCreateTask("",&taskHandle)); DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0:2","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL)); DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000)); /*********************************************/ /*/ DAQmx Start Code /*********************************************/ DAQmxErrChk (DAQmxStartTask(taskHandle)); /*********************************************/ /*/ DAQmx Read Code /*********************************************/ DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,1000,10.0,DAQmx_Val_GroupByScanNumber ,data,3000,&read,NULL)); printf("Acquired %d points\n",read);// write data to file f1=fopen("output.csv","w"); if (f1==NULL) { printf ("Error creating output file\n"); return 1; } fprintf(f1,"channel1,channel2,channel3\n"); for(i=0;i<2997;i+=3) { fprintf(f1,"%f,%f,%f\n",data[i],data[i+1],data[i+2]); } fclose(f1); printf("End of program, press Enter key to quit\n"); getchar(); return 0;// Error handlingError: if( DAQmxFailed(error) ) DAQmxGetExtendedErrorInfo(errBuff,2048); if( taskHandle!=0 ) { /*********************************************/ /*/ DAQmx Stop Code /*********************************************/ DAQmxStopTask(taskHandle); DAQmxClearTask(taskHandle); } if( DAQmxFailed(error) ) printf("DAQmx Error: %s\n",errBuff);}

 

Hope this helps...

- Mike

USB DAQ BOARDS 

 

0 Kudos
Message 4 of 12
(4,939 Views)

hey i am try this program but some error has comes like object code is not supported. then i create .lsb file but my pc not supproted to that ,it say that the extension should be change. it is not in .lsb format

wht wil i do?

how to run my code?

how to create .lsb file in proper format?

help me........Smiley Indifferent 

0 Kudos
Message 5 of 12
(4,910 Views)

Hi.

 

I'm attaching a file with the executable and instructions.

 

- Mike

usb daq boards 

Message 6 of 12
(4,902 Views)

its not work.......... i can't...................

hey is there any option that means set clock time after some time it generted spredsheet.

i wil send u my vi plz help me wht wil i do next?i cant do any thing..........Smiley Surprised

i use usb6221 and i select counter 2

maximum freq range 500hz/hr and minimum 1 hz/hr

timeout 1

read to sample 10

i wnt to create shredsheet daily when i run this vi it wil never ask to me where to store data it wil create actomatically shredsheet daily and save daily data

plz help me

if any other method is use? 

 

Download All
0 Kudos
Message 7 of 12
(4,888 Views)
hi this my vi plz check its and give me any suggesion
0 Kudos
Message 8 of 12
(4,887 Views)

Please unmark the solution, otherwise people will think that your problem is solved and won't look into this thread.

 

Mathan

0 Kudos
Message 9 of 12
(4,878 Views)

thank

well u see my vi which i send

plz help me

how 2 create daily spredsheet with current date if i run my vi they will not 2 ask me where to store data

it should automatically create excel sheet and store daily data

 

0 Kudos
Message 10 of 12
(4,849 Views)