News:

  • June 07, 2026, 04:14:06 AM

Login with username, password and session length

Author Topic: H2-CTRIO2 Can't load file  (Read 23360 times)

MVetrano

  • Full Member
  • ***
  • Posts: 27
H2-CTRIO2 Can't load file
« on: January 20, 2016, 09:23:02 AM »
I am writing a program for a 3 axis machine in the Stage format. CTRIO #0 controls the X and Z axis and CTRIO #1 the Y. On power up, Stage 1 is active and looks for input from the HMI. I am able to Home all 3 axis and Jog the X axis left or right. When I try to Jog the Y or Z axis the Jog file will not load and the success and error bits do not change. I tried putting the code to load the Y or Z Jog file in a different stage from the X but got the same results.
I have tried the same code in RLL and it works. I don't have very much experience programming and RLL+ seems to be easier for me so I would rather not switch to RLL if I can avoid it. I have attached a copy of my code, any help will be appreciated.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: H2-CTRIO2 Can't load file
« Reply #1 on: January 20, 2016, 10:07:32 AM »
The first thing I noticed is in Stage S1, Rung 7, you are jumping out of S1 to S2 upon the completion of the first CTRLDPR instruction, but you have triggered 3 with the rising edge of C70. This will leave the 2nd and 3rd CTRLDPRs in a suspended state (not being scanned). The 2nd CTRLDPR probably grabs the token and starts its process, then you jump to S2. Thus, any other things attempted with that CTRIO will not work because that CTRLDPR has the token and yet it is no longer being scanned. So first advice is make sure all CTRLDPRs are finished (C50 and C30 and C40) before you branch out of S1.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

MVetrano

  • Full Member
  • ***
  • Posts: 27
Re: H2-CTRIO2 Can't load file
« Reply #2 on: January 20, 2016, 10:48:53 AM »
Thanks I'll try that.

MVetrano

  • Full Member
  • ***
  • Posts: 27
Re: H2-CTRIO2 Can't load file
« Reply #3 on: January 20, 2016, 11:07:17 AM »
I added C30,31,40 and 41 to rung 7 befor the jump to stage 2 and didn't fix the problem.
Rung 6 loads the homing file for all axis, rung 7 jumps to stage 2 and homes Y axis, jumps to stage 3 and homes X and Z, then jumps back to stage 1. This process works fine. Rung 8 loads the Jog X file. This also works fine (I can jog X left and right in stage 4, then jump back to stage 1. Rung 9 and 10 should load Jog Z and Jog Y file into CTRIO 0 and CTRIO 1 respectively. This is where my problem is. Nothing happens. Any other suggestions?

MVetrano

  • Full Member
  • ***
  • Posts: 27
Re: H2-CTRIO2 Can't load file
« Reply #4 on: January 20, 2016, 01:26:26 PM »
I think I found the problem. In Stage 1, if the jog fie is loaded successfully with no errors then jump to stage 4 and run the jogging code. At the end of stage 4, I reset the file loaded success bit and return to Stage 1. If I delete that reset instruction, it runs fine. I had to add some code to rung 11 in Stage 1 to keep from jumping back to Stage 4 again.

Is there a way to turn off the file loaded success bit that isn't permanent?