LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to save data to text file

Hello, I would like to ask if you could tell me if anything is wrong with my block diagram.. 

 

I am trying to save BPM values streaming in (the orange line) in this diagram. I would like to have BPM values to be recorded in my txt file after I have stopped the run. Right now, I have my headers, personal particulars keyed in, and a 0 displayed on my txt. I got a 0 as my only BPM value after the run. I'm not sure how to get all my data values to be displayed in the text file. Would gladly appreciate if you could give me some pointers! I have attached the image in this message. (: Thanks!

 

 

0 Kudos
Message 1 of 9
(3,208 Views)

Hi whyywhyy,

 

if you could tell me if anything is wrong with my block diagram.. 

Yes, a lot.

Main problem: you don't use the autocleanup tool! (And so you don't follow the StyleGuide found in the LabVIEW help!)

Your block diagram is just awful!

 

I got a 0 as my only BPM value after the run.

Next problem: with each iteration you create a new file, write the header into and then you write a single value into a table of 4 columns…

 

I have attached the image in this message.

Another problem: If you would attach your VI instead we would even be able to correct your VI - but images are hard to debug and to edit within LabVIEW!

ALWAYS attach your VI! Thanks!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,193 Views)

Omg I thought everything was okay except the bpm part, sorry I am a beginner in labview... 😞 I have attached my VI here. Pls help me out, I simply wanna be able to key in particulars on the front panel and then be able to stream the bpm datas in one column on my text file. So my text file will have the keyed in particulars and the bpm values received during the run.  

0 Kudos
Message 3 of 9
(3,181 Views)

Hi whyy,

 

unfortunately I'm stuck at LV2014 right now, so could you please attach your VI "saved for previous…"?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(3,178 Views)

You have not wired "append to file?" = true in the first of the three "Write Delimited Spreadsheet" blocks. Therefore, your vi replaces the spreadsheet file each iteration.

 

Besides, there are some issues with your vi.

Always wire the error clusters. Take care of coersions. Wire from left to right. Consider timing your loops instead. The code in the case structure do not seem right, what are you trying to accomplish?

Message 5 of 9
(3,144 Views)

Have zipped it up!!!! Hope you can open it!! 😄 Thanks!!!

0 Kudos
Message 6 of 9
(3,139 Views)

Hi whyy,

 

now I can open the VI - but you didn't think of using AutoCleanup…

 

Some remarks:

- Why do you use the property "data bits" before VISARead? What's the purpose? (I think it's completely wrong here…)

- You still didn't follow our comments on overwriting the spreadsheet in each iteration. Did you read our messages?

 

Interesting FP design! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(3,134 Views)

Oh sorry, have auto cleaned up (had to google how to do so HAHA). I'm not sure about the VISA part, cos it's the other group mate who did it... I would like to ask how do I stream BPM values to my text file. Have changed the whole thing (as seen in the Male loop) so I could write to file in a simpler way. 

 

I want to stream BPM values directly to my text file after I have stopped the run. Any idea if I have linked it correctly? 

0 Kudos
Message 8 of 9
(3,130 Views)

Hi whyy,

 

all you needed to correct was a simple boolean constant missing at the first WriteSpreadsheetFile function - but you made it worse because you removed all those SpreadsheetFile functions and replaced them by simple file functions…

 

Did you read our messages?

 

I want to stream BPM values directly to my text file after I have stopped the run.

How do you want to "stream" any data when your VI is stopped?

You want to save/write those data while your VI is running in the loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(3,116 Views)