Hello Guest it is April 25, 2024, 10:16:15 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 - Cbyrdtopper

811
Mach4 General Discussion / Re: Cycle Timer Not Working
« on: January 13, 2017, 08:12:16 AM »
You're right DazTheGas, I don't know why I didn't post it yesterday. 
I was trying to get an Output to act like an Enable.  It worked, but it messed up my cylcle time for some reason.
Here is the code that messed up my timer, it was in the signal library.

--Enable Signals
--MOVED THIS TO PLC SCRIPT CB 1-12-17
--It messed up the part timer.  Timer works fine when this is in PLC Script.
--[mc.OSIG_MACHINE_ENABLED] = function (state)
--     if (state == 1) then
--         local inst = mc.mcGetInstance()
--         local RedLight = mc.mcSignalGetHandle (inst,mc.OSIG_OUTPUT11)
--         mc.mcSignalSetState(RedLight,0)
--     else
--         local inst = mc.mcGetInstance()
--         local RedLight = mc.mcSignalGetHandle (inst,mc.OSIG_OUTPUT11)
--         mc.mcSignalSetState(RedLight,1)       
--     end
--end,

Here is the code to do the same thing, I put it in the PLC Script and now the "Enabled Output" works great and so does my Cycle Timer.

--Enable the Output
local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_MACHINE_ENABLED);
local sigState = mc.mcSignalGetState(sigh);
     if (sigState == 1) then
         local inst = mc.mcGetInstance()
         local RedLight = mc.mcSignalGetHandle (inst,mc.OSIG_OUTPUT3)
         mc.mcSignalSetState(RedLight,0)
     else
         local inst = mc.mcGetInstance()
         local RedLight = mc.mcSignalGetHandle (inst,mc.OSIG_OUTPUT3)
         mc.mcSignalSetState(RedLight,1)       
     end

812
Mach4 General Discussion / Re: Cycle Timer Not Working
« on: January 12, 2017, 01:01:57 PM »
Figured out a fix to the timer issue I am having.  I had some code tin the Signal Library that the Timer Script in the PLC Script didn't like.

I was forcing an Output to be an Enable in the signal library and somehow that messed up the timer script. 

I moved the Output Force to Enable script to the PLC Script and now both features are working like I want. 

813
Mach4 General Discussion / Re: Startup Error
« on: January 10, 2017, 04:50:55 PM »
Found my problem.  I had a bad custom macro in my profile.

814
Mach4 General Discussion / Cycle Timer Not Working
« on: January 10, 2017, 12:29:16 PM »
My cycle time timer is not working.  The only code I can find related to the cycle timer is in the PLC Script, and it looks to be an initialize code.  Where is the script to start the timer?  I'll check the code and see if I am in conflict with the code I've put into the Screen Load Script. 

815
Mach4 General Discussion / Startup Error
« on: January 10, 2017, 12:10:20 PM »
I haven't had any problems until this morning with loading Mach4.  The following error popped up this morning.

0Lua: Error while running chunk
wxLua:
Expected a 'boolean' for parameter 2, but got a 'string'.
Function called: 'mcIoSetState(number, string, number)'
01. mcIoSetState(number, boolean)
stack traceback:
[C]: in function 'mcIoSetState'
 ?: in main chunk
 ?: in main chunk

The machine is still running fine, I just don't know why we are getting this error all of a sudden.  

Any Ideas?

816
Mach4 General Discussion / Re: Q word missing error when running G83?
« on: January 09, 2017, 05:05:56 PM »
G83 is a deep hole pecking drill canned cycle, "Q" is the peck depth.  If you're using a pecking cycle you need to have the "Q" in there since that is what the program looks for as the "Peck Depth".  If you do not need to peck then just use "G81". 

817
Mach4 General Discussion / Re: Keyboard Inputs Enabled or Disabled Handle
« on: January 04, 2017, 05:18:39 PM »
As of right now, I've got a physical button with the same code as the Keyboard Enable button in the jogging tab, and I've moved that Keyboard button to the file ops tab so the operator won't have to change tabs to see the change in color of the button.

818
Mach4 General Discussion / Re: Keyboard Inputs Enabled or Disabled Handle
« on: January 04, 2017, 05:16:50 PM »
I tried the code DazTheGas, I was getting the state of the Keyboard.  

Steve, That will be great when you get the register to control the keyboard plugin.  I am wanting to add a physical Button on the control panel that Lights up when the Keyboard Plugin is enabled and turns off when it's disabled, the button will toggle the keyboard plugin on and off.  This will make it easier for the operator to use, that way they don't have to keep going to the jogging tab to toggle the Keyboard Plugin.
Looking forward to it!!

Thanks for the time and insight guys!!

819
Mach4 General Discussion / Re: Keyboard Inputs Enabled or Disabled Handle
« on: January 04, 2017, 03:39:43 PM »
Thanks for the reply Steve.  It would be nice to have a status register to make things easier. 

DazTheGas,
If you don't mind, could you send me the code you used to test that to be sure I'm not making a mistake on my end?
Thanks!

820
Mach4 General Discussion / Re: Keyboard Inputs Enabled or Disabled Handle
« on: January 04, 2017, 09:45:19 AM »
In the video from DazTheGas that I posted the buttons he was working with had code in them, now they have drop downs to determine the function. 

I tried to use the code form the video but it isn't working.  So I'm still stuck.   

Any ideas?