Main Content

importFileLogInstruments

R2026b

Import file log instruments from target computer

Since R2026b

    Description

    importFileLogInstruments(target_object.Instruments) imports file log instrument MAT-files from the target computer, validates each instrument against the running application, and adds the instruments to the instrument manager of the Target object. Each Target object has an Instruments property which is an instance of a TargetInstrumentManager. To perform the import operation, the Target object must be associated with a target computer that has a running real-time simulation with file logging stopped.

    example

    Examples

    collapse all

    Upload and add file log instruments that are stored on the target computer to the instrument manager on the development computer.

    1. Create target object and connect to target computer. Open model and configure model for target computer. Build model.

      tg = slrealtime;
      connect(tg);
      model = 'slrt_ex_osc';
      openExample(model);
      modelSTF = getSTFName(tg);
      set_param(model,"SystemTargetFile",modelSTF);
      slbuild(model);
    2. Create instrument object and add signal from real-time application.

      tgInst = slrealtime.Instrument(model);
      addSignal(tgInst,'SigGen');
    3. Add an instrument to the Target object for file logging.

      addForFileLog(tg.Instruments,tgInst);
    4. Start the real-time application on the target computer.

      load(tg,model);
      start(tg,StopTime=Inf);
    5. Exit MATLAB®.

      exit
    6. Some time later, start MATLAB and connect to the target computer.

      tg = slrealtime;
      connect(tg);
    7. To identify what file log instruments are active in the still running real-time application, stop recording in the application and import file log instruments from the target computer. The simulation must be running and recording must be stopped for a successful import operation.

      stopRecording(tg);
      importFileLogInstruments(tg.Instruments);
      getAllForFileLog(tg.Instruments)
      ans = 
      
        slrealtime.Instrument handle with properties:
      
                       Enable: 1
                         Name: 'TargetPC1'
                 AxesTimeSpan: Inf
          AxesTimeSpanOverrun: 'scroll'
                  Application: 'slrt_ex_osc.mldatx'
                    ModelName: 'slrt_ex_osc'
      
      Signals added by addSignal():
      	SigGen
      
      Signals added by connectScalar():
      
      Signals added by connectLine():
      
      Signals added by connectXYPlot():
      
      Callbacks added by connectCallback():

    Input Arguments

    collapse all

    Object that represents target computer, specified as a Target object. The object provides access to methods that manipulate the target computer properties.

    Example: tg

    Version History

    Introduced in R2026b