Hello Guest it is April 19, 2024, 11:41:23 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 - simpson36

181
Mach4 General Discussion / Re: MACH4 - Modbus
« on: March 01, 2015, 05:33:28 PM »

I'm just waiting for a paintbrush and I'll take it from there. The 'paintbrush' in this case is images on the toggle buttons.

I have seen from other posts that there is a way to add large images, so the ugly background is probably pretty easy to replace. Nothing we can do about the ugly buttons until you (or whoever) implements the image Tbuttons. Yes, the non-'T' buttons can have images, but the 'T's are just too convenient to use

Personally, what I would like to see is a screen with only a single big button in the middle of the screen labeled 'Make Part' . . . . .  ;)

Not sure who to credit this to . . Mark Twain maybe . . .  who was admonished by a female patron in a bar for being overly inebriated. He replied 'Yes Madam, I am quite drunk, however, tomorrow I shall be sober and you will still be ugly' . . . .

182
I always work off of the MachAPI.h... It's formatted for C# but always up to date.

Andrew

That header file is not with the MACH4 distribution. Is it available to users/developers?

183
Thanks!

This call is not listed in LuaCalls.txt that was distributed with MACH4

Is there another more current list available?

184
Searched and cannot find how to query the current units being used in MACH4.

Cannot find a LuaCall for this. How is it done?

185
Mach4 General Discussion / Lua 5.3? Yes, No, When?
« on: March 01, 2015, 07:34:05 AM »

Is the version of Lua in MACH4 user upgradable? If not, then is there a schedule or ETA for implementing new versions of Lua?

186
Mach4 General Discussion / Needing help with Wizards
« on: March 01, 2015, 06:42:57 AM »
I need a program (presumably a Lua script) that will collect data from a user, 'disassemble' the floats for xfer over Modbus and send the data to a devise over Modbus TCP. This process is already working on the MACH3 TCP Modbus version of the controller and it is a matter of duplicating the functionality in MACH4 . . and hopefully also streamlining the process as well.

The 'nuts and bolts' of breaking up the floats and sending them to the controller is no problem. What I am seeking is some advice and direction as to the best method in MACH4/Lua to make a single input screen to collect a series of integer and Floating point numbers from a user.

Attached is an image of my 'configurator' (a windows program written in C#). I would like to do something similar inside MACH4. This program is now replaced in the TCP Modbus version of the controller and parameters are collected one at a time in a series of clumsy VM scripts. I'm not looking for someone to write the script for me of for 'Lua 101 over the Internet'. What I want it just to be pointed in the right direction so that my efforts are not wasted going down the wrong road. 

So to get off on the right track,  my specific questions are:

1) What is the best method to use to create a single input screen for a mixture of integers and floats (no text).
     * If possible, it would be nice to be able to edit any and all of the fields prior so doing a single 'save'.
2) Presumably, this screen would need an array to store the values in.
     * What would be the best storage mechanism for this? Registers? Variables? Which ones?
     * IF it was desirable to have MACH4 retain these parameters, how best to do that?
          I know that MACH stores some data in the .ini file, but I don't know which would be best to use or why.


187
Mach4 General Discussion / Needing help with Wizards
« on: March 01, 2015, 06:19:54 AM »
Hello 'Screen Set Ideas' thread!

I am porting a 4th axis motor controller over to MACH4 from MACH3 and the last task in this is to write a Lua script to collect operational parameters from the user and pass them (over TCP Modbus) to the controller where they are stored (originally in EEPROM, now on an SD card).

But first, let me take just a minute here for some well deserved kudos. When I last visited MACH4 last summer (on release of the demo), it was a big deal to get Modbus going and add a button here and there on the screen. I have only had a few minutes to peruse this thread, but the level of work being done is just astonishing to see. I have noted a couple of 'non programmers' who are now doing high level programming and displaying truly impressive accomplishments here.     ;D

OK, so enough of that. I've mucked up this post now, so I will start another with some details of my task and some questions to get me started in the right direction.

188
Mach4 General Discussion / Re: MACH4 - Modbus
« on: March 01, 2015, 06:02:13 AM »
Quick update;

Sliders are working fine. Better than fine, actually. I have two sliders, one for RPM input and one for SFM input. Each has a corresponding DRO that is both a readout and numeric input. The sliders are only active when the mode that they effect is selected.

