Hello Guest it is June 24, 2024, 05:16:44 AM

Author Topic: VBscript  (Read 3460 times)

0 Members and 1 Guest are viewing this topic.

VBscript
« on: January 23, 2013, 12:25:23 PM »
Hello
I need a VBScript which turned off OUTPUT 1 (spindle relay)  when activated input 1

I tried two ways but no result:
1.
ActivateSignal(OUTPUT1)
If Not(IsActive(INPUT13)) Then
DeActivateSignal(OUTPUT1)
If (IsActive(INPUT13)) Then
End If
ActivateSignal(OUTPUT1)
If (IsActive(INPUT13)) Then
End If
DeActivateSignal(OUTPUT1)
If Not(IsActive(INPUT13)) Then
End If
End If

2.
DoSpinCW()
Message "Spindle Start Requested"
ActivateSignal(OUTPUT4)
DoSpinStop()
Message "Spindle Stop"
IsActive(INPUT1)



Offline BR549

*
  •  6,965 6,965
Re: VBscript
« Reply #1 on: January 23, 2013, 03:00:08 PM »
IF Isactive(input1) then      'If signal "input1" is active
DeActivateSignal(output1)  ' Turn off output1
End If
End


(;-)TP
Re: VBscript
« Reply #2 on: January 24, 2013, 12:24:37 PM »
thanks now it works.

I have another question whether it is possible to write a VBScript:
1. When the axis moving the turn off relay (output1)
2. When the axis is not moving the turn on relay (output1)

Offline BR549

*
  •  6,965 6,965
Re: VBscript
« Reply #3 on: January 24, 2013, 02:03:25 PM »
When you say" When the axis moving the turn" do you mean a specific axis such as X or ANY axis in general XYorZ?

(;-) TP
Re: VBscript
« Reply #4 on: January 25, 2013, 04:41:50 AM »
Yes I was thinking about A-axis.
My machine uses a 4-axis in the tangential mode.
Is it possible to write a VB script to turn off relay when moving the A-axis, and the relay turns on again when the A-axis is not moving.

I was thinking, for example:
when using OEM DRO 809 (showing velocity) to turn off relay , when not in use OEM DRO 809 the turn on the relay.