Jump to content
OMRON Forums

Thread-safe motion program


erikj
 Share

Recommended Posts

Hi, Is there a way to make a motion program thread-safe so that it can be called multiple times simultaneously from gpascii? I want to create a generic program that moves an arbitrary motor to a specified position. I want to be able to pass in the motor number, possibly using a P variable. I can easily use blocks of P variables assigned to each motor number to pass in other information (position, rate, etc), but I don't see a clean way to pass in the motor number while still maintaining thread safety (I don't want a second program invocation to step on the motor number used by the current runnning program). The only solution I can think of is to have a separate motion program for each motor. Thanks, Erik
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Erik, If you use CSGlobal variables (equivalent of Turbo PMAC Q variables) instead of Global variables (Equivalent of Turbo P Variables), as long as your instances of execution are in separate coordinate systems, your motion program would be thread-safe. You can also use sub-programs and pass the motor number and parameters as arguments to it where they will be accessible inside the sub-program as local variables and each instance will have its own set and there won't be any cross-talk. Regards,
Link to comment
Share on other sites

  • 2 weeks later...
[quote='Sina' pid='1240' dateline='1296493584'] Erik, If you use CSGlobal variables (equivalent of Turbo PMAC Q variables) instead of Global variables (Equivalent of Turbo P Variables), as long as your instances of execution are in separate coordinate systems, your motion program would be thread-safe. You can also use sub-programs and pass the motor number and parameters as arguments to it where they will be accessible inside the sub-program as local variables and each instance will have its own set and there won't be any cross-talk. Regards, [/quote] Hi Sina, A belated thanks for this advice. I have done what you suggested and have a generic move program working. I only have one motor connected now, but we plan on testing with multiple motors soon. regards, Erik
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share


×
×
  • Create New...