Set Up a Triggered Analysis Server Task to Process New Files

Publish Date: May 19, 2017 | 0 Ratings | 0.00 out of 5 | Print | Submit your review

Table of Contents

  1. Create a New Analysis Server Package
  2. Define the Execution Condition of Your Procedure
  3. Define the Analysis Script for the Procedure
  4. Create a new Analysis Server
  5. Upload an Analysis Procedure
  6. Define a Triggered Task
  7. Test the Entire Process
  8. Next Steps

Define the Analysis Server Procedure in DIAdem

Use the Analysis Server Procedure Configuration dialog box to define the Analysis Server Procedure you then upload to the Analysis Server in TDM Server Manager.

The example assumes that you have an existing analysis routine which you would like to automate using the Analysis Server. The basic steps for integrating your existing analysis routine will be shown. For more details about how to script an analysis procedure, please refer to the DIAdem online help.

 

1. Create a New Analysis Server Package

1. Select the DIAdem Script panel

2. Select Settings>>TDM Server>>Analysis Server Procedure

 

 

3. Click the New Analysis Server Package symbol

 

 

4. Enter the Name of the new Analysis Server Package and an optional Description and Author.

 

 

5. Click OK

 

Back to Top

2. Define the Execution Condition of Your Procedure

In this step you configure the file types your analysis procedure processes. You can refer to information from the file itself, such as file type (DataPlugin), but you can also use any kind of meta data from within the file. In our example, we will narrow down the scope to address only TDM files.

6. Select the Search Query tab.

7. Enable Data filter enabled.

8. Define the following query condition:

 

Level

Property

 

Value

File

DataPlugin name

=

TDM

 

9. Select the Parameter Definition tab.

 

 

10. You can add any additional parameter to an analysis procedure to modify its execution. The ResultsPath parameter is used in the analysis script to determine the output path for analysis results, such as PDF files. The actual value is during the Analysis Server task definition.

 

Back to Top

3. Define the Analysis Script for the Procedure

11. Select the Analysis Script tab.

12. Click Edit to edit the main script (main.vbsa), which is called first.

 

 

The main.vbsa file you created contains example code which includes the most important variables and methods to control your analysis script. The first section of the main Sub (SubOn_Run_AnalysisProcedure( oContext )) gives you an example of how to access parameters from the Parameter Definition (oContext.Procedure.Arguments), how to load actual data into DIAdem (oContext.DataLinks), and how to report back results of your analysis routine (oContext.LogResult (ResultsPath & " ... ")).

 

 

In most cases you can convert your existing scripts with only a few steps: replace the way your current script loads the data by using oContext.DataLinks as data source, and report back results (oContext.LogResult (ResultsPath & " ... ")). You can even use Sub scripts which you refer to with ScriptInclude or REPORT layouts (TDR files) and other files. To add these additional files to your analysis procedure, complete the following steps:

13. To return to the extended view of the Analysis Server Procedure Configuration click on the Extended double arrows.

 

 

14. Click the Add File to the Analysis Server Package symbol to add single files, or

 

 

15. Click the Add Folder to Analysis Server Package symbol to add a complete folder. This is the icon to the right of the Add File to the Analysis Server Package.

To get explore a pre-defined analysis procedure, you can open and browse the “..\National Instruments\Analysis Server\Immediate_Analysis.ANP” example.

 

Back to Top

4. Create a new Analysis Server

The next step is to upload an analysis procedure to the Analysis Server and use this analysis procedure to define a triggered task for files that are indexed by an existing DataFinder.

To setup the Analysis Server task, complete the following steps:

1. Open TDM Server Manager in your web browser and login using your credentials.

2. Select New>>Analysis Server (Note that you can only operate one Analysis Server at a time in TDM Server Manager).

 

3. Enter a Name for the new Analysis Server.

 

4. Click OK.

5. Click Start to start the newly created Analysis Server.

 

 

Back to Top

5. Upload an Analysis Procedure

6. Select the Analysis Server in the list of configured servers, and click Manage.

 

 

7. Open the Analysis Procedures Library page.

 

 

8. Click Add.

 

 

9. Click Browse and specify “..\National Instruments\Analysis Server\Immediate_Analysis.ANP” as analysis procedure (*.ANP).

 

 

10. Click OK.

 

Back to Top

6. Define a Triggered Task

11. Click Back in your browser (or click on the Analysis Server name in the breadcrumb navigation).

 

 

12. Open the Tasks section.

 

 