E-stop is tied to the motor controller and it notifies the controller and turns off the spindle and disables the ON/OFF button while in E-stop. and leaves the spindle switched OFF at reset (so the spindle does not suddenly start up again on  reset). All relatively simple tasks to accomplish in MACH4. These same tasks required a lot of 'smoke and mirrors' as well as a MacroChargePump in MACH3. Switching off the  spindle and leaving it off on reset was a fairly good sized PIA in MACH3. In MACH4 it took literally a few minutes and no workarounds and it functions reliably and instantly.

The last task in porting over the controller is a program to collect and feed user parameters to the controller for storage (previously in EEPROM, now on an SD card). This program will use Modbus to send the collected data to the controller, but since I hope to make a nice looking single input screen for al of the parameters (like the original Windows 'InTurn™ Configurator' program), I will take that task over to the 'Scree Ideas' thread where this stuff seems to be happening, and then come back here for the Modbus functionality.

Impression: MACH4 is worlds apart from MACH3 as a development base. Literally in a few hours I have been able to accomplish in MACH4 (starting with zero experience and not knowing Lua) what took days and much frustration to accomplish in MACH3.  ;D

Specific to Modbus, I have noted even after everything is configured and working, MACH3 sometimes starts up with TCP Modbus unconnected and a restart is needed to get it going. MACH4 is somewhat unstable while writing scripts, but so far it has never started up with Modbus dead and needed a restart.

Apart from the ugly screen, MACH4 is 'looking' very good to me at this point!

189
Mach4 General Discussion / Re: MACH4 - Modbus
« on: February 27, 2015, 05:31:25 PM »
Use the screen PLC script to push the axis values to modbus.  There is an interval to control the PLC script timing.  If you want a function of that, just make the modbus update every other PLC script run or something along those lines.  

THANKS! That was the nudge I needed. I had to do some homework around the forum to figure out what PLC Script is, but all working well now.

Tremendously faster than MACH3! :o

The Axis data is used to calculate RPM based on SFM and OD during turning operations. This method is activated only in 'AutoSpeed' mode. To keep the CPU load minimal, I only turn on the streaming when in AutoSpeed Mode and then only for the axis that is being tracked.  The CPU in the new MACH4 TCP version of my Motor Controller is about 5x (real world) faster than the previous version, so together with the uber fast MACH4 Modbus, I should get very close follow, instant response time (effectively)  and very smooth ramping.

You can connect a slider to a modbus register by also using the PLC script.  The plc script should get the value of the slider via the scr.GetValue('control name', 'property name') function (I may not have that syntactically correct).  Then push that value to the modbus register.

Have not tackled this yet, but not a high priority. Should be no problem, now that I have the basic process figured out. Something I like about MACH4 (and Lua) is that once you get a certain process figured out, it works pretty much across the board. Each little thing you want to do is not 'slightly different' or need a particular work around.

At least that's my impression at the moment.  8)

With wxWidgets 3.0+, toggle buttons can have images.  We started with 2.8, so toggles never got images.  So I will add that when I get a chance to get back into the GUI code.

Steve

Perfect!  It won't work any better, but it will look GOOD. and as Fernando says 'Is better to look good than to work good, and image toggle buttons will look MARVELOUS!"

190
Mach4 General Discussion / Re: MACH4 - Modbus
« on: February 26, 2015, 03:59:19 PM »
So far I have only spent a couple of hours on the controller port and it is about 90% functional on MACH4. It turned out to be just ridiculously easy. Having the entire controller already moved to TCP Modbus and all serial connections (like the Configurator program) already removed, it was just a matter of setting up Modbus and making a bunch of screen buttons.

Except for . . . .  I'm struggling with making the Y and Z axis data continuously stream to respective Modbus registers.

Should there just be a function created and stuck in the 'screen script' and is there a special function name that means 'run this function continuously' in the manner of the MACH3 macro pump?. Should there be a timing loop to throttle how much processing time such a script consumes?

Secondly, I have found no way to connect a slider to a Modbus register. Not an emergency, but is his doable?

Lastly another wish list item; is there, or will there be an 'image toggle' button. The toggles are uber convenient and a dream compared to MACH3, but they are also pretty ugly.

The first issue is the most pressing; streaming axis coord to a Modbus register. Actually two registers, one for the integer portion and another for the fractional portion, but I can take care of that if I can figure out how/where to put code to stream the data.

Thanks!