08-26-2009 11:44 PM
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
plz
08-27-2009 07:20 AM
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
08-28-2009 12:32 AM
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
plz
08-30-2009 09:25 AM
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
09-02-2009 12:14 AM
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........
09-02-2009 05:11 AM
09-03-2009 12:19 AM
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..........![]()
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?
09-03-2009 12:24 AM
09-03-2009 03:24 AM
Please unmark the solution, otherwise people will think that your problem is solved and won't look into this thread.
Mathan
09-04-2009 12:42 AM
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