Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

GetDI command not functioning

#6
Hi Jens,

Albert and I just ran a few tests and there were indeed a few bugs.
Some things were missing in your code and some were missing in ours.

We should release a fixed version of RoboDK later today.

Your code should look a bit like this.

Code:
#Set Robot
robot = RDK.Item('TM12',ITEM_TYPE_ROBOT)

if robot.Connect():
print('connection ok')
else:
print('connection failed')


#collision checking
CHECK_COLLISIONS = False
RDK.setCollisionActive(COLLISION_ON if CHECK_COLLISIONS else COLLISION_OFF)

delay = 1 #delay in seconds

for i in range (0,11):
di = robot.getDI(i)
print(i, "input:", di)
time.sleep(delay)

Also, make sure the Listen Node is running on the controller.

Jeremy
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYoutube Channel.




Messages In This Thread
GetDI command not functioning - byJensaandenboom- 12-14-2020, 02:55 PM
RE: GetDI command not functioning - byJeremy- 12-14-2020, 03:43 PM
RE: GetDI command not functioning - byAlbert- 12-14-2020, 04:51 PM
RE: GetDI command not functioning - byJeremy- 12-15-2020, 05:50 PM
RE: GetDI command not functioning - byJeremy- 12-16-2020, 07:12 PM



Users browsing this thread:
1 Guest(s)