Example v+ code – Adept AnyFeeder User Manual

Page 63

Advertising
background image

V+ Keywords

Adept AnyFeeder User’s Guide, Rev B

63

Example V+ Code

The following V+ code provides an example of implementing Adept AnyFeeder control through a
V+ program. For proper functionality, this code would be used along with robot-control code and
error-checking code to create a complete V+ application.

; Set parameter values

$ip = "172.21.12.91"

prm.ffwd.speed = 6001

prm.ffwd.iter = 6011

prm.run.action = 6000

operation = 1

anyfeeder.id = 3

; Set FeedForward speed

VPARAMETER(anyfeeder.id, -1, prm.ffwd.speed, -1, -1) $ip = 1

; Set FeedForward iterations

VPARAMETER(anyfeeder.id, -1, prm.ffwd.iter, -1, -1) $ip = 20

; Set the operation to be done at vrun : FeedForward

VPARAMETER(anyfeeder.id, -1, prm.run.action, -1, -1) $ip = operation

; Check AnyFeeder is ready (idle)

state = VSTATE($ip, anyfeeder.id)

IF (state <> 0) THEN

TYPE "Not ready, status = ", state

END

; Start the feed operation

VRUN $ip, anyfeeder.id

TYPE "Start Waiting"

; Type status (running)

TYPE "state = ", VSTATE($ip, anyfeeder.id)

; Wait completion

VWAITI (anyfeeder.id) $ip

TYPE "Finished Waiting"

TYPE "state = ", VSTATE($ip, anyfeeder.id)

Advertising