LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic LabVIEW problems

Hey,
 
I'm new to this whole concept which LabVIEW uses to develop programs since I'm an Java-developer at heart. But a couple of months ago me and a friend of mine stared a project which involved capturing data from a FireWire camera and we were under the impression that this was doable in Java, but we were proven otherwise. So we had to figure out what to do since Java wouldn't cooperate and then we were recommended to have a look at LabVIEW. This is where the problems begin, because things that seem simple and obvious in Java has me scratching my head in LabVIEW, so I'm kind of clueless as to what to do. The real problem is time, since I haven't got the time to order loads of books and read them. Anyhow, let me explain what it is I can't figure out in LabVIEW.
 
My program should be separated into two parts; one for registering information and one for recording video. We pretty much have the recording-part in place, so what I need help with is the registering-part. As of now, I'm using a System Tab Control to separate the two parts of the program, but I'm not sure how to make the program wait for all the input in the String Controllers, then allowing the user to hit a "Continue"-button which moves the user to the next tab. This probably isn't that hard, but as I said, this is the first time I'm working with LabVIEW.
 
Another problem I have is that I want to save the input data to a TXT-file, which I have looked at and it seems pretty straight forward, but the only way I could make it work was by having to manually configure the path where the file would be saved. What I want to do instead is to use a relative path from the program. So the files end up in a folder called "data" which is in the same folder as the VI is run from. But I don't only want to save it, I want to be able to read it as well. Let’s say that I've got a dropdown list which has a field called "New", then the program should make a new file and put the input data in it and store it whenever I push the "Continue"-button. But if I choose another option from the dropdown list (which should be files already stored), then I want the program to display the information in their respective String Controllers. Anyhow, it's only the first part of this scenario that really is important, but I would like to implement this latter feature as well.
 
One last thing, when you choose to add a new entry in the program the files should be named accordingly to the previous entry. So if there's already two entries in the dropdown list, then the new entry should get the filename "003.TXT". Again, this probably isn't hard for a experienced LabVIEW-developer, but I could need all the help I can get on my problems.
 
So, I hope you guys could figure out my problems from my crude English.
0 Kudos
Message 1 of 7
(4,779 Views)

For future reference, it is much easier to answer questions when they are asked explicitly and discretely.

 


LiQ wrote:
As of now, I'm using a System Tab Control to separate the two parts of the program, but I'm not sure how to make the program wait for all the input in the String Controllers, then allowing the user to hit a "Continue"-button which moves the user to the next tab. This probably isn't that hard, but as I said, this is the first time I'm working with LabVIEW

This is not how you should control data flow. You should control whether or not code operates within a case structure. That is not the correct usage for tabs.


LiQ wrote:
Another problem I have is that I want to save the input data to a TXT-file, which I have looked at and it seems pretty straight forward, but the only way I could make it work was by having to manually configure the path where the file would be saved. What I want to do instead is to use a relative path from the program. So the files end up in a folder called "data" which is in the same folder as the VI is run from. But I don't only want to save it, I want to be able to read it as well. Let’s say that I've got a dropdown list which has a field called "New", then the program should make a new file and put the input data in it and store it whenever I push the "Continue"-button. But if I choose another option from the dropdown list (which should be files already stored), then I want the program to display the information in their respective String Controllers. Anyhow, it's only the first part of this scenario that really is important, but I would like to implement this latter feature as well. 

Use the build path function.

Message Edited by Cory K on 01-20-2009 11:52 AM
Cory K
Download All
0 Kudos
Message 2 of 7
(4,738 Views)

I would advise you to use state machine in your code to make sure the values are entered before data storage begins.

 

Then I would hide the tab-pages control, so your code displays the tab-page with the strings, then when the user hits continue shows the second page.

 

 What kind of data do you want to store? are that several controls? If so I would have a look at the OpenG toolkit, this Open Source package has VIs for storing the controls in an INI like format.

With that approach you can read the files back easily.

 

Please add some code that you have allready.

 

Ton (and your english isn't that bad)

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 7
(4,732 Views)

LiQ wrote: 
But I don't only want to save it, I want to be able to read it as well. Let’s say that I've got a dropdown list which has a field called "New", then the program should make a new file and put the input data in it and store it whenever I push the "Continue"-button.

Message Edited by Cory K on 01-20-2009 12:00 PM
Cory K
0 Kudos
Message 4 of 7
(4,731 Views)

TonP wrote:

 

 What kind of data do you want to store? are that several controls? If so I would have a look at the OpenG toolkit, this Open Source package has VIs for storing the controls in an INI like format.

With that approach you can read the files back easily.

 


Well, there's nothing special about the data, just some personal information like name, weight and stuff like that, and I want it stored in clear text in the TXT-file. As to how I want the program setup, I've made screenshot of my LabVIEW stuff (but there isn't any code yet since I have no idea how to get it to work together yet).

 

 

What I want to do here is have the user type in all his data (or load it from file) and only then should he be allowed to move on to the next tab by pressing the button on the bottom of the program (it's written in Norwegian, but if there's any interest as to what it says, I could translate it). But as you can see, it's only a matter of really simple data here and nothing complex whatsoever.

0 Kudos
Message 5 of 7
(4,714 Views)

TonP wrote:

 

Then I would hide the tab-pages control, so your code displays the tab-page with the strings, then when the user hits continue shows the second page.

 


I kind of know how to hide the tab-page, but I have no idea as to how I could connect my button so it switches to the next tab.

0 Kudos
Message 6 of 7
(4,659 Views)
The button would control a case structure where a new value gets written to a local variable of the tab control.
0 Kudos
Message 7 of 7
(4,657 Views)