Hello Guest it is April 25, 2024, 12:54:10 AM

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 - Cbyrdtopper

791
HiCON Motion Controller / Disable Dereferences my axis
« on: March 03, 2017, 09:57:53 AM »
When I use the reference all home button, It will home X,Y,Z, and A great but then it disables Mach4 and then my axis are dereferenced.  How can I make make the Disable not dereference the axis? 

792
Sorry, I've been busy at work.  Not been able to take screenshots of the machine. 

793
Cartierusm,
There is already an M6 Macro started in your Mach4 Profile.  Once Mach4 is opened, go to "Operator" then "Edit/Debug scripts"  it should open up to the Profile Macros.  In here will be the M6 that has already been provided.  I would suggest copying the original to keep a solid reference point.
 
Functions, write single register and read register.  I use these Registers to tell the PLC what tool to change to, I'm using a side mount tool changer that has an arm to remove the tool from the spindle and put the requested tool in the spindle all in one move.   I can give the Click and actual integer from mach4 to do this.  Registers in Mach4 can be very useful.  They were a bit tricky at first to understand how to get the information from a register and how to write to the register (change it in Mach4)
The Mach4 forum has several examples of how to use them.  
But in the Click PLC, you have different types of data bits.  You are using "C" bits these are on or off, 1 or 0.  There also data bits that can hold real values, integers.  These are labeled DS in the Click PLC.  In Mach4 you can have Modbus Registers that can be read by the Click and visa versa, Click registers that can be read by Mach.  
In your case, You could setup a Write Single Register Modbus Function to tell the Click which tool to change to.  In the ladder, you would use the "Compare" Function.  
          DS1 = 1 -----> Set C1
          DS1 = 2 -----> Set C2
          ETC.  
You would use just one DS#.

I truly am no expert at PLCs or Mach4.  I just played around until I figured out what was working well.  This is my first go at a PLC.  There are several ways to do this.  This just worked well for us.  

In the morning I will try and remember to take some screenshots of where the registers are in Mach4.  

Last thing for the night; to setup a Modbus connection.  Go to Configure.  Plugins.  Modbus.  Here you will create a Modbus connection.  Click the first Icon, here you will name your Modbus connection, I named mine Click because I'm talking to a Click.  You will setup what type of Connection it is.  I'm using the Ethernet click so I just had to put in the IP Address of the Click in the second setup screen.  
Hope this helps.  

794
Here is the M6 macro we have so far, this is an example of writing the register that the Click will use for the tool # and an example of the signal wait function.

795
To setup the Mach IO Config with modbus is very simple, you will notice that you have a new Device to choose from in the IO config in Mach4. 

We use Y001 in the click as a starting point for the Click PLC.  In the M6 Macro we turn on the Y001 Output on and then off.  We set a C# bit in the Click when Y001 Comes on, this C# Bit is what we use to start our tool change subprogram. 

There is also a lua function to wait for a signal before moving on.   http://www.machsupport.com/forum/index.php/topic,31092.0.html  here is thread that will help with this.  In our M6 macro, we wait for the Orient Release signal from the Click to signal Mach4 to continue its own M6 cycle to finish up the tool change on Mach's end.  And don't forget to Reset your C# bit in the last function of your tool change. 

I can add more examples if you need them later. 

Hope this helps.

796
We just finished getting a tool changer going with the Click PLC, communicating between the Click and Mach4 via TCP Modbus.

Through testing we learned that there is no need to setup Modbus "Send or Receive" functions in the Click PLC.  There is a direct relationship between the Click "Modbus Address" and the "Register#" in the Mach Modbus Configuration.

I will attach a few pictures to help you visualize what's going on.  

In the Click PLC you have a list of the Modbus Addresses.  Those will be used in the Mach4 Modbus Configuration.

In Mach4 Modbus Configuration, Start a new Modbus Connection and then add a new function.  I'll start with reading inputs from the Click.  (Refer to picture)  Start with "Read Coils", Slave Address didn't matter to me so we set it to 1, Modbus Register is what is important.  Referring to the "Modbus Addresses" Picture, look at X301, the Address is 100097, in the Modbus Register put "97" as the starting point, this is a 16 Point Input Block to for # of registers I put 16, the configuration setup will automatically realize that the #97 is the starting point.  I then named them X301-X316 to keep it a simple relationship with the Click IO Points.  

Outputs are done the same way, except the new function will be "Force Multiple Coils" and you will use the full Address Exp. 8272  (I also added a picture of Outputs Configuration)

Registers are what we use to tell the Click PLC which tool to change to by using the "Read Input Register" and "Write Single Register" functions in Mach4 Modbus.  In the setup, the Register# you use will be a direct relationship to the DS# (Data Bit) in the Click.  



797
Mach4 General Discussion / Prechange Tool Change
« on: February 16, 2017, 02:56:02 PM »
I'm wanting to add a Tool Prechange to my machine.  I've got my tool magazine being controlled via a Click PLC.  I'm sending the Pocket information to the PLC through Modbus Registers, and that is working very well. 

I just can't seem to figure out how to change the requested tool (mc.mcToolGetSelected(inst)) information outside the M6 Macro.  I thought it was done by putting a T# without the M6 on a line of code.  That doesn't seem to do it for me. 

Any ideas on how this  is accomplished?

798
Mach4 General Discussion / Re: MDI Problems
« on: February 16, 2017, 02:49:33 PM »
This is happened to me a few more times yesterday and today.  The only time I know exactly what I changed was Activating Input0 in the Mach config.  It did it twice when I did that.  But the previous times this problem occurred I hadn't messed with Mach Input Configurations at all.  So I'm still confused as to why I keep getting this error.   I am still able to restore the previous backup and be just fine.

799
Mach4 General Discussion / Re: MDI Problems
« on: February 14, 2017, 04:58:52 PM »
I found the "Restore Backup" Button on the Mach4 Loader.  The backup from this morning works great.  Not sure what I did.  The only thing that I really recall doing was try and run the Gcode Execute and MDI Execute from a Macro. 
Either way, if I figure out what it was I'll post it on here. 

800
Mach4 General Discussion / Re: MDI Problems
« on: February 14, 2017, 04:46:18 PM »
That's the thing.  The only thing that I've changed has been in the Mach Config and Modbus.  Other profiles work just fine.  Is there a way to restore previous versions? What little I've changed since yesterday won't matter to me, and it was working yesterday.