10-06-2016 05:49 PM
Hello:
I'm fairly new to labVIEW and have come across a little problem I can't figure out. We use cRIO's and run real-time applications on them using the minidisplayport to view the front page. We are use 2015 SP1. The VI controls a piece of equipment. Primarily data aquisition. At specified intervals the operator will push a "snapshot button" which saves temperature and pressure values to a datasheet.txt file which is in a folder i created on the cRIO. I want to add a button on the front page that will open the .txt file so that the operator can view it. I'm using the System Exec.vi to open the file. When I tested it on my pc it works fine. I wired "notepad datasheet" to the command line and when the button is pushed the VI launches notepad and then loads the file (datasheet.txt). When I try it on the deployed VI on the cRIO I cannot get it to work. I believe the "notepad" on the cRIO is called "mousepad". So I tried wiring "mousepad datasheet" to the system exec VI but no dice. I've tried the full path of the file in the command line and still no dice. Any help would be great.
Thank you
10-06-2016 06:48 PM
I'm quite sure the cRIO does not have notepad. And I've never heard of "mousepad". Where did you hear about this?
Instead of using a system exec command, why not just have VI that is called and opened dynamically in parallel that reads the test file and displays it in a large string indicator.
10-07-2016 07:22 AM
Thank you for your response. If you connect a keyboard, mouse and monitor to the cRIO you can open and rummage around in the file manager. If you double click on a read me file, text document or even a INI file, they will open in a window. The top of the window says "mouse pad" so I assumed that mouse pad is the default linux text reader that the cRIO uses. So my theory is that if I can call Notepad and open a text file from my VI (using system exev VI) when it is run on a PC. Then I should be able to do the same in the linux environment when my VI is running on a cRIO. I think I'm just not writing the command line correctly.
Thank you
10-07-2016 07:55 AM
You may need to call it via a full path. Notepad can be found in Windows' PATH list, so you don't need to call it by its full path.
10-07-2016 08:42 AM
Yes I tried that and it still doesn't seem to work. The command line input is a string so this is the path I'm using
"/c/files/datasheet.txt" in string form. I placed a folder named "files" on the c drive of the cRIO. The system exec VI has an input for a path but the instructions say not to use it to find the file. The command line is used for this.
10-07-2016 08:53 AM
Did you try the full path to the mousepad application?
10-07-2016 08:56 AM
I tried to find it in the file manager but I can't find it.
10-07-2016 02:50 PM - edited 10-07-2016 02:54 PM
@RavensFan wrote:I'm quite sure the cRIO does not have notepad. And I've never heard of "mousepad". Where did you hear about this?
Instead of using a system exec command, why not just have VI that is called and opened dynamically in parallel that reads the test file and displays it in a large string indicator.
Yeah if you didn't realize it yet mousepad is the text editor installed with XCFE interface (the new cRIOs running RT Linux with a display).
You can open mousepad with a text file the same way you can notepad. Just pass in the path to the file as the first parameter.
Otherwise you can do as others have said and write a VI that uses the Read Text File and displays it on the front panel.
EDIT: Actually it seems the logged in user on the UI and the one from a VI are different and I'm having difficulty when doing this from a VI. But in a terminal in the main UI you can just type mousepad ./<File Name> and it will open it.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-07-2016 02:59 PM - edited 10-07-2016 03:00 PM
Okay figured it out. You need to specify what monitor the program needs to be opened on, then invoke the command with the path to the file to be opened.
(BTW I love RT Linux)
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-07-2016 03:07 PM - edited 10-07-2016 03:09 PM
Oh and I actually just thought about this. You can install Wine if this is a x86 based controller, so that Windows programs run in Linux. If you do this notepad is actually included in the virtual environment and the command call wine notepad ./<File Path>.txt will actually work as well but it is quite a bit of overhead and extra files just to view a text file. You'll still need to specify the display as I showed with mousepad.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord