Hello Guest it is April 25, 2024, 08:19:42 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

1071
Mach4 General Discussion / Re: Disable button unless Idle
« on: May 09, 2014, 12:20:17 AM »
HIYA guys these are things that should be fixed in the core.

(;-) TP

Just to clarify, the GUI has nothing to do with the core.  It is not like Mach 3.  There is a GUI (could be anything AND written with just about anything), the core, and plugins.  All three are separate.  In fact, we have two GUIs that can be used, Mach4GUI and wxMach.  And I have actually written C# and VB GUIs (for grins) that run the core.  The core is the interpreters, trajectory planners, and signals manager.

Steve

1072
Mach4 General Discussion / Re: Image Buttons and images on screen
« on: May 09, 2014, 12:11:14 AM »
I think Brian put up a post on how to configure the keyboard plugin. 

For the screen editor, you cannot align controls that are in separate containers.  A container is a page, group box, or notebook page.  A control on page 0 (Default) will always show up and it may appear that it occupies the same container.  But appearances are just that, appearances.  It is hard to catch things like that (read impossible) in the screen editor because we can't tell that you didn't mean to do that!!!  Because it is perfectly acceptable in some circumstances.  Look at the tree on the left to tell where a control is actually placed.  It will have a parent.  That is a good way to figure out if an accident happened.

Making a copy of the screen set before you edit it is a good idea. 

Steve

1073
Mach4 General Discussion / Re: Disable button unless Idle
« on: May 08, 2014, 11:43:28 PM »
Guys...  don't waste too much time on this button enabling and disabling.  I have just added a new property to all of the GUI objects.  "Enabled State"  You can choose which states the button (or other control) is enabled in with a click of a few check boxes!!!  It will be in the next update.

The Lua editor has a problem with Windows XP.  I have yet to fix that.  But it is on my list.  It is just that XP is not what I develop with so it doesn't get as much love.  XP's GUI event timings are different that the newer OSes.  It has been a real pain.  It would be much simpler for me if all of you guys running XP would just upgrade.  So how about it guys?  How about upgrading for a poor beat up programmer?  :)

Steve

1074
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 08, 2014, 11:25:00 PM »
An Illegal argument error means that the argument to the modbus function is out of range.  For example, each table can have 65535 registers but you put in 70001 by mistake.  That would give an illegal argument error.

Or,

Say your device docs give a register number for the Control and Status Register of 40010.  If you entered that for your modbus register in the config, you would get a illegal argument error.  Because 40010 really means table 4 (holding registers, register 10).  So entering 10 for the register is correct.

Also, if you enter a register number that your device does not have, then you will get that error. 

It is important to note that the modbus plugin uses the Modicon convention for registers.  Your device may give an address like "holding register 0".  That is NOT the Modicon convention.  So you must add one to the address to get the correct register, 1 in this case.

In the next update, I have added bit packing for register reads and writes.  I thought it was in the plugin that you guys had but it was not.  Somehow I botched the update and lost that functionality.  Anyway, the next update will include bit packing and also fixes the RS485 enable stickiness.

Hopefully I can get time to do some example docs for modbus in the near future.  But in the mean time, have a look at this modbus device simulator: http://www.plcsimulator.org/.  It is a really neat little program that emulates a TCP modbus device.  You simply run the program and then configure the modbus plugin to connect to 127.0.0.1, port 502.  You can then experiment with the different features of the modbus plugin and get the feel for how it works. 

Steve

1075
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 07:16:45 PM »
Yes.  There is that!


1076
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 07:08:45 PM »
Yep, that is why.  It is possible.  But you have to get crafty.  Both script environments have access to the Mach Registers.  So a register can be used to "communicate" between the two environments.  So in the M3 script, you set a register to something like "1" and in the PLC screen script, you watch that register.  If the register is "1" change the button label to one thing.  It is it "0", change the label to something else, etc...

Steve

1077
Mach4 General Discussion / Re: Lua Lua Lua Louieeeeeee
« on: May 07, 2014, 06:53:20 PM »
wxLua. 

The hard part to get under one's hat is that there are two wxLua environments.  One in the GUI and one in the mcLua plugin.  The mcLua plugin is the one that runs all of the macros.  Putting the macro scripting in a plugin makes it possible for other script languages to be added later.  But I HIGHLY doubt that the GUI will ever run anything other than LUA.  So anyway, be aware that there are two separate scripting environments.  Both have access to the mc.* API.  But only the GUI has access to the scr.*  screen API.

1078
Mach4 General Discussion / Re: MACH4 - Modbus
« on: May 07, 2014, 01:00:22 AM »
The M4 modbus uses the newer Modicon table/register convention.  Not the hex addressing that Mach3 used.  There tables in the modbus spec that pertain to functions that operate on them.  Modbus devices usually give the addresses in either hex addresses or the table/register format.  And sometimes they will give both.  Also, sometimes they prefix the addresses a bit differently. 

Some do the T:RRRRR format where T is the modbus table and RRRRR is the base 1 register.
Others do a TRRRR format where an address may look like 40001.  This is really table 4, register 1.  

IMPORTANT:  Addresses are base 0 and registers are base 1.  The M4 modbus uses registers.  

If the device documentation gives the old hex addressing format, convert the hex number to decimal and then add 1 (base 1 remember!).  If the address is given in decimal, simply add 1.

Attached is a document that you may find useful.

Also, here is a good page that explains a lot. http://www.csimn.com/CSI_pages/Modbus101.html

Steve

1079
Mach4 General Discussion / Re: Mach 4 Bug Reports
« on: May 06, 2014, 07:37:16 PM »
No, it is not protected.  But you sure did sniff out the way to find a lot of thing quickly!  That is the Lua script display that lists all of the scripts that are in the set.

So...  open up Mach 4, and then Operator->Edit Screen

Then click on the Goto Zero button.  You will see it's properties displayed on the left side of the screen.  Over the properties you will see a button with a lightening bolt.  Click on that.  This will change from properties to "events" and choose the "Left Down" script.  click on the ... button and it will open the Lua editor.  

Steve

1080
Mach4 General Discussion / Re: Mach 4 Feature Request
« on: May 06, 2014, 07:10:44 PM »
os.execute('start "Docs" "Notepad.exe C:\\Mach4Hobby\\Docs\\M4Manual.txt" ')

Try that.  You may need to provide the fill path to Notepad.  But that should not block the script.

Steve