SystemLink Forum

取消
显示结果 
搜索替代 
您的意思是: 

Automatically launch python file from SystemLink?

已解决!
转到解答

I have been using SystemLink (R2020) for a while, and I am able to create Analysis Automation Procedures and tasks (both manual, triggered, and scheduled).

 

Now, I would like to launch a python file (basically, a consistency check on the results produced by other procedures) once a day.

 

I thought that a scheduled task would have done the job. Unfortunately, my python script is not associated to a specific file, and it seems to me that if I launch this triggered procedure it will only work if there are new files, and if there are many, it will run multiple times.

 

But I would like to have it launched only once a day, regardless of the amount of old/new files present on the Data Source.

 

Do you know if there is a way to do it with SystemLink and/or DIAdem? I hope my request is clear, if it is not please let me know, and I'll try to explain it the best I can.

0 项奖励
1 条消息(共 3 条)
2,471 次查看
解答
已被主题作者 panta1978 接受

Hi panta,

 

Your Analysis Procedure can be associated with a data store (so that your python script can run data queries) but still not be associated with any data files when it runs.  This will set up your python script to run exactly once with an empty oContext.DataLinks collection/list, regardless of how many data files are in the associated data store.  The key is to set up your ANP file to have NO associated data filter (query) and to execute in comparative mode.

 

In the first "Search Query" tab, make sure the "Data filter enabled" checkbox is UNchecked:

Scheduled_ANP1.png

 

Also make sure in "Analysis Script" tab that the "Evaluation mode" is set to "comparative":

Scheduled_ANP2.png

 

I tested this on my computer and got exactly the behavior you are interested in.

 

Brad Turpin

Principal Technical Support Engineer

NI

2 条消息(共 3 条)
2,453 次查看

It works!!! That's great, thanks a lot, Brad!

0 项奖励
3 条消息(共 3 条)
2,441 次查看