Hello Guest it is April 26, 2024, 04:59:03 AM

Author Topic: need a little bit of help  (Read 13439 times)

0 Members and 1 Guest are viewing this topic.

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: need a little bit of help
« Reply #40 on: June 11, 2015, 06:16:47 AM »
no it`s whats on page 2 it does not matter as it work`s and it wont crash or anything silly like that it`s just something that happens with the forloop
Re: need a little bit of help
« Reply #41 on: June 11, 2015, 06:40:52 AM »
type the 'for' loop out exactly as you typed it...where is it located? ie. button, plc, start up?
« Last Edit: June 11, 2015, 06:53:50 AM by Screwie Louie »

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: need a little bit of help
« Reply #42 on: June 11, 2015, 05:32:04 PM »
look at page 2 of this thread
Re: need a little bit of help
« Reply #43 on: June 12, 2015, 04:51:22 PM »
Don't see a for loop. I see a while loop in your original code then Smurph gave you an expamle to do the moves with an 'if' conditional statement based on mach's operating state before making the second move. All done in the PLC. If/then statements work. I'd avoid while/repeat loops like the plague inside the plc or button script because of the constant refresh. try the mc.CntrlMdiExecute function. My DROs always update with movement and the screen doesn't freeze. Now, mc.CntlGcodeExecuteWait on the other hand is different. That functions locks everything out (except motion controller/core request/reporting) and gives sole ownership of Mach 4 to that Gcode block until it is complete and nothing updates until done. I know you have mc.CntlGcodeExecute written. I sware my DROs move with that function too...I'll have to check.

--josh

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: need a little bit of help
« Reply #44 on: June 12, 2015, 06:50:46 PM »
if you look back smurph wrote whats good and bad to have as a Gcode string your right its a while loop