Starting a Sequence with Python


root

Recommended Posts

Hi

I wanted to start a Sequence from my Python Script. For now I just can load a sequence, but I still have to click on the start button. Is there a way to automize it? And how can I close the DAQ Factory Express from my Python script after my Sequence has finished?

Hope for a quick response

Greets

Link to comment
Share on other sites

So you just want to start DAQFactory, start a sequence, then when the sequence is done, quit DAQFactory? I can't help you with how to start DAQFactory from python, though its probably some sort of shell command. However, to start DAQFactory and load a document, the command line would be:

daqfactoryexpress c:\mydocument.ctl

replacing mydocument with the name of your doc and adding whatever path info you need. Inside your document you should mark the desired sequence as AutoStart. Then it will run when the document loads. To then get DAQFactory to quit when the sequence is finished, just add this line to the end of the sequence:

system.quit()

You may want to add some error catching so that if an error occurs, DAQFactory still quits. It'd be something like this:

try
   ... all your script to do whatever it is you do
catch()
endcatch
system.quit()

Any errors inside the try/catch block will be caught and system.quit() will run no matter what.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.