Hello Guest it is April 26, 2024, 07:19:40 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 - Muemonic

Pages: 1
1
Mach4 General Discussion / Re: Calling an "Action" from a lua script
« on: January 30, 2016, 08:52:00 AM »
Thanks for the help.

I haven't played a lot with the profile functions yet, but it makes sense how you are getting the values from the profile to fill in the values for the jog inc.

The code is also easily extended to support skipping non-used increments. (IE. iterate past any 0's you find until you get to the non-zero result, rolling over as needed.)

Additionally, we would then change the text box displaying the current jog increment (txtJogInc in wx4 for example,) to not use the label code "Current Jog Increment", but instead set the label directly with the set properties command. (Or, alternatively, setup a register for that value, and set that box to use that register.)

This should solve the problem nicely, although in a slightly different way.

Thanks again.

Jim

2
Mach4 General Discussion / Re: PMDX expansion I/O survey
« on: January 29, 2016, 11:06:14 AM »
Greetings.

I'm very happy to hear about a pure IO board. Trying to create a pendant or more complex IO has been a challenge.

If you have 24 I/O, I would say that the 16 IN, 8 Out split is standard. However, as poppabear mentioned, a 16 In, 16 Output would also be welcome.

I'm approaching this from two angles, 1. A general I/O board that would drive machine outputs, coolant pumps, solenoids, etc. The second would be something that I could embed in a pendant that is using mostly switches and lit pushbuttons.

For the pendant, LED pushbuttons @24 volts are around 25-30 mA. Even the incandescent ones are usually < 100mA. For those types of loads, one of the direct sync/source options would work. For machine outputs, while I like the idea of using sink/source outputs and sizing cube relays/contactors for the output loads, it may be simpler to provide a relay output. Driving an inductive load requires protection that some people may not put in. I've seen blown output drivers from a non-protected inductive load dumping itself back into the driver. (But, I've also seen fused relay contacts from the same thing.)

I'm leaning towards a sink/source output board with inductive load protections on board. That would save the outputs from people hooking relays/contactors up directly without putting the freewheeling diode in. It would allow a small board for driving pushbuttons and other pendant type I/O. However, I do like the idea of an expansion board for the diversity. But rather then doing an opto22 style expansion, perhaps a stacked board with just the relays. The board stacks with standoffs and a simple header type connection to the board itself. (if you do a 16 in/16 out, then you could bank the outputs and support 8 relays on an expansion board, and stack 0, 1, or 2 to get the outputs you need. Sorry, I'm digressing.)

I'm also voting for the inputs to support 5-30 volt inputs directly. (I believe that is what you were mentioning, but I just wanted to confirm.)

I also wanted to say thanks for the products and all your work. Great stuff coming out of your shop.

And ya, the snow sucked. I'm up in MD, and we're still digging out.

Jim


3
Mach4 General Discussion / Calling an "Action" from a lua script
« on: January 28, 2016, 10:21:46 PM »
Greetings.

I have built an external pendant that removes a lot of the need for clicking on screen buttons. Using the lua scripts and the resources, almost everything is currently working, including multiple handwheels, start/stop/feedhold, M01, jogging, overrides, etc.

However, I do have an issue that I haven't been able to find the solution for. I've done a ton of searches, but haven't come up with the answer yet.

In the standard screens, the jogging page has a button the increments the jogging step through the steps defined in the configuration. This is triggered via the "Left Up Action" event on the button, and calls the internal action "Cycle Jog Increment". Within these actions, there are other useful actions, (sticking with the jog motif), "Jog Inc. 1" ... Etc. This allows you to directly set the increment to the one selected in the configuration file. (Or as another example, the enable button using the "Left Down Action" and "Left Up Action" to triggering the "Enable On/Enable Off".)

Looking over the documentation, there doesn't seem to be a mc function that allows you to trigger these actions from lua, and there is not an equivalent function to directly trigger these events.

On some older code, they mentioned deprecated ways of using the scr. functions to trigger button presses and such. Not only are they not the "correct" way now, but they have been mostly removed. Trying the existing GetProperty/SetProperty doesn't work, as they don't trigger actions or scripts, only allow you you to set the properties of the items on the screen. (The stuff on the first tab on the item properties in the editor.)

I may have missed them, but is there a way of triggering these "internal" actions from lua? And by extension, is there a way of trigging any of the other "events" that are registered on the second tab of a screen button/item. (Yes, you could directly call script actions from within lua. Actions seem to be the main missing piece, with perhaps "goto screen", but I haven't researched that one.)

I know there are other ways of doing this. As an example, I have code written that uses "mcJogSetInc()" to set the individual axis increments. (Which in some ways is more powerful, as you can have different increments for each axis.) However, there may be cases that you need to trigger the internal action from lua. And in this case, the direct call does not give the use a way of using the configured jog increments from the configuration file.

Is there a way of triggering this action, perhaps a "mcTriggerAction(inst, "Cycle Jog Increment")", or are there plans to directly map all the actions to mc lua calls (IE. "mcActionCycleJogIncrement())?

Thanks all.

Jim

Pages: 1