Hello Guest it is December 12, 2019, 12:45:11 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 - Raymondo

Pages: 1 2 3 4 5 6 7 8 »
1
Mach4 General Discussion / Re: Lua script problems
« on: August 16, 2019, 11:40:35 PM »
Thank you
the wx.wxMilliSleep() command did ever thing I wanted and I now have it running perfect again
I was using the wait function and it was nested inside another function M6.mcs  but I will alter that get rid of the wait function and use wx.wxMilliSleep() instead
Thanks again for the help you guys are the legends
Regards Ray

2
Mach4 General Discussion / Lua script problems
« on: August 16, 2019, 05:20:41 AM »
I am using a wirless transmitter to turn on and off the dust exreaction system I need it to turn on the output 50 for about half a second then turn it off  then the same again to stop the dust extraction so I need a pulse on output50
I use a delay function calles wait in MC6 tool changer and though I could call that from here but no if I include the wait function in this code I get the same error even if I call it some thing different it still has the same error
This is the error

C:\Mach4Hobby\ZeroBraneStudio\bin\lua53.exe: C:\Users\Raymondo\AppData\Local\Temp\leA8EB.mcs:14: attempt to call a nil value (global 'wait')
stack traceback:
   C:\Users\Raymondo\AppData\Local\Temp\leA8EB.mcs:14: in main chunk

Here is the script

-- Dust Collector button script
-- M110/M111 Output 50 signal 1100
inst = mc.mcGetInstance()

local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT50)
 
    mc.mcSignalSetState(hSig, 1)

 wait(1)
     mc.mcSignalSetState(hSig, 0)

And I added this  with or without it it is the same but this in in MC6 and works fine in MC6

function wait(seconds)
  local start = os.time()
  repeat until os.time() > start + seconds
end

 
any idea I just need about .3 to .5 seconds delay between turning  on output50 and turning it off
regards Ray

3
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 29, 2019, 05:16:04 AM »
Hi
I did notice some thing a bit different with this version when I set the timeout to zero I am not catching a error message
mc.mcSignalWait(inst,mc.ISIG_INPUT7 ,1,0)
mach4 stays open but if you click disable  or stop it immediately crash's and no error messaged is displayed
 It does the same in simulation mode on my home test computer
Regards Ray

4
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 29, 2019, 03:43:16 AM »
Thanks Craig
I noticed the message box had to be closed this is a great function  I was using this function to trouble shoot the program I could but a  wx.message in before and after  the calls  here and there to make sure where the program was up to at each stage and it stops the program and you can tell what piece of code was to be next
I allowed me time to for instance turn on the input just before the waitforinput call is made  and I could confirm that the input was in fact on before the call
regards Ray

5
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 29, 2019, 02:30:06 AM »
Hi
we have the tool changer working again  Whoo Hooo  but after a lot of testing and playing  around with ver 4261
But I believe there is still a bug

 mc.mcSignalWait(inst,mc.ISIG_INPUT7 ,1,60)
  I now use this and it works if a signal comes within the 60 seconds    but  the description for use says

Specifying 0 for timeoutSecs will wait indefinitely until the signal changes state. Decimals are allowed. e.g. .5 is half of a second.)

 Using  mc.mcSignalWait(inst,mc.ISIG_INPUT7 ,1,0)  this did work as described in the 3804 ver now it will cause Mach4 to crash even if there is a signal there before call or after the command it does not matter using the command this way it  will crash mach4 every time

just another question if I use this

if rc== -40 then
         wx.wxMessageBox('Function failed-timed out')
         return
end
just where does it return to ? does it just exit the m6 function ?

 I would like it to return to a function where I can close tool doors retract they tool etc and exit the tool change nicely
Regard Ray



6
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 27, 2019, 08:39:19 PM »
I had a bit of a think and I can turn that input on check it is on in diagnostic  then run the signalwait command  also the second last digit determines if it accepts a high or low signal I will try that both ways as well
It might show some light on the problem
Though it was all working fine till the update
It is sunday morning here so will not be at the factory till tomorrow

7
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 27, 2019, 08:17:20 PM »
With version 3804
  if I put say a 2 second delay in and  if the signal did not arrive in that time it would run  down the script    to the next command which in my case was to  raise the tools loading bar and  operate that output
  I did not have any error message etc installed in the script as I set it to zero so it would wait until the door opens
The program did not just disappear of the screen and need to be reloaded each time as is does now
the error -28 I will set the program to 10 seconds delay and take the lid of the control so I can see ESS I think it has a led for the inputs and can then confirm the input is on in diagnostic it certainly comes on
 
Specifying 0 for timeoutSecs will wait indefinitely until the signal changes state. Decimals are allowed. e.g. .5 is half of a second.)
 
This is the advice on the delay and from looking at it when I set it for 4 seconds it seems to take about that long

8
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 27, 2019, 08:02:07 PM »
Hi
I set it to 4 seconds not milliseconds and setting it to zero means it will wait for ever until a signal arrives
it now waits 4 seconds the mach4 program terminates and  the message box pops up with error -40 as the  command has waited its 4 seconds and  then drops out as it should but with  or with out a signal it should not terminate the mach4 program
I need it set to zero and this worked fine in 3804 version  I do not want tool changes happening unless the tool door is
open
I went into diagnostics and can operate the door and see the input signal come on and off
I am not sure where to go  there is probable another command I could use or I may start looking in ESS set up and see if some thing there effects a error -28
any thoughts and idea to test are more than welcome

9
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 27, 2019, 05:31:30 AM »
Hi it is this that it terminates the program
mc.mcSignalWait(inst,mc.ISIG_INPUT7 ,1,0)
But I also tried
mc.mcSignalWait(inst,mc.ISIG_INPUT7 ,1,4)

it then terminates  with a error -40 a time out error so I believe  there is some thing wrong with the way it gets the input  or actiually fails to get the input
I copied the machipc.dll from the version of mach4 where is works but it made no difference I have now put back the correct machipc.dll  they are 2 different date stamps and file sizes
Regards Ray

10
Mach4 General Discussion / Re: TOOL changer problems after update
« on: July 27, 2019, 12:29:45 AM »
HiHi
-28 MERROR_IPC_NOT_READY        The Interprocess Communication subsystem is not ready.


this is the error then the program terminates
 Where do I look it worked in the previous version with no problems
I have attached a cut down version off m6.msc that I use for testing it just opens the tool door and reads the input and now catches the error

Pages: 1 2 3 4 5 6 7 8 »