• March 23, 2023, 07:09:44 AM

Login with username, password and session length

Author Topic: H0-CTRIO Velocity Mode, Command Complete bit  (Read 3087 times)


  • Newbie
  • *
  • Posts: 1
H0-CTRIO Velocity Mode, Command Complete bit
« on: December 16, 2008, 09:44:58 AM »
I attempted to run the H0-CTRIO velocity mode example (from the manual) in a stage program.
The velocity mode routine is in its own stage.

What I found is the command complete bit does not always set, so the program hangs indefinetly.

I added a 500ms timer, and added a rung to restart the stage if the command complete bit is not set after the timer expires.

Now, the program works, but this stage repeats several times before the command complete bit sets.  This slows the operation down too much.

I tried reducing the timer to 300ms, but the stage sometimes hangs, or the CTRIO output repeats indefinetly.

Any ideas?  Is the command complete bit set only for a short time; can it be missed if there is too many other things going on in the program?



  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 662
  • Hmmm...
    • Host Engineering, Inc.
Re: H0-CTRIO Velocity Mode, Command Complete bit
« Reply #1 on: December 16, 2008, 05:23:23 PM »
The problem with doing this in stage is that when you tell the CTRIO to do something it can take a few scans of the PLC to complete. Therefore if you set the Process Command bit, and then jump out of the Stage before that operation comes to completion (i.e. Command Complete bit comes ON), then this could cause problems depending on how you have programmed it.

If you are using DirectSOFT5, I would advise you to use the CTRIO IBoxes to accomplish this task; it is much easier. You would use:
  • IB-1000 (CTRIO - CTRIO Config) at the top of your program.
  • IB-1013 (CTRVELO - CTRIO Velocity Mode) in the stage. When this IBox is enabled, wait for the Success bit to come ON before disabling the Stage.

Of course, you could eliminate the problem by executing these outside the Stage.
There are two types of people in the world; those that can extrapolate from incomplete data sets.