Hi. I was unable to open your VI in LabVIEW 2018 (the Front Panel opened, but I never got the Block Diagram to appear), but if the picture you embedded in your post is the same as your Block Diagram, the answer is obvious -- you have not learned the Principle of Data Flow, the central Principle that governs LabVIEW programming. Notice that the two Graph Methods to Export Data to Excel are unconnected to any other code, so you have no idea (and no control) over when they will run. It is highly likely that they will export data when the code starts to run, before any data are placed in the Graphs.
Notice that these Methods have Error In and Error Out terminals. Attach them to the Error Line after the Error line exits from the While Loop, which (again, by the Principle of Data Flow), will be after all of the data have been plotted. So the order (determined by the Error Line Running Through It) is Initialize and Start DAQ process, Acquire and Plot Data until Elapsed Time Expires, Stop DAQ processes, and Export Data to Excel.
Hi Bob_Schor ,
Thank you .
Even when i put the export data to Excel node after the While Loop ( using the data flow ) the Excel file only have the last signal displayed in the waveform graph . what i want first is to display the signal during 60 seconds in the waveform graph and then saving the signal in Excel file .
best regards .
instead of using a graph as data buffer you should write your data directly to a file! (You don't want to keep 60*50k*2 = 6M samples in memory and additionally in your graphs…)
Right now you read 50k samples at a rate of 50kHz, so worth of 1s of data. That is displayed in your graphs and also exported to Excel.
I suggest to enable writing DAQmx data to TDMS files directly by the DAQmx driver to save "all" data to files.
Excel can open those TDMS files due to the TDMS import filter installed with LabVIEW…
i use the Write To Measurement file with Sine signal as an example ( before using the cDAQmx ) .
i chose to export data to excel file but in the column of time i get this (########) . i want to fix the time from 0 seconds to 60 seconds .(see the program below ).
best regards .
change the axis of time to be from 0 seconds to 60 seconds in the Waveform graph .
Disable autoscaling of the X axis.
Then set 0 and 60 as min/max…
Hi GerdW (Knight of NI) ,
My program Consist of extracting Current and Voltage from a device in 60 seconds using cDAQ and display this information in the Waveform graph and also save the signal in Excel file .
right now i am note conected to the cDAQ so in order to verify my program before using the cDAQ .i use the Simulate signal block to generate the signale . all i want is to generate a sine Wave during 60s and display this signale in the Waveform graph ( the X axis to be from 0 to 60s ) and the Excel file Contains two Column ( Column 1 :Time (S) Column 2 : Sine Wave ) .
when i Disable Autoscale and put 0 Min 60 Max . ( the Waveform graph didn't display the signal )
( You find below my program With Simulate signal block ).
Best regards .