Hello Guest it is April 25, 2024, 08:12:33 PM

Author Topic: External LED's  (Read 5765 times)

0 Members and 1 Guest are viewing this topic.

External LED's
« 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
Re: External LED's
« 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.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: External LED's
« Reply #2 on: January 05, 2007, 09:11:39 PM »
I thought the format was:  GetOEMLed()

not  GetLed()
fun times
Re: External LED's
« 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
Re: External LED's
« 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

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: External LED's
« 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.
fun times
Re: External LED's
« 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