13. Select Triggered Tasks.

14. Click Add.

 

 

15. Specify ImmediateTask as Task Name.

16. Select the ProcessedDataIndex@... DataFinder as Data Source.

17. Select Immediate_Analysis as Analysis Procedure.

18. In the Parameters list, specify “C:\Users\Public\Documents\National Instruments\TDM Server Demo\Result_Reports” as ResultsPath Value.

 

 

19. Click OK.

The Analysis Server will now execute the ImmediateTask whenever a new file has been indexed by DataFinder as a result of a Data Preprocessor operation.

 

Back to Top

7. Test the Entire Process

By following the complete tutorial series, you have created a complete TDM Server process chain. The Data Preprocessor accepts TDMS files as input and produces cleansed TDM files as output. Those TDM files are indexed by a DataFinder, which triggers an Analysis Server task.

 

 

You can watch this TDM Server processing chain working by completing the following steps:

 

20. Open 4 folders on your desktop.

a.  C:\Users\Public\Documents\National Instruments\DataFinder\Data (Contains Data)

b.  C:\Users\Public\Documents\National Instruments\TDM Server Demo\Raw_Data

i. Delete Data Files if any exist in this folder

c.  C:\Users\Public\Documents\National Instruments\TDM Server Demo\Processed_Data

i. Delete Data Files if any exist in this folder

d.  C:\Users\Public\Documents\National Instruments\TDM Server Demo\Result_Reports

 

 

 

21. Copy the Data and Paste it into the Raw_Data Folder

22. The Preprocessing Routine will create the cleansed and enriched TDM files, followed by the triggered analysis routine that produces a PDF report

23. In the TDM Web Manager navigate to the Current and Completed Tasks section in the Configuration

 

 

 

24. Click Completed Tasks to see tasks which have executed.

 

 

Note: If the data triggering a task does not apply to the filter condition for task execution, the specific tasks are displayed in the list with the Status No matching data.

25. Click Current Tasks to look for tasks which are currently being executed by the Analysis Server. This process happens quickly so by the time you get to this step all tasks may already be completed.

 

 

Note: You can cancel current tasks which are still running. If there is an executed task with a series of sub-tasks which, for example, include several files that are being processed in parallel, canceling this task will cancel all unfinished sub-tasks.

 

Searching for Analysis Server Reports (PDF) With DataFinder

Reports created by an Analysis Server task, like PDF files, pictures (.jpeg, .png, …), office documents (.docx, .xlsx, .pptx), data files (.tdm, .tdms, …) can contain custom properties. The custom properties allow you to index and search those files. Use the same custom properties as on the data files root level to search for common data files and (PDF) documents. In the example PDF files, the following custom properties are added to the file level:

  • Test~Module
  • Test~Name
  • Test~Operator
  • Test~Procedure
  • Test~UUT

Apply the following steps to add the PDF documents created by the Analysis Server task (ImmediateTask), to the ProcessedDataIndex DataFinder server:

1. Open TDM Server Manager in your web browser and login using your credentials.

2. Select the existing ProcessedDataIndex Data Finder server in the list of configured servers, and click Manage.

 

3. Open the Search Areas section.

 

4. Click Add.

5. Enter the Name of the search area.

6. Click the Browse button and specify “C:\Users\Public\Documents\National Instruments\TDM Server Demo\Result_Reports” as Path.

 

 

7. Click OK.

8. Click Back in your browser (or click on the ProcessedDataIndex in the breadcrumb navigation).

 

 

9. Open the DataPlugins section.

 

 

10. Select the Documents DataPlugin in the list of DataPlugins.

11. Click Enable.

 

 

To verify whether your newly added search area, including your PDF files, are indexed by DataFinder, you can follow these additional steps:

12. Click Back in your browser (or click on the ProcessedDataIndex in the breadcrumb navigation).

13. Open the System Status section.

 

 

14. Select Index Folder and select Reindex to ensure the reports you have generated are indexed by the DataFinder.

 

 

15. Browse the files in your search areas.

 

 

You can also use the System Status section to investigate indexing issues.

 

Back to Top

8. Next Steps

The exercises in this tutorial are just the basics when it comes to customizing the preprocessor and analysis routines for your needs. The Data Management Software Suite scales to your needs whether you are a single department or a global enterprise looking to manage and analyze your data. Please contact NI to learn more about what our solution can do for your organization.

Also, be sure to check out the other tutorials for the Data Management Software Suite.

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit