Calling external programs using labview

I have a LV program running to collect and display data, but also need to call an external program while doing this. I have a menu set up where one button launches my system control .vi, one launches my data display .vi, but there is another feature that is handled by a program a co-worker has written. Is there a way that whenever a button is pressed, LV can launch an external .exe file? Basically, I just need LV to call the executeable... the program that is called will be terminated by the user.
Jim

Try function palette -> Communication -> System Exec.vi
George Zou
http://gtoolbox.yeah.net
George Zou
http://webspace.webring.com/people/og/gtoolbox

Similar Messages

  • Load external program using labview

    Hi, i want to be able to run an external program e.g. a calibration routine using some other software. Then close the sequence i run in the external program, then run another sequence. Whats the best way of doing this?
    Stu

    Are you trying to invoke this program and then interact with it like a user would and then continue on with your program?
    You would need to know if this other application has some type of machine interface (API). It would be very difficult if not impossible to simulate a user to control the application through its UI. How does this application normally run? Does it support ActiveX? If so, you can interact with it that way. You would have to know the specifics of whatever interface it provides. Without that information I am not sure we could really give you any other suggestions.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to call external programs?

    I have seen people call external programs through LabVIEW and was curious what functions you could use to do this.
    I'm pretty sure its using one of the ActiveX functions  or maybe 'open application reference .vi'.
    Can anyone tell me (or show me) a quick example of how to open an external program (ie excel,  notepad, etc) programatically
    Cory K
    Solved!
    Go to Solution.

    Cory K wrote:
    Where did they get this:
    Kudos for going from "I don't know to start" to "Let's stump Ben" with only the second post to this thread.
    I either copy it from an example or try to browse to it.
    NOTE:
    If you plan to work with MS ActiveX objects, I found it very helpful to do a custom install of Office and make sure the help files for VBA are loaded. These will at the least give you an idea of what the methods are and what parameters go with each.
    Ben
    Message Edited by Ben on 12-31-2008 11:09 AM
    Message Edited by Ben on 12-31-2008 11:13 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Browse.PNG ‏24 KB

  • Need help writing host program using LabView.

    Need help writing host program using LabView.
    Hello,
    I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
    I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
    eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
    My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
    I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
    Any help would be appreciated.
    Regards, George
    George Dorian
    Sutter Instruments
    51 Digital DR.
    Novato, CA 94949
    USA
    [email protected]
    m
    (415) 883-0128
    FAX (415) 883-0572

    George may not answer you.  He hasn't been online here for almost eight years.
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice

  • To call external program

    I would like to know if exists a way of to call external program in windows ce. I'm using cvm J9.

    I don't know how is configured Windows CE, but Windows ME is MIDP 2.0, and formRequest(URL) do it (but work only since MIDP 2.0).
    It's work, but in my case, i try to add arguments, and it doesn't work with : URL = "/Program Files/MyProg/myProg.exe arg1 arg2". If somebody have found a solution...

  • How to read data from PC format external disk, using Labview MAC

    Hi folks,
    For years I have not been able to read data files from a PC formatted (created) external disk, using Labview for Mac. More specifically:
     - I have Labview 7.01 running on OS X 10.4.11 on a PowerBook G4
     - I have a 500GB external USB/firewire disk that was formatted on a PC and has data files (custom format) that were created on the PC. I believe that C code actually creates the files, but Labview 7/PC opens the files and appends some info (I don't think the fact that C or Labview touches the files is actually relevant to this issue though).
     - I can connect the 500 GB disk to my mac, and it will mount just fine and OS X can see all of the data files (and anything else on the disk).
     - if I use my Labview app to open and read a data file it fails:
           - open/create/replace.vi (with read-only access) shows a file dialog window that lets me navigate to any file on the external disk.
           - but, the vi returns an error 7
     - if I use OS X to copy the data file to my Mac disk, my Labview app works fine.
    So, does anyone know if:
     - I'm just doing something wrong in my Mac Labview app?
     - Labview 7.x solves this problem?
     - Labview 8/Mac solves this problem?
     - OS X 10.5 solves this problem; with Labview 7 or 8; or does OS X 10.5 worsen the problem?
    Thanks, in advance...

    Hi kehander,
    Thanks for the reply. I tried filling a constant path with the Mac-defined path to a data file on the USB disk (ie "DATA2:file1.dat"). This resulted in the same error message.
    I then considered that maybe I was misinterpreting the LV error message, and that perhaps I was supposed to address the file using PC-notation (ie. "DATA2\file1.dat"), even though the app is running on a Mac. No joy with this, but I get a different error msg:
    "Error 1430 occurred at Open File
    Possible reason(s):
    LabVIEW:  The path is empty or relative. You must use an absolute path."
    Can you share what your reasoning was for your suggestion... I'm not sure I understand why a constant path would produce different results?

  • Running external program using java

    hi
    i am trying to run an external program using the runtime.exec() method. my problem is that the external program only runs when i press ctrl-c to exit my program. does anyone know how i can execute the external program while my program is still running without having to quit the program?should i be using threads?
    thanks

    As per the api doc exec will be executed as a seperate process
    Process exec(String command) ------Executes the specified string command in a separate process.
    Can you able to share that code what you have written ?

  • Can I program using Labview without HW from NI?

    I am a newbie about LV. So I ask the simple question:
    Can I program using Labview without HW from NI?

    You can not only program in LabVIEW without hardware from NI, but you can program without hardware period. You can also write programs for other brands of hardware. You can even program for NI hardware with other programming languages.
    Get some training, and a copy of "LabVIEW for Everyone" before you get too far. These are great resources for learning LabVIEW.

  • When I call an external program from Labview, how can I embed the interface into the front panel?

    I'm running Labiew 6i for Linux. I'm using a system exec.vi to call an external program to do image manipulation (since there is no IMAQ for linux). How can I embed the user interface of the external program into the front panel of Labview?

    As far as I know, the only way to embed other GUIs in LabView is an ActiveX in a container.
    As long as you are using Linux, try to place (moving them on the desktop ) the two windows linked (like those 3 of WinAmp).

  • How do i open and control other programs using labview?

    I'm presently trying to use labview to try to open and operate another program,but having much difficulty.The external program i'm using is called the Foundation program.
    This Foundation program will use VHDL programming to create a virtual chip and then synthesising it.This program will then simulate the output of this VHDL program to verify that it is working as desired.Then the last stage is to download the whole VHDL program into a FPGA chip using a xilinx cable.
    All this need to be done using a labview program - to open the Foundation program and then extract the saved file and then to execute the download command to cause the VHDL program to be downloaded onto the FPGA chip.How do i go
    about doing all this?What is the first step i must do.Also all this have to be done thru networking..looks like its too difficult..I really need help.
    grays

    I haven't done VHDL so pardon my ignorance.
    LabVIEW can call external DLL via "Call Library Function" or C programs via "Code Interface Node", both located in "Advanced" function.
    If your program is a DOS program, use "System Exec.vi" found in "Communication" function. If you need to format your DOS command prior to sending it, use the "Format Into String" function in "String" function palette.
    Lastly, if you're trying to extract data, assuming it is text, use "File I/O" functions. If the data is binary, use "File I/O -> Binary File VIs".
    Hope that answers most of your questions.
    Shan Pin Koh

  • Call external program in background mode

    Hi,
    I am creating a PO using bapi BAPI_PO_CREATE1 in exit USEREXIT_SAVE_DOCUMENT_PREPARE.
    I dont want to write the code in my exit. Instead I want to write the code in a Z program and call it in my exit.
    My Problem.
    How do I call my z program in my exit so that I can pass internal tables from my exit to the z program. Also I want to schedule the call of my external program for background processing.
    I am trying with SUBMIT ZPROG AND RETURN. But not able to pass an internal table.
    I tried PERFORM BAPI_PO_CREATE IN PRGRAM ZPROG, but in this case not able to schedule it in background.
    Please advise.
    Regards,
    Shobhit

    Hi Rich,
    Im setting runtime error:
    My Code in Exit: (xvbfa is the table which i wanna pass)
    concatenate 'SERVICEPO' sy-datum into l_key.
    export xvbfa = xvbfa
                  to shared buffer indx(st) id l_key.
    My Code in the called program ZMM_SERVICE_PO
    Runtime Errors         CONNE_IMPORT_WRONG_OBJECT_TYPE
    Exceptn                CX_SY_IMPORT_MISMATCH_ERROR
    Date and Time          05.12.2005 21:41:54
    ShrtText
         Error when attempting to IMPORT object "XVBFA".
    What happened?
         Error in ABAP application program.
         The current ABAP program "ZMM_SERVICE_PO" had to be terminated because one of
          the
         statements could not be executed.
         This is probably due to an error in the ABAP program.
         When importing the object "XVBFA", the object in the
         dataset had a different type from the target object in the program
         "ZMM_SERVICE_PO" (object types: field, field string/structure, table).
         table).
    Error analysis
         An exception occurred. This exception will be dealt with in more detail
         below. The exception, assigned to the class 'CX_SY_IMPORT_MISMATCH_ERROR', was
          not caught, which
          led to a runtime error. The reason for this exception is:
         The object "XVBFA" has a different object type in the dataset from
         that in the target program "ZMM_SERVICE_PO". (Object types: Field, flat
          structure,
         deep structure, flat table, deep table).
    Missing Handling of System Exception
        Program                                 ZMM_SERVICE_PO
    Trigger Location of Exception
        Program                                 ZMM_SERVICE_PO
        Include                                 ZMM_SERVICE_PO
        Row                                     43
        Module Name                             START-OF-SELECTION
    Source Code Extract
    Line  SourceCde
    REPORT  ZMM_SERVICE_PO.
    DATA: l_poheader      LIKE bapimepoheader.
    DATA: l_poheaderx     LIKE bapimepoheaderx.
    DATA: l_poitem        LIKE bapimepoitem     OCCURS 0 WITH HEADER LINE.
    DATA: l_poitemx       LIKE bapimepoitemx    OCCURS 0 WITH HEADER LINE.
    DATA: l_cond          LIKE BAPIMEPOCOND     OCCURS 0 WITH HEADER LINE.
    DATA: l_condx         LIKE BAPIMEPOCONDX    OCCURS 0 WITH HEADER LINE.
    DATA: l_poschedule    LIKE bapimeposchedule OCCURS 0 WITH HEADER LINE.
    DATA: l_poschedulex   LIKE bapimeposchedulx OCCURS 0 WITH HEADER LINE.
    DATA: l_purchaseorder LIKE bapimepoheader-po_number.
    DATA: l_return        TYPE BAPIRET2 OCCURS 0.
    DATA: l_error_found   TYPE c.
    DATA: l_show_messages TYPE c.
    DATA: l_eindt(10)     TYPE c.
    DATA: l_answer        TYPE c.
    DATA: l_VBAK          TYPE STANDARD TABLE OF VBAK WITH HEADER LINE.
    DATA: l_VBFA          TYPE STANDARD TABLE OF VBFA WITH HEADER LINE.
    DATA: xlips           TYPE STANDARD TABLE OF LIPS WITH HEADER LINE.
    *DATA: xvbfa           TYPE STANDARD TABLE OF vbfa WITH HEADER LINE.
    DATA xvbfa like vbfa.
    DATA: l_key(60) type c.
          concatenate 'SERVICEPO' sy-datum into l_key.
    >>>>> import xvbfa = xvbfa
                      from shared buffer indx(st) id l_key.
          delete from shared buffer indx(st) id l_key.
    Could you help.
    Regads,
    Shobhit

  • How to call another program from LabVIEW?

    Hi!
    Is there anyone that can answer my question? I have found a similar thread where the user needed to call labVIEW from some program but I want to do the opposite.
    I made a program in labVIEW that communicates via COM-ports (serial communication) with the processor I use at the job (Ubicom´s IP2022).
    Now I want to add more funcionality to this program. I want to be able to program re-program IP2022 through this LabVIEW application.
    The programming is done via an Ethernet-dongle. I start a program called IP2kProg, I write the ip-address of the dongle and the program-file (.elf) downloads at this address. But how can I do this from
    LabVIEW, do I need to open IP2kProg or can I send some values to it via LabViEW?
    Ant suggestions?
    Thanks, Amir

    Amir,
    There are couple of options:
    1.  If your IP2kProg program has a command-line interface, you can use LabVIEW's System Exec.vi and send the commands and parameters to it. 
    2.  If the IP2kProg has an API / exported functions, you can call them from LabVIEW using the Call Library Function Node. 
    Hope this gives you some ideas. 
    -Khalid

  • Language other than bash for calling external programs

    Hi,
    sorry for the unspecific title, I couldn't think of a better summary.
    The problem is this: I have written a script to encode a DVD to H264 and Vorbis. Since it basically just performs some (OK, by now: A lot of.) management and then calls a external programs, Bash was the obvious choice.
    However, the administrative stuff the script does (evaluating user input, calculations etc.) was already a nightmare to code in Bash (lack of arithmetic, lack of data types, proper functions, lack of c-like structs etc.), and I now want to make it even more flexible in what the user (me) can ask of it (it's also going to use a config file, which is another thing that gets ugly fast). Frankly, I can't stomach that.
    So the question is this: What language would be sensible for a program the most important function of which is calling other programs?
    Simply executing them from the main program isn't enough, unfortunately, because I want to make use of multicore system by for example simultaneously extracting streams and encoding them (right now that is done through named pipes), ideally I'd need a way to multithread not internal functions/routines but external programs (Through pipes or whatever).
    I'd prefer an interpreted language, but it's not a requirement.

    I second what peets said. Perl is definitely you're best option here, in my opinion anyways. It has the best (by which I mean easiest) system interface of any scripting langauge I've worked with, and if you want a simple configuration file reader, perl's regex'es are king. Perl also takes a lot of features from the shells, such as the file test operations. If the project get's really big and hairy though, it might be worth considering python as a cleaner, stricter alternative.
    Hope that helps!

  • Calling External Program

    Hi all,
    I’m currently doing a program that will trigger an external batch (.bat) program. I’m using WS_EXECUTE function module to trigger the external program. I need to know that whether ABAP will wait until the external bat program run completed then only will go back to the calling program and execute the rest of the ABAP code; or the WS_EXECUTE will just trigger the external program then continue the rest of the code in ABAP.
    Best regards,
    Patrick

    Hi Uma,
    FYI, I've run a thorough test, it will run synchronously though it calls an external program.
    I shall take note of the obsolete FM.
    Many thanks,
    Patrick

  • Calling external program on application server

    Hi, everyone. I'm trying to call an external program from ABAP by using SM69 and FM SXPG_COMMAND_EXECUTE
    MOVE 'zlong_bat' to ld_comline.         "Maintained using trans SM69
    * Execute external command, contained in 'ld_comline'
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
           EXPORTING
                commandname                   = ld_comline
    *           additional_parameters   = ld_param  "Params passed to script
    *           operatingsystem               = 'UNIX'
           IMPORTING
                status                        = ld_status
           TABLES
                exec_protocol                 = ld_output
           EXCEPTIONS
                no_permission                 = 1
                command_not_found             = 2
                parameters_too_long           = 3
                security_risk                 = 4
                wrong_check_call_interface    = 5
                program_start_error           = 6
                program_termination_error     = 7
                x_error                       = 8
                parameter_expected            = 9
                too_many_parameters           = 10
                illegal_command               = 11
                wrong_asynchronous_parameters = 12
                cant_enq_tbtco_entry          = 13
                jobcount_generation_error     = 14
                OTHERS                        = 15.
      IF sy-subrc NE 0.
      ENDIF.
    In the  sm69, I define zlong_bat with
        Operating system command: cmd
         Parameters for operating system command: /c remoteconn.bat
    It can run well if remoteconn.bat contain some simple command of dos like dir, md, mk... But when I call a program from remoteconn.bat, the abap program hang. I also cannot test in sm69 because it hang too.
    If I call direcly from sm 69 with
         Operating system command: cmd
         Parameters for operating system command: /c  psexec.exe
    localhost -u test -p 1234
    or
         Operating system command: C:\psexec.exe
         Parameters for operating system command: 
    localhost -u test -p 1234
    The SM69 also hang.
    Are there any method to call a program from sap without hanging
    of course the program is in its position on application server.
    Thank you in advance.
    Regards,
    Long
    Edited by: dragonking88 on Aug 25, 2010 12:54 PM

    Hi Long Le Hoang,
    I am running a shell script fromSM69 which call psexec.
    shell script runs fine but SM69 execution goes on hold.
    Can you please help me how to terminate SM69 execution.
    Alpa

Maybe you are looking for

  • Problem when Copy PO item with customer fields

    Hi all, I've added few customer fields to PO item customer screen via enhancement MM06E005. All works well besides item copy functionality - the system creates new PO item and copies everything besides my 2 customer fields. Any idea why + how 2 solve

  • Use of dummy profit center

    Hi I am on ECC6.0 and profit center accounting is active. I have one dummy center. Now what is the use of dummy profit center. It i because SAP will not allow me to post FI transaction with out profit center because of document splitting. Then how du

  • Synchronous & Fault

    Hi, I have few questions here.. Synchronous 1.For which Adapters we use Synchronous communication mostly.. 2.in Synchronous, how response will be posted to sender again? 3.How to track if there is a problem in Synchronous scenario 4.Where & When to u

  • Where are the Quicktime Transitions gone?

    I miss the basic Quicktime Transitions like Push, Radial or Whipe. Does someone know if this effects are still aviable somewhere?

  • I DVD will freeze right after Process movie

    Hi I Have been trying to burn a movie I created, and the iDVD freazes right after process movie, what can I do?