Hello Guest it is April 19, 2024, 07:01:06 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - jderou

Pages: « 1 2 3 4 5 6 »
11
Ok, so that is working.  What is the safest way to exit a macro on error?  For instance, if the signalwait times out then I don't want to continue the macro, but I need to turn a couple outputs off.  So I have:

if (rc==mc.MERROR_TIMED_OUT) then

  hsig, rc=mc.mcSignalGetHandle(inst, loosendraw)
  mc.mcSignalSetState(hsig, 0)
  mc.mcCntlSetLastError(inst, "TIMED OUT")
end

This works, but does it stop the macro at this point? Does it exit the macro?  I definitely would not want the next line of code to be run.

12
That was it! Thanks!

13
So I updated to build 3481 (easier than I feared) but the problem is the same.  First time I run T4 M6 it doesnt detect the T4 and says nothing to do.  Second cycle start it takes it. 
If I run T4 M6 once, then run T3 M6, it changes to tool 4.  It is like it is always a step behind.
I did find a workaround.  If I break it up like
T4
G4 P10
M6
It works as it should.
Would appreciate some insight.

14
Update.  I was using M16 as the macro as I want to be able to designate which tools can auto change.  I think that is somehow part of the problem.  I changed to M6, but I still have to run the code twice for it to pick it up.

15
the .mctoolgetselected doesn't seem to be updating with the correct tool number when attempting a toolchange (i.e. T4M06 just says currenttool = previous).  It seems I have been working around this by turning on M01 stop at toolchanges, but now I have a toolchanger mostly functional.  It seems to always stay at tool 1.  Maybe this is a bug that has been fixed?  I haven't updated in around a year.

16
Great!  Thank you!

17
Mach4 General Discussion / How to make Lua wait for signal state to change
« on: December 02, 2017, 06:44:55 PM »
I am working on an automatic toolchange and I need the Lua code within the macro to wait for the spindle orient signal from the PLC to change from 0 to 1.  I would have used a while wend in mach3, what is the best way to do this with Lua?
My input signal is Input 18.
I found the below example on the web but I am not quite sure how to use it in mach4.  I don't understand what the a in a is.

local i = 1
    while a do
      if a == v then break end
      i = i + 1
end

18
Mach4 General Discussion / Re: Mach4 Random Crash
« on: January 09, 2017, 07:04:44 PM »
I am calling this fixed.  Machine has been performing flawlessly.  I went ahead and moved the PC components to my operator console rather than the main cabinet as well as separating the power.  This also cured my touch screen issue that I had thought was due to faulty hardware.  Thanks for the help!

19
Mach4 General Discussion / Re: Mach4 Random Crash
« on: December 28, 2016, 08:23:54 PM »
Did some rewiring for a test.  Separated the servo power from everything else, power from different breaker.  Immediate difference is that the monitor used to go a bit fuzzy when the servos were powered, now it is clear.  Will do more testing and update.

20
Mach4 General Discussion / Re: Mach4 Random Crash
« on: December 28, 2016, 06:06:34 PM »
Just some random thoughts.
Sometimes when I hit the estop (to remove servo power), the monitor goes dark then returns in a few seconds.  I have not figured out how this is possible since there is no direct connection.  No reason the monitor would lose power.  Could interference cause this?  My pc motherboard is in the same cabinet as the servo drives with no shielding.
Or maybe removing power from the servo drives is causing power surge/drop to the pc?  Could this cause windows to crash in this manner?

Pages: « 1 2 3 4 5 6 »