ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing Waveform data into CSV file

Hi arpix,

 


@arpix wrote:

My only problem is that that every time when i start the project to  creat the curve i would like to create a new csv file and not to wirte the data in same csv file. Could someon help me how shall i do that? 


When you want a "variable" filepath then you should not use a "constant" filepath!

 

Why don't you build your path using some parameters (like timestamp) to "create a new file every time"?

There is a BuildPath function in the file functions palette. And there is a FormatIntoString function to format any parameters into a string…

 

On your image:

  • Why do you set the "Y" array of the waveform "Graph created with CSV curves" twice? Do you know what happens with the inputs at this SetWfmComponents function?
  • Where is the label of the graph indicator?
  • You only save the Y data to a CSV file, but you forget about all the other waveform parameters!? Is this intended/required?
  • Why did you mark that BuildPath example with a red cross?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 18
(294 Views)

Hi GerdW,

 

Thank you for replaying me so quicly.

I will try to answer on your quetsions: 

On your image:

  • Why do you set the "Y" array of the waveform "Graph created with CSV curves" twice? Do you know what happens with the inputs at this SetWfmComponents function? Answer: I could not find any better solution to compare two Wave form on one graph. Basically 1 wave form is created based on parameters the secound on is reading out one already created csv file. 
  • Where is the label of the graph indicator? Answer: Not really sure what do you mean under this?
  • You only save the Y data to a CSV file, but you forget about all the other waveform parameters!? Is this intended/required? Answer: Yes. and no. For start i want to solve one problem step by step. But i would like to save two colums of data separated with ",". X is shall be the time and the Y shall be the pressure of the curve. 
  • Why did you mark that BuildPath example with a red cross? Answer: I was trying with that something out but i am getting some errors... Not really know how to continue... so that is just a try....
0 Kudos
Message 12 of 18
(284 Views)

Hi arpix,

 


@arpix wrote:
  • Why do you set the "Y" array of the waveform "Graph created with CSV curves" twice? Do you know what happens with the inputs at this SetWfmComponents function?
    Answer: I could not find any better solution to compare two Wave form on one graph. Basically 1 wave form is created based on parameters the secound on is reading out one already created csv file. 

You didn't answer to my question.

 


@arpix wrote:
  • Where is the label of the graph indicator? Answer: Not really sure what do you mean under this?

The graph indicator in the middle (just behind the BuildArray node) doesn't has a label.

There shouldn't be any terminals without labels in the block diagram!


@arpix wrote:
  • Why did you mark that BuildPath example with a red cross?
    Answer: I was trying with that something out but i am getting some errors... Not really know how to continue... so that is just a try....

Which errors did you encounter?

We cannot help until you describe the errors you see!

(And we cannot debug/edit/run images with LabVIEW: when there are problems with your code then you should attach your code…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 18
(277 Views)

Hi GerdW,

 

Thank you for pointing me some of my problems.

Unortunatelly i was unable to answer you because i am a new on this forum so i could not reply 24h.

Ah, sorry — yes, you pointed out the error I hadn’t noticed. I’ve already fixed it. But some extra explanation would be great from your side. Regarding the two y input. I know that the first is for Y axis. The 2nd Y input was not showed correctly on the graph. what is wierd. 
The graph without a name is the Comparison Graph for the two waveforms. Yesterday I think I managed to find a solution to my problem. Thank you for pointing out the major issues and key points. I still have to work on it.

I’ll take any good advice on what’s wrong and what should be improved.

 

fixedproblem.png

 

0 Kudos
Message 14 of 18
(232 Views)

Hi arpix,

 


@arpix wrote:

Yesterday I think I managed to find a solution to my problem. Thank you for pointing out the major issues and key points. I still have to work on it.

I’ll take any good advice on what’s wrong and what should be improved.


Improvement:

Simpler way to create your 2D array of time&sample.

(Maybe you need to transpose to get the same CSV file as you get now.)

 


@arpix wrote:

The graph without a name is the Comparison Graph for the two waveforms.


And you still don't give a label for that graph!

I repeat: "NEVER delete labels, you may hide them in the frontpanel…"

 

Also don't get into the habit of "wiring backwards": try to keep the block diagram on one (FullHD) screen with wires from left to right! (Basic styleguide rule!)

 


@arpix wrote:

Regarding the two y input. I know that the first is for Y axis. The 2nd Y input was not showed correctly on the graph. what is wierd. 


It's not "weird", it's expected!

There is only one Y array in a waveform: writing to that array twice will simply overwrite the first data array…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 15 of 18
(231 Views)

Hi GredW,

 

I’ve fixed it now, considering the name (label). Your example is much cleaner and simpler

 

Thank you!

0 Kudos
Message 16 of 18
(225 Views)

Hi, 

How are you reading 3 channel current data simulteniously ? Did you use any parallel coding style? 

 

Is it possible to share the code? 

0 Kudos
Message 17 of 18
(163 Views)

Hi LV12,

 

I don’t really understand which part you mean? You mean this? 

22.png

 If yes, than this signals are not currents. 

 

 

0 Kudos
Message 18 of 18
(130 Views)