Welcome, Guest. Please login or register.
Did you miss your activation email?
December 01, 2008, 10:00:41 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Brains Development
| | |-+  Using a Brain for a page no. LED
Pages: 1   Go Down
Print
Author Topic: Using a Brain for a page no. LED  (Read 825 times)
0 Members and 1 Guest are viewing this topic.
Darc
Active Member

Offline Offline

Posts: 150


View Profile
« on: April 29, 2008, 04:44:35 PM »

I'm currently using a Macropump to control my page LED's

e.g. PageNo=GetPage()
If PageNo=1 Then
SetUserLED(1021,1)
SetUserLED(1022,0)
SetUserLED(1023,0)
SetUserLED(1024,0)
SetUserLED(1025,0)
Else
SetUserLED(1021,0)
End If

Is it possible to use a brain for this function?


* PageLED.jpg (17.28 KB, 514x148 - viewed 125 times.)
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #1 on: April 29, 2008, 06:30:21 PM »

Hey Darc,

   why put that in the macro pump?
Just put the code:
SetUserLED(1021,1)
SetUserLED(1022,0)
SetUserLED(1023,0)
SetUserLED(1024,0)
SetUserLED(1025,0)
 
in the button itself, and put the same thing in the next button but change the 1 to the next LED and set all the others to 0, each button would be mutually exclusive of the others.

They Brain has no way that I am aware of to see what page your on...... You could do it indirectly, but you wiould still end up putting code in your buttons..........so, might as well hard code the buttons.

scott

Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Darc
Active Member

Offline Offline

Posts: 150


View Profile
« Reply #2 on: April 29, 2008, 09:56:39 PM »

Thanks Scott, I did originally have this code in the button, but I found that for example if you are on page 5 and shutdown Mach.
When you restart it's still lit up on page 5 (last button pressed) even though you are on page 1 when it starts.
Darc
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #3 on: April 30, 2008, 02:12:21 PM »

Then just put the DoOEMButton(1) and set LEDs to what you want, in the Macropump and
(put the counter in it so it only runs once),. then when you reset or reboot, or start up, then it will default to Program page, and set all the LEDs to correct condtion, after that the counter locks it out from running again until your reset or reboot.

scott
Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Darc
Active Member

Offline Offline

Posts: 150


View Profile
« Reply #4 on: April 30, 2008, 07:17:27 PM »

Thanks again Scott, hot do I enter into the Macropump so it runs only once?
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Online Online

Posts: 770


Briceville, TN, USA



View Profile WWW
« Reply #5 on: May 02, 2008, 07:50:38 PM »

'Macropump.m1s

k=GetUserDRO(2000)                               'Interlock counter

If k=0 and Not(GetOEMLED(800)) Then     'reset off (mach in run condition)
DoOEMButton(1)                                 'sets program page to on
SetUserLED(2000,1)                  'set Program page led to on
setuserled(2001.0)                    'set next page LED to 0, list your following LEDs that need to be off under this
SetUserDRO(2000,1)                                'set interlock counter
End If

If GetOEMLED(800) Then                        'On reset (mach in Estop condition)
SetUserDRO(2000,0)                               'reset interlock counter
End If

scott
Logged

All things Mach3, Screens, Wizards, Plugins, Brians, complete control solutions for complex machines, Macros, ATC's, any kind of CNC machine build, retrofit or repair.
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!