Jump to content

reading multiple files


Recommended Posts

Hey folks!

I am trying to figure out how to load a user specified numbr of files, say 1 - 5, so that the user can look at one of the files at a click of a button. I want to load five files at once but only look at the data from one file at a time. I tried using a for loop to load in the files specified, then have a case structure sort the data accordingly depending on how many files were loaded, then I used an event structure to specify which file to display at a click of a button. Of course it doesnt work thats why I am posting but I will load my code if you want to take a look at it.

Download File:post-6424-1161888523.vi

Link to comment
Hey crelf,

I have a question about the code you helped me with. I am trying to pass the array values outside the while loop so I can use them in another while loop. I can not get it to work, I tried a couple of things but I attached the more simple version here.

Thanks

Kevin

Use a shift register to pass out the array data.. as shown in the image.

Sorry I have only LV 8.20 on my PC, so I am not sure if the attached edited VI will be of help.

Neville.

post-2680-1162322868.jpg?width=400

Download File:post-2680-1162323074.vi

Link to comment

So the only way to get the data out is when I stop the while loop? I don't want to stop the procedure to get the data because I then have to start it back up and select the files again, so that would defeat the whole purpose of me trying to do this. I have been passing other data in and out of while loops with local variables, but it is not working here. I am trying to be able to load multiple files so that I may look at them one at a time and everytime I look at a different file it displays the data . I already have the procedure to display the data and it works fine when I load one file, but I can not seem to read multiple files and display each data set on command. I have tried a couple of things, but I can not get everything to work together.

Link to comment
So the only way to get the data out is when I stop the while loop? I don't want to stop the procedure to get the data because I then have to start it back up and select the files again, so that would defeat the whole purpose of me trying to do this. I have been passing other data in and out of while loops with local variables, but it is not working here. I am trying to be able to load multiple files so that I may look at them one at a time and everytime I look at a different file it displays the data . I already have the procedure to display the data and it works fine when I load one file, but I can not seem to read multiple files and display each data set on command. I have tried a couple of things, but I can not get everything to work together.

I am not sure what exactly you are trying to do, but here is an approach:

Add a Process button, link that to a separate value change event on your Event structure, and within the Process state of the event structure feed in the array from the shift reg and do whatever you want to do.

The loop is basically stopped waiting for an event.. if none is generated, then it just waits forever; the way you have the event structure set up, it can either stop or read a file.

If you want to read the files again, put the whole mess into another While loop that will allow you to get at the next set of files.

Neville.

Link to comment
  • 5 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.