View.Set ("text")
var startxcord : nat
var startycord : nat
var nextxcord1 : nat
var nextycord1 : nat
var nextxcord2 : nat
var nextycord2 : nat
var xdist1 : nat
var ydist1 : nat
var xdist2 : nat
var ydist2 : nat
var xdir1 : string
var ydir1 : string
var xdir2 : string
var ydir2 : string
var restart : string
%Begin
put "Input Start X Coordinate"
get startxcord
if startxcord > 100 then
put "Invalid"
put "100 is the maximum"
put "Input Valid Start X Coordinate Again"
put "Or the Program will Crash"
get startxcord
put "Input Start Y Coordinate"
get startycord
else
put "Input Start Y Coordinate"
get startycord
end if
if startycord > 100 then
put "Invalid"
put "100 is the maximum"
put "Input Valid Start Y Coordinate Again"
put "Or the Program will Crash"
get startycord
else
end if
if startxcord >= 1 then
put "X Axis Motor Rotation Beginning"
put "Please Wait for ", startxcord * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (startxcord * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
else
put "X Axis Motor not Instructed to Rotate"
end if
if startycord >= 1 then
put "Y Axis Motor Rotation Beginning"
put "Please Wait for ", startycord * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (startycord * 99)
%PC.ParallelPut (port : int, value : int)
put "Y Axis Motor Rotation Finished"
else
put "Y Axis Motor not Instructed to Rotate"
end if
put "Device in Starting Position"
put "Please Insert Tool"
put "When Ready, Press ANY Key and Enter"
get restart
%in start pos
%to next
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord1
if nextxcord1 > 100 then
put "Invalid"
put "100 is the maximum"
put "Input Valid Next X Coordinate Again"
put "Or the Program will Crash"
get nextxcord1
put "Next X Coordinate is ", nextxcord1
else
put "Next X Coordinate is ", nextxcord1
end if
%x only
if nextxcord1 > startxcord then
xdist1 := nextxcord1 - startxcord
xdir1 := "Right / Positive"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir1
put "Please Wait for ", xdist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord1
elsif nextxcord1 < startxcord then
xdist1 := startxcord - nextxcord1
xdir1 := "Left / Negative"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir1
put "Please Wait for ", xdist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord1
elsif startxcord = nextxcord1 then
put "X Axis Motor not Instructed to Rotate"
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord1
else
put "Error, Please Restart Program"
end if
%y only
if nextycord1 > startycord then
ydist1 := nextycord1 - startycord
ydir1 := "Up / Positive"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir1
put "Please Wait for ", ydist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
elsif nextycord1 < startycord then
ydist1 := startycord - nextycord1
ydir1 := "Down / Negative"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir1
put "Please Wait for ", ydist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "Y Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
elsif startycord = nextycord1 then
put "Y Axis Motor not Instructed to Rotate"
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
else
put "Error, Please Restart Program"
end if
loop
%x2 only
if nextxcord2 > nextxcord1 then
xdist2 := nextxcord2 - nextxcord1
xdir2 := "Right / Positive"
put "x2 only"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir2
put "Please Wait for ", xdist2 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist2 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
elsif nextxcord2 < nextxcord1 then
xdist2 := nextxcord1 - nextxcord2
xdir2 := "Left / Negative"
put "x2 only"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir1
put "Please Wait for ", xdist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist2 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
elsif nextxcord1 = nextxcord2 then
put "X Axis Motor not Instructed to Rotate"
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
else
put "Error, Please Restart Program"
end if
%y2 only
if nextycord2 > nextycord1 then
ydist2 := nextycord2 - nextycord1
ydir2 := "Up / Positive"
put "y2 only"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir2
put "Please Wait for ", ydist2 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist2 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord1
elsif nextycord2 < nextycord1 then
ydist2 := nextycord1 - nextycord2
ydir2 := "Down / Negative"
put "y2 only"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir2
put "Please Wait for ", ydist2 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist2 * 99)
%PC.ParallelPut (port : int, value : int)
put "Y Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord1
elsif nextycord1 = nextycord2 then
put "Y Axis Motor not Instructed to Rotate"
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord1
else
put "Error, Please Restart Program"
end if
%x1 only
if nextxcord1 > nextxcord2 then
xdist1 := nextxcord1 - nextxcord2
xdir1 := "Right / Positive"
put "x1 only"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir1
put "Please Wait for ", xdist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
elsif nextxcord1 < nextxcord2 then
xdist1 := nextxcord2 - nextxcord1
xdir1 := "Left / Negative"
put "x1 only"
put "X Axis Motor Rotation Beginning"
put "Direction is: ", xdir1
put "Please Wait for ", xdist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (xdist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "X Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
elsif nextxcord2 = nextxcord1 then
put "X Axis Motor not Instructed to Rotate"
put "Input Next Y Coordinate"
put "Or Input Current Y Coordinate to Set X Coordinate"
get nextycord2
else
put "Error, Please Restart Program"
end if
%y1 only
if nextycord1 > nextycord2 then
ydist1 := nextycord1 - nextycord2
ydir1 := "Up / Positive"
put "y1 only"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir1
put "Please Wait for ", ydist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "Y Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
elsif nextycord1 < nextycord2 then
ydist1 := nextycord2 - nextycord1
ydir1 := "Down / Negative"
put "y1 only"
put "Y Axis Motor Rotation Beginning"
put "Direction is: ", ydir1
put "Please Wait for ", ydist1 * 99, " Seconds"
%PC.ParallelPut (port : int, value : int)
delay (ydist1 * 99)
%PC.ParallelPut (port : int, value : int)
put "Y Axis Motor Rotation Finished"
put "Press ANY Key and then Enter to Continue"
get restart
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
elsif nextycord2 = nextycord1 then
put "Y Axis Motor not Instructed to Rotate"
put "Input Next X Coordinate"
put "Or Input Current X Coordinate to Set Y Coordinate"
get nextxcord2
else
put "Error, Please Restart Program"
end if
end loop
|