Hello Guest it is April 22, 2019, 02:39:46 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

601
Mach4 General Discussion / Re: Disable button unless Idle
« on: May 09, 2014, 12:34:53 AM »
Is 7-32 compatible ? Or is 64 bit req./preferred ?

Thanks,
Russ

Both work well.  I use Win7-32 on my Matsuura.  Works fine.  If you want to EVER run the parallel port, you have to choose Win7-32.  Otherwise, I would go Win7-64.  It seems to be bit more stable.  Win7-32 isn't bad, just that Win7-64 NEVER seems to have an issue.  That's just my experience.

The upgrade thing was just a joke.  While I would really just love to be done with XP and never have to see it again, I do understand that people want to get the most out of their investment.  We are trying REALLY hard to support XP.  It was a good OS.  It is just that it is getting a bit long in the tooth as far as programming for it goes. 

But don't go upgrading if your compy only has 2 Gig of mem or less.  Win7 does require more system resources (memory for sure!).  If you put it on a 2 Gig system, you will end up buying memory sticks too.  The price of the memory plus the price of the Win7 OS may get very close to a new system's price!!  Do your homework.

Steve

602
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

603
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

604
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

605
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

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


607
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

608
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.

609
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

610
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