Hello Guest it is June 07, 2024, 03:05:11 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 - striplar

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 »
131
Many thanks Smurph, that's just the sort of thing I've been hoping to find.

I don't have a panel on the machine, it's a metal working Mill that I've converted to CNC, a smaller version of a Bridgeport. I was using a pendant, but that doesn't work any more with Mach4

132
Many thanks Allan for taking the time to do this. I'll digest it shortly. At the moment the machine is working flat out, trying to recover some of the time lost in the conversion from Mach3.

Looking at your screen, I see striking similarities in the jog buttons you've implemented. I never did see the logic in having a button that cycles between the increments stored in a table. What I need is to hit one button and know it's a continuous jog, or another and know it's a single increment of the size I choose. In my case, I've achieved that effect using actions for Mouse Down and Mouse Up, but I'll see  how you've done it since I couldn't make a script written as part of the button work.


By the way, you wouldn't happen to know how to make the spindle stop automatically at the end of a program without an explicit M5? Mach3 stops at the end, I think you can select that option in the config, but I can't see anything similar in Mach4

134
Hi Steve,
Ok, I'll look into using that method. Since there's no 'Radio button' group in Mach4, there's no obvious way to turn off an LED that is now inactive unless you force it off directly. In the situation I have, the radio buttons set different values for the jog step increments so you can't just link them to a source.

I hear what you're saying about using the underlying data, but that's hard to find. Again, in the example I have, I want to use a script to mimic several functions such as the one that selects a particular preset jog increment for the jog. That's easy to do when it's selectable from a drop down list, but I can't see a way to accomplish that from a script. Maybe it's in the documentation about how to do this, but I can't find it. I also can't find out where the increment ends up after its been selected, so I can't link a text box to the current jog value.

So in general, to a newbie, there are many obstacles to doing what at first glance ought to be trivial, but it appears to be more difficult. I see there's a partial listing of some of the internal variables, but I really think there should be a complete one for cases such as this.

I know writing documentation sucks, but it would save a lot of heartache for those of us who don't have access to the source to just look this stuff up.

135
Hi Steve,
Now that's the document I could have used days ago! It's not in the Docs folder or anywhere else in the Mach4 download, but I've found it on the internet and now have it in there.

I see your point about scripts being largely dedicated to specific buttons. There's one case where I want to have radio button LED indicators against four buttons. You could argue that it would be neater to have a 'clear all radiobutton LEDs' function that each button could call to clear the others before setting its own LED.

While I'm on that subject, how can you write to the properties of one screen component from the script of another? Say turn on an LED or change the colour of one button from the script of another. You might want to do that if you were creating radio buttons where the background colour of the button indicates which one is selected. This sort of thing is dead easy in something like Delphi or Visual Basic, so I imagine this environment is similar.

136
Thanks for your patience in explaining what might be obvious to a lot of users.

Just a couple of things...

For example, there's a Cycle Start function in the ScreenScript.lua that's used to select the action taken depending on what tab is active. That's clearly something added as part of the design of that specific screen. It's a named function that I can apply to any button, but how can that be edited? I can see it in the ScreenScript.lua which I appear to be able to edit and modify if I do to Operations->Open Script Editor

So it looks like you can edit ScreenScript.lua and that's where these things are defined. Am I getting the wrong end of the stick? I can't see function CycleStart() defined anywhere else.

137
Ah, so it's an amalgam of whatever screen scripts are present in all of the profiles then?

I'll have to look at how to create scripts that have function names then, because at the moment I'm just adding scripts where you access them directly from the button.

138
Ah, I see that now. I'm going to have to take a long hard look at that example you gave.

Fortunately I've managed to cheat somewhat by calling "Jog Mode Step" action when the button is down which sets the jog mode to incremental and then another one "Jog Inc.4" that explicitly sets the increment value.

Maybe it's possible to call those from a script instead, but I don't know how to do that.

I can see the various functions that have been defined in the screen script, but I can't see how you are supposed to add your own ones. The Zero Brane editor seems to be what's used, but ScreenScript.lua appears to be common to all profiles. Somehow I thought there would be one for each profile?

So presumably to create your own new functions, you have to edit the common ScreenScript.lua file and then your function appears in the list of Actions in the properties?
 

139
Hi Allan,
Where did you find the information on the following function that you used?

      type = mc.mcProfileGetInt(inst,'Preferences', 'JogType', mc.MC_JOG_TYPE_INC)

I can see the details of the call in the help, but where is the list of the 'Preferences' and 'JogType'?

I get the impression that there's another large technical document that I'm missing that shows the system variables, where they're stored and what they do.

140
Thanks to you both, that's all very useful. I'll have to digest the code, I'm still taking baby steps in this.

The switch back to Imperial units might not happen when I'm not messing about with the setups, so that call to force it to metric might not be necessary

However, I still don't understand why the following call has no effect...

 mc.mcJogSetType(inst, mc.X_AXIS, mc.MC_JOG_TYPE_INC)

I've checked return code which is 0. Can anyone tell me if this function actually works, or if I'm wasting my time?

The same 0 return code comes from the other functions I called in the example, but I don't know what that means.

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 »