1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Stäubli & Bosch Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

difference between Taskcreate and Taskcreatesync

  • Rahul Sajeev
  • May 9, 2022 at 8:42 AM
  • Thread is Unresolved
  • Rahul Sajeev
    Trophies
    2
    Posts
    6
    • May 9, 2022 at 8:42 AM
    • #1

    Hello,

    I wanted to know the difference between usage of taskcreate and Taskcreatesync in Val3. I went through the val3 documentation but couldn't understand how both varies when we use it in a Val3 application. It would be better if an example could be provided.

    Thank you

  • JeffBO
    Reactions Received
    3
    Trophies
    2
    Posts
    13
    • May 9, 2022 at 2:18 PM
    • #2

    Hi Rahul,

    In a few words :

    TaskCreate : Task is executed "continuously" depending on the given priority level.

    TaskCreateSync : Task is executed every x.xx second. Priority level is 3000 (factory setting, can't be modified).

    Example :

    TaskCreate "MyTask",50,ExecuteATask()

    --> Function ExecuteATask() is executed once, with a priority of 50. You can have an infinite loop in your function.


    TaskCreateSync "MyTaskSync",0.5,bOverrun,ExecuteASyncTask()

    --> Function ExecuteASyncTask() is executed every 0.5 second.

    bOverrun=true : function is executed to the end, even if it takes more than 0.5s

    bOverrun=false : function is killed if not completed after 0.5s

    NEVER use infinite loop in such a function, otherwise your CPU will run out of resource.

    Hope this helps,

    Jeff

  • Rahul Sajeev
    Trophies
    2
    Posts
    6
    • May 10, 2022 at 8:11 AM
    • #3

    Thank you for the reply

    when I used the TaskCreate and ran the function, It showed invalid task name

    TaskCreate sFilling,10,Task()

    This was the code I used but it showed invalid task name

    Edit: I tried using a normal string instead of using a string variable and it worked. Thank you for your help

    Edited once, last by Rahul Sajeev (May 10, 2022 at 11:00 AM).

  • ElEsgalho
    Reactions Received
    17
    Trophies
    3
    Posts
    119
    • May 12, 2022 at 4:06 PM
    • #4
    Quote from JeffBO

    Hi Rahul,

    In a few words :

    TaskCreate : Task is executed "continuously" depending on the given priority level.

    TaskCreateSync : Task is executed every x.xx second. Priority level is 3000 (factory setting, can't be modified).

    Example :

    TaskCreate "MyTask",50,ExecuteATask()

    --> Function ExecuteATask() is executed once, with a priority of 50. You can have an infinite loop in your function.


    TaskCreateSync "MyTaskSync",0.5,bOverrun,ExecuteASyncTask()

    --> Function ExecuteASyncTask() is executed every 0.5 second.

    bOverrun=true : function is executed to the end, even if it takes more than 0.5s

    bOverrun=false : function is killed if not completed after 0.5s

    NEVER use infinite loop in such a function, otherwise your CPU will run out of resource.

    Hope this helps,

    Jeff

    Display More

    I couldn't say better.

    Just adding some more recomendation about TaskCreateSync, please keep it simple and small. As Jeff said, your CPU will run out of resources.

    Also, you are only allowed to have 2 sync tasks simultaneously, I would say 99% percent of the time you don't need a sync task, normal tasks are fast and reliable enough.

  • Galet
    Reactions Received
    19
    Trophies
    2
    Posts
    141
    • August 11, 2022 at 2:23 PM
    • #5

    Are you sure that the value of sFilling is correct ?

  • mil3k
    Reactions Received
    15
    Trophies
    3
    Posts
    71
    • August 18, 2022 at 3:00 PM
    • #6
    Quote from Rahul Sajeev

    TaskCreate sFilling,10,Task()

    This was the code I used but it showed invalid task name

    Did you create sFilling global variable before you tried to use it? It should find it in Application's Data tab inside string variables branch.

  • Galet
    Reactions Received
    19
    Trophies
    2
    Posts
    141
    • August 19, 2022 at 8:21 AM
    • #7

    Be carreful that the structure of taskCreate and taskCreateSync are not the same :

    taskCreate sName, nPriority, program()

    taskCreateSync sName, nPeriod, bOverrun, program()

    If you don't use good parameters the line is invalid !

    Other thing :, be carreful of uppecase and lowercase of the key words and variable. In Val3 program, you need to respect everytime the script.

    Try le line :

    taskCreate sFilling,10,Task()

    Edited once, last by Galet (August 19, 2022 at 8:26 AM).

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Tags

  • VAL3
  • tx260
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download