Hello Guest it is May 17, 2024, 03:36:34 PM

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 - Brian Barker

131
Mach4 General Discussion / Re: Mach 4 configuration manual
« on: February 02, 2021, 03:49:59 PM »
Let me do this for you ... put the Mcodes in the macro's directory (need to be taken out of the zip file)

M41 in MDI will put you in range 0 M42 will do range 1

132
Mach4 General Discussion / Re: What changes PCID?
« on: February 02, 2021, 03:14:37 PM »
If you keep track of your log in for your license you can make a new one at any point! We made a tool for you to do that.  Man why is the world getting so full of people that like to be so bitter and pissed off. Chill and talk like we are sitting in a room.

What is the full story ? Because I make them give away licenses all the time. If we where out to be jerks I would not be out working with people.

If your the one that has used 13 licenses in one year. Seems like you have more than a little issue with your PCID. I don't know if you know this but we get scams ALL the time! To the point that I had the FBI show up here! 

133
Mach4 General Discussion / Re: Lua Script and reading register's Help
« on: February 02, 2021, 01:31:47 PM »
You want to have something that will run one time at startup ... We can do that many ways. A global screen var saying that you have doneInit = false and set it to true when you have done it. Then you will never run it again. Also you can do a scr.IsLoaded() to make sure that the screen set is fully up.

134
Mach4 General Discussion / Re: Scripting Custom Control Panel
« on: February 02, 2021, 01:25:25 PM »
Quote
Right - but is that name not editable in the screen editor? If I change the name of the function called on the On Up event in the screen editor to CycleStart(), will it not work?

You can't set the name of the function .... that is the button name and the function. It is how we find it in the C++ world...

Code: [Select]
function FNR_FeedHold()
  mc.mcCtlFeedHold(inst)
  mc.mcSignalSetState(FNRPauseLED, 1)
end
Quote
...and changing the name of the function called by the button onUp event to FNR_FeedHold() in the screen editor?
You can do that, no problem.

If you want to do it in script that is cool ... it is your machine you can do it anyway you like :)

Also we have other events (signals) ! Here is al list I got from the header file
Code: [Select]
OSIG_MISC_START  (OSIG_OUTPUT_FINISH + 1) 
#define OSIG_RUNNING_GCODE   (OSIG_MISC_START + 0)
#define OSIG_FEEDHOLD        (OSIG_MISC_START + 1)
#define OSIG_BLOCK_DELETE    (OSIG_MISC_START + 2)
#define OSIG_SINGLE_BLOCK    (OSIG_MISC_START + 3)
#define OSIG_REVERSE_RUN     (OSIG_MISC_START + 4)
#define OSIG_OPT_STOP        (OSIG_MISC_START + 5)
#define OSIG_MACHINE_ENABLED (OSIG_MISC_START + 6)
#define OSIG_TOOL_CHANGE     (OSIG_MISC_START + 7)
#define OSIG_DIST_TOGO       (OSIG_MISC_START + 8)
#define OSIG_MACHINE_CORD    (OSIG_MISC_START + 9)
#define OSIG_SOFTLIMITS_ON   (OSIG_MISC_START + 10)
#define OSIG_JOG_INC         (OSIG_MISC_START + 11)
#define OSIG_JOG_CONT        (OSIG_MISC_START + 12)
#define OSIG_JOG_ENABLED     (OSIG_MISC_START + 13)
#define OSIG_JOG_MPG         (OSIG_MISC_START + 14)
#define OSIG_HOMED_X         (OSIG_MISC_START + 15)
#define OSIG_HOMED_Y         (OSIG_MISC_START + 16)
#define OSIG_HOMED_Z         (OSIG_MISC_START + 17)
#define OSIG_HOMED_A         (OSIG_MISC_START + 18)
#define OSIG_HOMED_B         (OSIG_MISC_START + 19)
#define OSIG_HOMED_C         (OSIG_MISC_START + 20)
#define OSIG_DWELL           (OSIG_MISC_START + 21)
#define OSIG_TP_MOUSE_DN (OSIG_MISC_START + 22)
#define OSIG_LIMITOVER       (OSIG_MISC_START + 23)
#define OSIG_CHARGE          (OSIG_MISC_START + 24)
#define OSIG_CHARGE2         (OSIG_MISC_START + 25)
#define OSIG_CURRENTHILOW    (OSIG_MISC_START + 26)
#define OSIG_SPINDLEON       (OSIG_MISC_START + 27)
#define OSIG_SPINDLEFWD      (OSIG_MISC_START + 28)
#define OSIG_SPINDLEREV      (OSIG_MISC_START + 29)
#define OSIG_COOLANTON       (OSIG_MISC_START + 30)
#define OSIG_MISTON          (OSIG_MISC_START + 31)
#define OSIG_DIGTRIGGER      (OSIG_MISC_START + 32)
#define OSIG_ALARM           (OSIG_MISC_START + 33)
#define OSIG_PRTSF           (OSIG_MISC_START + 34)
#define OSIG_TLCHB           (OSIG_MISC_START + 35) // Tool Change B
#define OSIG_WATO            (OSIG_MISC_START + 36) // Path wating signal
#define OSIG_RETRACT         (OSIG_MISC_START + 37) // Retract Signal
#define OSIG_MISC_FINISH     (OSIG_RETRACT)

