0% found this document useful (0 votes)
5 views

Script Toggle Velocity

The Toggle_velocity.txt script adjusts drive speed based on the states of digital inputs 7 and 8. It defines four speed conditions corresponding to the combinations of these inputs, setting the drive to zero, positive 200, or negative 200 velocity. The script continuously reads the input states and executes the appropriate speed command in an infinite loop.

Uploaded by

mmreigen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Script Toggle Velocity

The Toggle_velocity.txt script adjusts drive speed based on the states of digital inputs 7 and 8. It defines four speed conditions corresponding to the combinations of these inputs, setting the drive to zero, positive 200, or negative 200 velocity. The script continuously reads the input states and executes the appropriate speed command in an infinite loop.

Uploaded by

mmreigen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

;

; Toggle_velocity.txt script
;
; The scripts checks state of digital input 7,8 and set drive speed accordingly
; IN 7 | IN 8 | V
; 0 | 0 | 0
; 1 | 0 | 200
; 0 | 1 | -200
; 1 | 1 | 0

; Digital input setup


#Print .........Digital_Inputs_Setup
inmode 7 0
inmode 8 0
ininv 7 0
ininv 8 0

;Variable for digital input 7,8 state


#var $in_state
#var $in_7
#var $in_8

;enter the drive to serial velocity loop


k
opmode 0
en

;infinite loop
#While 1>0

;read state of in 7 and in 8


$in_7 = {in 7}
$in_8 = {in 8}*2
$in_state =$in_7+$in_8

#If $in_state == 0 jog_zero


#If $in_state == 1 jog_positive
#If $in_state == 2 jog_negative

#Label jog_zero
#Print JOG_zero
j 0
#Goto end_loop

#Label jog_positive
#Print JOG_plus_200
j 200
#Goto end_loop

#Label jog_negative
#Print JOG_minus_200
j -200

#Label end_loop
#Delay 500
#End_While

You might also like