Hello Guest it is April 26, 2019, 12:33:00 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 - smurph

691
Mach4 General Discussion / Re: DRO Code differences
« on: April 27, 2014, 08:19:13 PM »
The net does not have our API calls.  The documentation is in progress but it is a LOT of slow tedious work.

Here is a quick look at the screen API call available to LUA inside the Mach4GUI:

(All functions return a result code as their first return value.  0 == success)

number scr.ShowPage(string pageName); -- Show a screen page by name.
number, string scr.GetProperty(string ctrlName, string propName); -- Get a control's property value.
number scr.SetProperty(string NctrlName, string propame, string value); -- Set a control's property value.
number scr.ExecMdi(string ctrlName); -- Execute the contents of a named MDI control.
number, number scr.GetCurrentPage(); -- Get the current page.
number, number scr.IsControl(string ctrlName); -- Is this a valid control?
number, number scr.IsProperty(string ctrlName, string propName); -- Is this a valid control and property combination?
number scr.ButtonClick(string ctrlName); -- Simulate a button click event.
number scr.ButtonUp(string ctrlName); -- Simulate a button up event.
number scr.ButtonDown(string ctrlName); -- Simulate a button down event.

A word of warning...  DO NOT use loops in the PLC script.  It is a script that is designed to be executed like a PLC; top down.  The frequency of the script can be set in the screen set properties.  There is a lot of power here.  But with power comes great responsibility because it has the ability to completely ruin your day if you are careless!  There is nothing preventing you from adding loops or setting the PLC script to run every 1 millisecond.  It will happily let you do these things with a smile.  So be careful!

Steve

692
Mach4 General Discussion / Re: DRO Code differences
« on: April 27, 2014, 03:35:40 PM »
number SetProperty(string ctrlName, string propName, string newValue)

The function is int the "scr" table.

scr.SetProperty('droXy', 'Value', tostring(XYval));

All parameters are strings.  So you have to convert the XYVal into a string with tostring().  Now, this does not control the format of the DRO.  That is done with the Format property that should already be set.

Any property of any control can be set this way.  The property names for the controls are what are used in the properties grid in the editor.  There is no documentation that lists the properties of each control yet.  Just look at them in the properties grid and use what you want.

As I said, look to the PLC script as an example of this function where we make the Enable button blink.

Hint:  Where there is SetProperty(), there is also a GetProperty() making it possible to read the properties of any control.

Steve

693
Mach4 General Discussion / Re: DRO Code differences
« on: April 27, 2014, 02:25:15 PM »
A lot of those images were from my computer which had a HD crash.  I just imported all of them and didn't look at each one.  So it is basically a corrupt image that was imported into the screen set.

I guess I don't understand your other issues.  You simply add images to the screen set via "Manage Images".  Then, you create a bitmap button and choose the image that you imported in the Image property drop down list.  LUA has nothing to do with it.  

The LUA comment was on how to update a DRO with a calculated value.  There is a screen objects API that is used.  I do not have it documented yet.  But you can see some of it in action just by looking at the scripts behind some of the buttons and the PLC script.  It is how we make the enable button blink, etc...

Steve

694
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: April 27, 2014, 01:50:50 PM »
Hi Brian,

Are you taking notes of the comments and reports, or are they getting consistently missed...? What's the purpose of this thread then anyway? Would be nice of you (or Steve) could confirm that a comment posted has been noted.

Dan

Sometimes I don't get the reply notifications from the forum.  I'm reading this thread today for the first time since I last posted to it, so I really haven't had time to ACK every post.  Just put the items/comments in here and we will see them.

As to your points about the Soft Limits click issue and the DRO entry, consider them duly noted.

Steve

695
Mach4 General Discussion / Re: DRO Code differences
« on: April 27, 2014, 01:26:44 PM »
All GUI objects can be accessed by their name in the LUA script environment.  This can be done as a result of an event (button press, etc...) or part of the PLC script.  The PLC script take the place of macro pumps and brains.

When in the screen editor, Screen->Manage Images.  This is where you add images to your screen set.  Then those images will appear in the Images drop down list.

Steve

696
Since you are using steppers (on a Galil?), check the box in the plugin that says "Use reference pos instead of actual pos".

Steve

697
Are you using the latest SmartTerm plugin from the website?  (galil-st).  Just adding a license should not cause anything to change other than remove the limitations of Mach.  It changes nothing as far as Galil plugin and the controller are concerned. 

Steve

698
Um no.  I think the drives will work as expected. 

Do you see the encoders creeping when in SmartTerm?  Try one motor at a time.

SHA

That command will enable the servo loop for the motor connected to the Galil A/X.  It should stop the motor drifting or the motor should oscillate, depending on the PID setting in the Galil.

MOA should disable the servo loop and allow drift.  If the motors drift without a command voltage from the Galil, then adjust the balance pot on that amp until th drift disappears.

Steve

Steve

699
Hmm...  could be.  I need to look at the Westamp manual again.

Steve

700
Mach4 General Discussion / Re: Comments about Mach4 in Demo
« on: April 25, 2014, 01:24:49 AM »
Are you running the install as Administrator?  Because you have to have admin privs to install to the root of the system drive.  This sometimes entails right clicking the installer program and selecting "Run as administrator" even though you may be logged in as Administrator.

Steve