The guys are going through the screens for the release and I jammed my head in to see how they looked ... Much better! I have been telling them NOT to comment out the code and keep it in the screens! But you know how that goes... you can only push mud up a hill for so long before you want to go get your own work done. I am currently trying to get the mouse wheel with a low level hook to windows. I can't debug it because it kills my hook as soon as it see's that I stopped the mouse messages ... So I am writing debug tools to do that. Frankly chatting with you has been a nice distraction.

Hope all the output signals helps, you should be able to use that to fire your LED's 
Thanks
Brian

135
Hold please ;) I am going to see if Rob can find and post this here ...

136
Mach4 General Discussion / Re: Scripting Custom Control Panel
« on: February 02, 2021, 11:52:15 AM »
The button is not drawn by Lua. The button is done in C++ and you don't "need" to do any scripting to make a machine work. We have to know the name of the event to call in Lua from C++ for each button that has some Lua code. Not really any other way to do that. The Cycle start code COULD be in the button's On Up script and work but it would not be as easy to call from an input (SignalLib() ). That is why that was done.

The feedhold is doing the API call for feedhold because no matter what your doing feedhold is valid. We don't have an MDI  feedhold. The reason to wrap it the functions is if  you would like to add some code to be done around it.  Your LED's can be controlled in the PMC by looking at the state of the machine.

This was no thrown together in an afternoon :) we have reasons the system is designed the way it is. I am more than happy to talk about it.  When you really dig in and see all that is going on it is impressive. It took 10 years to make this all happen with a target we where focused on!

137
Are  you trying to touch off the offset at every toolchange? If so we have some files that will do that for  you that have been done and tested in the past.

Thanks
Brian

138
Mach4 General Discussion / Re: cant load program more then 50M
« on: February 02, 2021, 11:06:59 AM »
Sent

139
Mach4 General Discussion / Re: Scripting Custom Control Panel
« on: February 02, 2021, 11:03:28 AM »
the reason it is wrapped is because in the screen the "btnCycleStart" button uses it's left up event. We mash that all up and make a btnCycleStart_Left_Up_Script() call that we trigger from C++. Lua is a glue that you get use to customize the actions.

Was that any help?

140
Mach4 General Discussion / Re: Scripting Custom Control Panel
« on: February 02, 2021, 09:45:29 AM »
Making the LED's work will be simple...

Your comments on the screen are following your numbers:
1.) This was done so you can press the same button to trigger a cycle start OR you can trigger an MDI event from the same button. This was done to emulate how it is done on industrial machines (we automatically swap the state in the background in the state machine). If you want to change how it works  you can do that. That's sort of the point of all this, make it your way.
2.)Error checking... Yup agree and they should have checked many of the error returns. The guys that work on the screens are not programmers they are machinist. The reason for this is that my self and Steve simply don't have time to go play screen guys. We did have them audit the screens for error checking but looks like I may have to review it again. Mind you some of them are not needed...
3.)Commented out code.. Machinist ... They are are worried that if they take the code out that they will not be able to find it later for someone. The screens are all under source control so we will never loose anything! They should have put comments to what changed in the Repo but I don't read that stuff for fun.
4.)The NOOP's are because we are building a chunk in the background of all the buttons and calls that are in the screen. This is to give you one programming environment. if  you don't put stuff in the functions they just don't have anything.
No worry they are not called and will not slow the screen

I am in the middle of TRYING to get a  release out and I made them do some house keeping :)