LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to create a button on the front panel that would automatically open the txt file data is being stored to?

I am saving data read from FieldPoint to a .txt file. Is there a way to create a button on the front panel so that when the user pushes this button it automatically opens the .txt folder in notepad? I want to bypass the user having to find the file in the computer in order to open it.
0 Kudos
Message 1 of 7
(3,097 Views)
Create a parrallel loop on your diagram that runs until the main loop is done (a local copy of the stop button for this).

Drop a case into it that is controled by a Boolean on your front panel.

Make sure the main loop updates a global (LV2) that holds the pathe the .txt file being written.

In true case driven by your button, read path from global and use it to build a string that you pass to the SysExec.vi.

Do not know sysntax to open notepad but it should be easy enough to figure out.


Also, make sure the file is opened as "shared" by the writer.

This should get you close.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 7
(3,097 Views)
I am newer to LabVIEW and am having troubles understanding the global variables. I put a path file in the global variable that describes the .txt path I want it to display eventually. What do you mean when you say build a string from that path? Also how do you update a global variable from the main loop? I also can't find much info on sys exec and what exactly the format should be of the things you hook to it. I certainly can't find how sys exec will display it.
JEM
0 Kudos
Message 3 of 7
(3,097 Views)
Hi jem,

I suggest that you break this up into three seperate questions and re-post to this list. That way you get more ideas from others that may have better insites than myself.

Re:the sysexec

The Sysexec will allow you to execute a dos command. This is the equivalent of going to

Start>>>Run

What you should do is find the proper DOS command sysntax that is required to open a text file in notepad or your favorite editor. Once you know what a good DOS command is, you should pass that string to the Sysexec.VI. The Sysexec has an input that allows you to choose if the code waits for the command to complete or if it should just start the program and let it run in the background. Sysexec will open its own window to run the command you speci
fiy.

Ben

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(3,097 Views)
I also suggest posting your Q's to the LV list.

More people monitor that list than DSC.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(3,097 Views)
Attached is a simple VI (in LV6 format) that does exactly what you want. It uses the SystemExec.vi to run the following dos command:

Notepad "%s"

Where %s is the path to your data file. Enjoy.
http://www.medicollector.com
Message 6 of 7
(3,097 Views)
Perfect. Thank you very much. I was missing the notepad "%s" which is why mine wasn't working. Thanks again!
Joan
0 Kudos
Message 7 of 7
(3,097 Views)