10-24-2017 11:11 AM
Hi everybody,
Here i uploaded the code to access the two different subvi from main vi once i opened and closed i can't able to open it again.
The main contains a file path and boolean button to open a subvi. The subvi one consists of user data and subvi 2 consists of process window to display the acquired data and log the data in a specified file, here i used event structure to access the subvi and pass the refnum of the file path using queue functions but i don't what is blocking to access both vi's? continously, here i need your help to go further for clarification.
Thank you in advance,
regards,
paul robinson
10-24-2017 11:22 AM
Both SubVIs have while loops with a "stop" button inside of them, are you stopping the SubVIs? You cannot run the SubVI with new inputs until it has completely finished executing, meaning the while loop has stopped.
Also, I'm not sure what you're trying to do with the 2 event structures in your Main VI. Everything can go in your top loop, or if you prefer, include an enum or string with your queue data to select the case of a case structures, but don't use a second event structure. Your UI will lock up whenever the event structure is executing.
10-24-2017 12:57 PM
Looking at your code, it appears that you really need to go and review some of the first Principles of LabVIEW, probably obtainable by carefully paying attention to the first view Video Tutorials that are mentioned on the first page of this Forum. Here are some issues you should consider:
Here's what you need to do.
When you've made the necessary changes, try your code again. It will almost certainly run better, and do "what you want" instead of "what you told it to do" (it should always do the latter ...). Feel free to ask more questions.
Bob Schor
11-08-2017 07:09 AM
Hi gregoryj,
Here i listed what i really wanted to do:
1. From main vi i need to access sub vi at any instant.
2. I need to append the user details in a same data logging file.
I just need some guide to know which way it will works i am new to this labview but i have basic understanding, anyway thanks for the reply.
Regards,
Paul
11-09-2017 11:52 PM
Hi Bob,
Thanks for your reply and i re-edited the code using QMH it works much better know but i have little problem here, when i press the file specify button and again if i close without specifying the path of the file it shows error and also i tried using simple error fuction with no dialogue it still shows the error message dialogue box everytime and also it shows same for promt user when i open it without specifying the file path and it shows error after i closing it, any solutions you got for this?.
Thanks in advance,
regards,
Paul
11-10-2017 02:27 AM
You'll need to check the file path after asking, if it's empty or Not A Path you cannot use it to write to file, send up a one button dialog informing there's no file chosen instead.
/Y
11-10-2017 08:37 AM - edited 11-10-2017 08:38 AM
Hi yamaeda,
First of all thanks for your reply,but i really didn't get it, can you please explain me briefly? and sorry for the excuses.
Regards,
Paul
11-12-2017 05:24 AM
Hi yamaeda,
I tried using your idea but it is not working well you have any other solution to get out of this problem.
Thank you,
regards,
Paul
11-12-2017 10:39 AM
You are using LabVIEW 2013, the last version of LabVIEW to use Read/Write to Spreadsheet File, replacing it with Read/Write Delimited Spreadsheet, whose main difference was the presence of the Error Line in the lower left and right corners (something that NI overlooked for too many years).
With the Error Line in place, calling these functions with a "bum argument" (for instance, failing to specify a legal filename to write) will generate an Error on the Error Line, which you can write code to "trap" and figure out what you want to do (like clear the error, output a Dialog box that says "Oops, you forgot to specify the output File Name" and do the whole process in a loop that exits when either there is no error or the user chooses the "Give Up" option to terminate the program early).
However, you don't have an Error Line on this function, so an error just causes the program to "blow up in your face". What you need to do is to anticipate and prevent errors. Since the most common error is a missing or otherwise illegal file name, you can ask if the File Name meets certain specifications (like "is not Empty" or "is not <Not a Path>") and take appropriate actions depending on the outcome. That's what Yamaeda was suggesting.
Bob Schor
11-13-2017 03:00 AM
Thank you Bob, that was what i meant.
I could be something easy, like this: