RUN_COMMAND not working with "DeGRIB" program

Ice Age MarkIce Age Mark Global Mapper UserPosts: 314Trusted User
edited January 2013 in GM Script Language
Howdy Mike,


Is there a reason that GM might not open some programs using e.g.


RUN_COMMAND COMMAND_LINE="'C:\Program Files (x86)\ndfd\degrib\bin\tkdegrib.exe'" WAIT_FOR_COMPLETE="NO"


While it's true this program "updates" it's GRIB2 files when it first opens (in about 1 minute or so), and has many "ancillary" files and applications, these are all called into use from the user interface after it opens (I think). A simple right click and "open" on the main application (tkdegrib.exe) in Windows opens the program with no problem (that's how I created the desktop shortcut as well).


In GM, using the above simple script just opens a mini-window that appears to be running properly in Task Manager, but when that window is maximized, it is empty and non-functional. Several other random .exe applications I have open just fine in a new window with this same script command.


The program in question is the free NOAA "DeGRIB" GRIB2 decoder. It completely decodes those nasty GRIB2 files and changes it's many component files into shapefiles for use in GM. Right now, I 1) download the GRIB2 file, 2) put it through "DeGRIB" program, 3) load the resulting shapefile in GM.


I've got CuteFTP downloading these automatically; and I just wanted GM to open "DeGRIB" for use at the beginning of my script, as I use it next before loading up the resultant shapefile in GM.


The program can be found here: http://www.nws.noaa.gov/mdl/degrib/download.php


Thanks in advance,


Mark


P.S - you might be interested in this program.

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2013
    Mark,

    If you go to a DOS prompt in some folder other than the DeGRIB application folder and try to run that command line does it run? If you use WAIT_FOR_COMPLETE="YES" instead of NO does that make any difference?

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
  • Ice Age MarkIce Age Mark Global Mapper User Posts: 314Trusted User
    edited January 2013
    Hello Mike,


    "Wait for complete" makes no difference either way. Yes - GM waits patiently forever. No - GM doesn't. In both cases, GM and Windows 7 (64 bit) both seem to think the program is open and running; but it doesn't to go on to access the other necessary (DOS?) applications, as it does when simply opened with Windows. I previously copied the wrong command in my post, I'm using only quotes


    RUN_COMMAND COMMAND_LINE="C:\Program Files (x86)\ndfd\degrib\bin\tkdegrib.exe"


    to accommodate the space before (x86); but the behavior is the same as with the apostrophes included.


    Other applications that should be accessed by the tkdegrib.exe application will run using the command line, but of course only tkdegrib.exe is supposed to work with Windows, so they don't do anything. Two other similar NOAA programs (i.e. programs made for non-Windows use, but with one application made just for Windows), along with Google Earth, my astronomy program, and my primitive weather station program all open perfectly in their own window using this method in a GM script.


    This is no big deal, I'm already doing it all manually, but I don't see any difference between this program and similar ones that open correctly in a separate window using the above script command. It just makes a nice convenient automated process to have GM open DeGRIB first, and then be ready to go, because DeGRIB picks up the GRIB2 files right from where they are downloaded, and after converting to a shapefile, drops them right into the file that GM picks up to display. From my (very) limited computer knowledge it seems that, when opened with GM, tkdegrib.exe isn't continuing on to use the other necessary applications/files as it does when it's opened with Windows. To be clear, I'm not trying to run the DeGRIB program WITHIN a GM script (I'm not that smart), just to have GM open it, as I always must use it first to get a shapefile.


    Thanks,


    Mark
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited January 2013
    Mark,

    I wonder if you create a .bat file that internally calls the DeGRIB application if that would work? Or maybe DeGRIB depends on the working directory being set to the folder of the .exe so it can find the other applications that it needs. So if you have a .bat file, have the first line actually change to the directory with tkdegrib.exe, then run it from there.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.bluemarblegeo.com/
Sign In or Register to comment.