LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write data to CSV file from waveform chart

Solved!
Go to solution

Yes, that's a very simple problem. So you want relative time in seconds, not absolute time. Typically, the y-axis is vertical, so it is impossible to have a horizontal line along it. Are you sure that your file name is correct? (Horizontal line along Y axis.PNG)

0 Kudos
Message 11 of 19
(2,001 Views)

Hello Altenbach,

 

thank you for your reply. No no my file name is not correct, just for your your reference I have attached the graph. Usually Y-axis is vertical.  Could you please give me your suggestion on save Time and flux density in .csv file(excel), when I run the program. Looking forward to hear from you soon.


Thanks

vijay

0 Kudos
Message 12 of 19
(1,998 Views)

Here's a quick draft. (Make sure you understand e.g. display style for string constants.)

 

altenbach_0-1637088590003.png

 

Note that you need to complete some things, for example the "time" should be based on the wait and [i] and contain decimal digits if it can non-integer.

 

0 Kudos
Message 13 of 19
(1,996 Views)

Hello Altenbach,

 

Thank you for your valuable suggestions. Now I’m successful able to generate a .csv file with Time and Flux. But I have a question that when I try to get the data in .csv, after a while I stop the program and then continue the measurement, again I pressed Run the program, the data is saving from again Time 0 sec onwards not from the stop point. I was not getting exactly same as in graph. Could you suggest for this issue. 

Thanks

vijay

0 Kudos
Message 14 of 19
(1,976 Views)

Hello NI Community,

 

I am working on a Gaussmeter and Thorlabs instruments (Rotary motor DDR25). I am successfully able to run two instruments at the same time. Now I would like to save data into a .csv file. I have connect .csv file path to gaussmeter loop and getting data (Time[s] and magnetic flux density [mT]) as well. Now as per my project I would like to save Rotary motor data (Angle) to the same .csv file. For your reference I am attaching the code in jpg format, could you please check and let me know your suggestions.

 

Thanks

Vijay

Download All
0 Kudos
Message 15 of 19
(1,973 Views)

Some of us won't even try to look at LabVIEW code posted as a static picture.  I wouldn't ask you for help with a complicated C++ program by sending you a screen-shot of a page of code ...

 

Attach your VI(s) (or compress the folder containing your LabVIEW Project and attach the .zip file).

 

Bob Schor

0 Kudos
Message 16 of 19
(1,970 Views)

Hi vijay,

 


@vijay0507 wrote:

after a while I stop the program and then continue the measurement, again I pressed Run the program, the data is saving from again Time 0 sec onwards not from the stop point. I was not getting exactly same as in graph. Could you suggest for this issue.


What else do you expect when restarting you program?

When the "Time" should continue "from the stop point" then you need to store that value in a file and read the file upon next start of your VI!

 


@vijay0507 wrote:

Now as per my project I would like to save Rotary motor data (Angle) to the same .csv file.


You just need to attach the angle data to the FormatIntoString function as 3rd parameter...

 


@vijay0507 wrote:

For your reference I am attaching the code in jpg format,


Bob already told you about the sense of attaching images to code discussion.

Keep in mind: LabVIEW does not understand "code in jpg format", it also does not know how to handle PNG images of code. LabVIEW expects VIs or PNG snippets (which are different to plain PNG images - read the LabVIEW help)!

 

Btw. keep related discussions in one thread: it really helps to know the background/history of your question!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 19
(1,958 Views)

Hello NI Community,

 

Thank you so much for your reply. Actually I am working on two instruments Gaussmeter and Rotation motor (DDR25) from Thorlabs. Gaussmeter is used to measure the Magnetic flux density. A rotation motor is used to rotate the magnet holder (Angle). I have synchronized both instruments and able to plot the data. Now my task is to save the both instruments waveform chart data into .csv file. I am able to save gaussmeter data into .csv file (I have connected .csv file path to gaussmeter loop and getting data (Time[s] and magnetic flux density [mT]) as well. )and moreover I have to save rotation motor data (Angle) into the same .csv file (where magnetic flux data is being saved). For your reference I have attached my .vi could you please check it let me know your valuable suggestions.

 

Thanks & Regards

Vijay

0 Kudos
Message 18 of 19
(1,928 Views)

Hi vijay,

 

please do yourself a favour and (re-)do those "Training resources" to learn LabVIEW basics! Especially those sections explaining "THINK DATAFLOW!"

 

Once you did that please take a moment to look at your VI (as shown in the image) to recognize why your changes don't work as intended…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 19
(1,924 Views)