Announcement

Collapse
No announcement yet.

Read return value from script by CVI (or C)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Read return value from script by CVI (or C)

    HI
    I built a script and got it from Batch file. In addition, the Batch file is activated by the system command in CVI. I can not read the return value after EXIT in the script.
    I am understanding that this is not exactly the problem of BurnInTest, but still hope for help

    Thanks in advance

  • #2
    There isn't really enough detail in your post to offer any suggestions.
    Do you mean CVI (or maybe CLI?)

    Comment


    • #3
      I work in CVI from National Instrument. From CVI i am calling to batch file "_1.bat", and from "1_bat" script start to run.
      In the end of script i have command EXIT.
      I want to read exit return in main CVI function
      -----------------------------------------------------------------------------------------------------------------------------------------------------------
      This is main program:
      int main (int argc, char *argv[])
      {
      if (InitCVIRTE (0, argv, 0) == 0) return -1; /* out of memory */
      if ((panelHandle = LoadPanel (0, "main.uir", PANEL)) < 0)
      return -1;
      DisplayPanel (panelHandle);
      RunUserInterface ();
      DiscardPanel (panelHandle);
      return 0;
      }
      //func call BurnInTest
      int CVICALLBACK CVI_Start (int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
      { int p_f=-3;
      switch (event)
      {
      case EVENT_COMMIT:
      p_f=system ("C:\\Program Files\\BurnInTest\\_1.bat"); //start script
      break;
      }
      return 0;
      }
      ---------------------------------------------------------------------------------------------------------------------------------------------------------
      File _1.bat:
      CD C:\Program Files\BurnInTest\
      bit.exe -S "C:\Projects\Hyperpack\_example by VG_script rev 1.0.bits" -R -M
      ---------------------------------------------------------------------------------------------------------------------------------------------------------
      Script file:
      MESSAGE "START Test"
      SETLOG LOG yes NAME "C:\Projects\Hyperpack\Log dir\Last-LOG.htm" TIME yes REPORT text REPORt html
      SETLOG LOGLEVEL no TRACELEVEL no SUM no LINES 10000 PERIODIC 0 FILE append

      STARTLOGGING
      LOG "Start of Test
      LOG "Set up the test environment"

      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg max operat CPU.bitcfg"
      LOG "RUN CPU OPERATION TEST"
      RUN CPU
      ################################################## ################
      LOG "RUN 2D Graphic memory TEST"
      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg 2D_graph all_mem.bitcfg"
      RUN 2D

      LOG "RUN 2D Graphic display watch TEST"
      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg 2D_graph pic_run 50load.bitcfg"
      RUN 2D
      ################################################## ################
      LOG "RUN CPU OPERATION TEST"
      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg HD cyclic.bitcfg"
      RUN DISK
      ################################################## ################
      LOG "RUN NETWORK Loopback TEST"
      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg net loopback internal.bitcfg"
      RUN NETWORK
      ################################################## ################
      LOAD "C:\Projects\Hyperpack\_config tst\_cnfg max temperature CPU.bitcfg"
      LOG "RUN Temperature CPU TEST"
      RUN CPU
      LOG "Testing complete"
      MESSAGE "TEST FINISH"

      #Exit coomand BIT and return 0=PASS 1=FAIL after test
      EXIT

      Comment


      • #4
        CVI from National Instrument
        Sorry we have never heard of CVI.
        You surely know more about it than us.

        If you are coding in C++ in Windows, then you can call CreateProcess() and GetExitCodeProcess() to launch the process and get the return code.

        Comment

        Working...
        X