From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-26-2018 09:30 AM
I have a .vi that is collecting analog signals inside a while loop. I am using the producer/consumer (data) template to write the analog data to a file. I am using the Open/Create/Replace file function to open a file then write to it then close it. I currently have the open/create/replace function outside the while loop, the write to file inside the while loop, and the close file outside the while loop.
Here is my issue: when I run the program there is no dialog box to select the file path. It immediately gives error 43 (on and indicator) which says I cancelled the dialogue box. I didn't even see a dialog box. I have no input to the "file path" input to the create file function. It's almost like the dialog box opens and closes before I even see it. How can I fix this?
I cannot upload or download my .vi right now but any help is greatly appreciated!
Solved! Go to Solution.
06-26-2018 09:56 AM
Is this running on an RT system?
06-26-2018 10:07 AM
No it is not.
06-26-2018 10:51 AM
@MikeIsMyName wrote:
I cannot upload or download my .vi right now but any help is greatly appreciated!
06-26-2018 03:04 PM
The file is attached. It shows the producer/consumer loop and the create file function leading to the consumer loop. When the program is ran it just simply starts streaming the data to the charts on the front panel without asking where to create the file. The error code is 43 saying the user closed the dialog box even though it never shows up.
06-26-2018 03:31 PM
Hi Mike,
The dialog popped up for me ok.
Also, this is the same problem of writing to a file from your other thread, please keep all discussion in the same place so we don't duplicate each other's efforts to answer your question.
https://forums.ni.com/t5/LabVIEW/Exporting-Data-to-Excel-From-While-Loop/m-p/3809205#M1075638
06-26-2018 04:35 PM
What would be the reason for it to pop up for you but not for me? Is it where I saved the .vi or the project to? Should I save it to a different folder? I also run labview as administrator everytime. Hmmmm.
06-26-2018 07:42 PM - edited 06-26-2018 07:50 PM
Without the sub vi I can merely guess what may be happening. (Oh, but my 8-Ball is magical!)
You probably get a default value out of Refresh rate that is zero. (That combo box shou;ld be a ring!)
This leaves the top loop greedy and the ui thread swamped by the chart refreshes and the plot color property nodes (Consider using a value change event to set the plot colors in a separate loop)
So there is really no time to toss up the dialog box that needs an idle ui thread to pop-up. When you press stop The other stop or get an error you immediately destroy the queue signaling the logging loop is ready to exit. Then the dialog box should appear... unless you hit the abort button to stop the vi (quit doing that!)
Also, Time stamps are incremented by seconds so to convert to excel time you multiply by 86400 sec / day and then add the number days between dec 31 1899 and Jan 1 1904 (1461) and then add 1 more for the bug in Excel that forgot 1900 was not a leap year.
06-26-2018 09:33 PM
@JÞB wrote:
Also, Time stamps are incremented by seconds so to convert to excel time you multiply by 86400 sec / day and then add the number days between dec 31 1899 and Jan 1 1904 (1461) and then add 1 more for the bug in Excel that forgot 1900 was not a leap year.
I think you also need to add or subtract the number of seconds based on your timezone offset. So for EST (UTC -5), you'd have to account for 5 hours worth of seconds (5x3600) since LabVIEW times are based on UTC and Excel bases them on your current timezone.
06-27-2018 06:49 AM
You guys have been extremely helpful and I appreciate that! I believe I found the issue but the fix is still eluding me. Here it is:
The 5 analog signals coming in are coming from a myRIO. I believe the .vi I have written is trying to create the file to the myRIO instead of to my computer. Now, for a producer/consumer structure, can I create the consumer loop in a seperate vi that will know to save to computer? I would place this vi under the "My Computer" cluster in the project viewer instead of the vi that is on the myRIO. Is this possible? Can I run the queue between two vi's?