Hello Guest it is April 19, 2024, 08:03:41 AM

Author Topic: Please help, NOOB trying to use PLC and Script for M6  (Read 4313 times)

0 Members and 1 Guest are viewing this topic.

Please help, NOOB trying to use PLC and Script for M6
« on: May 18, 2009, 10:30:10 PM »
Is it possible to run a script and have it set outputs that run subroutines in the PLC. Because I set up subroutines for the tool removal and replacement and linked them to discrete input buttons to test and the subroutines work great. But when Mach is on then the plc wired buttons begin to work then STOP. I am wondering if I need to set it different. I  would appreciate any help, I am sure I will return the favor in the future.
Thank you
Jaime

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Please help, NOOB trying to use PLC and Script for M6
« Reply #1 on: May 19, 2009, 08:47:46 AM »
Jamie,

    Your problem that your experiencing is unclear, can you elaborate more.......?  Having said that, I run PLCs from my M6, and other things.

You will need to syncronize your scripts with the PLC in a "Hand Shake" style arrangement.
let me give an example:

In your M6 you turn on a ULED, the next line you set a UDRO to a tool number, the next block is a while loop waiting on the ULED.
the brain transfers the info to your PLC, the PLC sees the ULED is on, and jumps to your substage. The substage pulls the UDRO and does
the tool change function you wrote. At the end of that change, the PLC, turns off the ULED, the brian sees it and turns off the ULED, the while loop drops
out. your next code updates the tool dro to the new tool.

scott
fun times
Re: Please help, NOOB trying to use PLC and Script for M6
« Reply #2 on: May 20, 2009, 07:37:22 PM »
Thank you Scott for replying. I have gotten my plc to write the tool location into a register and Mach to read it now. But I am having trouble getting mach to send the newtool number to another register, or any register for that matter.  As I attempt to do this on my own( with help from you) I have very much respect for you and what it takes to figure this out. I have a migraine on a daily basis. My problem before was I had mach reading and writing the discrete i/o's not holding registers. So mach was taking control of all of the inputs and outputs.
Any help further would be great,
Thank you
Jaime
Re: Please help, NOOB trying to use PLC and Script for M6
« Reply #3 on: May 20, 2009, 09:27:32 PM »
I did get it transmitting my new tool number now, Thanks again for the help
Jaime.
I will post more info as I go, I have a tread on the zone with videos if anyone is intersted
BTC-1 machine build

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Please help, NOOB trying to use PLC and Script for M6
« Reply #4 on: May 21, 2009, 09:58:01 AM »
NOTE: If you decide to use Holding registers in the PLC (User varible memory), AND you want to use Discrite bits to and from mach, then make that a "Bit of Word" to represent each bit.

i.e.   B1200.0, and B1201.0 in an ADC plc would represent 2 discrete bits that you can access in your ladder. Unfortunatly, you have to use an entire word, since the Bit of word function in Brians is currently broken.

see the "Brians Users Guide" in the members doc section of this forum, it may clear up some things for you.

scott
fun times