Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 12:00:21 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  External LED's
Pages: 1   Go Down
Print
Author Topic: External LED's  (Read 1473 times)
0 Members and 1 Guest are viewing this topic.
HillBilly
Active Member

Offline Offline

Posts: 181


View Profile
« on: January 05, 2007, 04:32:33 PM »

I am trying to interface some panel indicators. I thought I had it with this line running in the macropump:

If GetLED (4) Then ActivateSignal (OUTPUT10) Else DeActivateSignal (OUTPUT10) 'Cycle Start

So I added more like this:

If GetLED (4) Then ActivateSignal (OUTPUT10) Else DeActivateSignal (OUTPUT10) 'Cycle Start
If GetLED (5) Then ActivateSignal (OUTPUT11) Else DeActivateSignal (OUTPUT11) 'Feed Hold
If GetLED (57) Then ActivateSignal (OUTPUT12) Else DeActivateSignal(OUTPUT12) 'MPG

The fist line is the only one that works. I must be missing something, or is there a better way of doing this?

Darek
Logged
Ron Ginger
V4 Screen Contributor

Offline Offline

Posts: 568



View Profile WWW
« Reply #1 on: January 05, 2007, 08:27:30 PM »

I think you may need some End IF statements. Try

If GetLED (4) Then     'Cycle Start
   ActivateSignal (OUTPUT10)
Else
   DeActivateSignal (OUTPUT10)
End If

If GetLED (5) Then     'Feed Hold
   ActivateSignal (OUTPUT11)
Else
   DeActivateSignal (OUTPUT11)
End If

As you have it your second line only gets executed if the first ELSE is true.

Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #2 on: January 05, 2007, 09:11:39 PM »

I thought the format was:  GetOEMLed()

not  GetLed()
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
Ron Ginger
V4 Screen Contributor

Offline Offline

Posts: 568



View Profile WWW
« Reply #3 on: January 05, 2007, 10:06:26 PM »

You are right, I was looking at the IF...THEN.... END IF problem, I didnt look at the GetLED
Logged
HillBilly
Active Member

Offline Offline

Posts: 181


View Profile
« Reply #4 on: January 06, 2007, 09:24:15 AM »

Thanks neighbor (poppabear),

GetOEMLED(57) took care of the MPG indicator. Still working on getting feedhold to output.

Darek
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #5 on: January 06, 2007, 06:35:25 PM »

'Hey Hillbilly,

  'No, problem.

'On your feedhold, I did something like this with my macro pump (signal coming in off of a PLC),
'I dropped a UserLED on the screen also a counter DRO on a back screen:

'Macropump

x=GetUserDRO(1002)   'x starts at 0

If IsActive(INPUT4) Then   'your trigger input
SetUserLED(1002,1)         'turns on your panel feed hold active led
SetUserDRO(1002,1)         'sets DRO 1002 to 1
Else
SetUserLED(1002,0)         'when input off resets LED, and DRO to 0
SetUserDRO(1002,0)
End If



'BOTH these conditions (below), need to be true for your feed hold to push.
'This is so the Macro pump will not continue to "Push" the feed hold button each time it runs (10/sec).

If GetUserLED(1002) And X=0 Then
DoOEMButton(1001)       'Feed hold
End If



'It is kinda indirect, but it keep the macro pump from continuing to mash the feed hold.
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
HillBilly
Active Member

Offline Offline

Posts: 181


View Profile
« Reply #6 on: January 08, 2007, 10:45:08 AM »

I will have to digest that through the single stepper ( VB script editor.). I am still working on getting my VB legs. So far I have basically been borrowing code.

After looking over the default screens I noticed there is not a feedhold LED implimented.

Darek
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!