This example shows how to make a Thread in a script file.

Prepare the script file – (here using Notepad)

This thread will turn digital output 1 on and off in 1 second interval. The file is saved with the name “blink.txt” in the same directory as were the GUI program where the script file is to be used.

universal-robots-zacobria-thread-in-script-file-example
universal-robots-zacobria-thread-in-script-file-example

Make a program in GUI.

Insert (import) the script file at top level. Use the “File” function for importing the script file into GUI.

Call the script file with a single line script command using format thrd = run myThread()

Use the “Line” function for writing a single line script command.

universal-robots-zacobria-thread-in-script-file-example
universal-robots-zacobria-thread-in-script-file-example

 

Contribute moderator



Disclaimer: While the Zacobria Pte. Ltd. believes that information and guidance provided is correct, parties must rely upon their skill and judgement when making use of them. Zacobria Pte. Ltd. assumes no liability for loss or damage caused by error or omission, whether such an error or omission is the result of negligence or any other cause. Where reference is made to legislation it is not to be considered as legal advice. Any and all such liability is disclaimed.

If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.

Author:
By Zacobria Lars Skovsgaard
Accredited 2015-2018 Universal Robots support Centre and Forum.

Tweet

Follow @zacobria