LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Introducing a back/next button to rewrite/create a file?

Hi,

 

Here's what I want my program to do:

 

When I click SAVE DATA (a control button) the running data begins to save as per a specific file name acquired from a predefined list of names, which are available through a RING or ENUM for the operator to see. Now, I want to have a NEXT button, which when clicked, starts to save the current data in a new file who's name gets specified from the same list and on the RING or ENUM control we can see the next file name. Finally, I want to have a Back button which will let me go back to the previous file and replace the data saved from here on out.

 

I've already tried using Write to Measurement File. It helped me have a NEXT button but I haven't been able to incorporate the back button nor the custom file names.

 

A little background about me: I'm very new to programming, let alone LabVIEW but I'm enjoying the experience and logic required. Any help would be of great value to me.

 

I have attached two images which might help project a clearer picture of what I want.

Thanks.

 

Download All
0 Kudos
Message 1 of 5
(3,421 Views)

Hi,

See attached example.

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 5
(3,375 Views)

Thanks for the reply, Gaurav !

 

Firstly, in your program we had no signal coming in to be written so I introduced a Sine wave just like in the picture I posted earlier (although the data I would be writing is dynamic data).

 

I really like how you got the Next and the Back buttons there working! Thanks for that! You really made it look simple!

The next/back buttons were not writing the new files as per the names specified so I fixed that and introduced a few more things.

 

 

There are a few things which are not working as I want them to:

 

1. The data being written is not being a continuous data in the files which are getting saved. It is just saving one segment at the instant I press Write/Next/Back. I've tried to get around that but haven't found a reasonable explanation yet. I'll update this post if I find a way. Maybe you'll find it before me.

 

2. Also, I didn't mention in my first post that I want the columns of the file to be custom named instead of them being the default Untitled1, Untitled 2. It seemed to be a common problem so I searched this forum and found a couple of threads

http://forums.ni.com/t5/LabVIEW/naming-columns-when-writing-to-a-measurement-file/td-p/849750

http://forums.ni.com/t5/LabVIEW/Naming-the-Channels-TDMS-using-the-express-VI/m-p/485687?query.id=28...

but haven't been able to get them to work for me. The second link is out of contention. The first one has 2-3 which seem nice but it doesn't work for me.

 

I've attached the VI. Please have a look.

Thanks a lot, Gaurav. I appreciate your help.

Abdullah.

 

 

 

 

 

0 Kudos
Message 3 of 5
(3,345 Views)

I'm also trying to incorporate those ideas into another big program I'm working on but I ran into this error I'm not able to get around.

Please find the pictures below. I don't understand why the constant value for the Shift Register is not changing to a number. I tried working around it but only managed to get to it to be a String. I have a feeling it is a small problem too and you'll easily be able to tell me whats wrong there.

 

I'm new to programming but totally enjoying how programming makes our mind work!

 

Many thanks.

 

0 Kudos
Message 4 of 5
(3,317 Views)

Hi,

I am not able to open your code as I am using labview 9.

Secondly, about shift register problem, You are connecting string value in "Next value change" event.

Remove that. Do you want to save data continuously? Then put your code of writing into file in "Timeout" event.

So it will write data after every "x" ms mentioned by you for timeout event.

When you will press next or back button only file name will change and data logging will continue.

I hope this will answer your questions

 

Best of luckSmiley Wink

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 5 of 5
(3,279 Views)