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

getDI(io_var) with postprocessor

#1
I try to integrate digital inputs into my robotprogramm, which is generated by the postprocessor.
As written in the manual for getDI(io_var): This function is only useful when connected to a real robot using the robot driver.
It's logic, that if no robot is connected to RoboDK, getDI has no function in a simulationprogramm. But I could give the simulation a sample value, and work with that. But if I want to get a digital input in an offline robotprogramm, generated with a postprocessor, how could I implement this?


Maybe following code explains, what i mean. I got a Python-Script which checks, if a DI is true. If it's true, a movement will be started. r is the robot.

Code:
if getDI(2):
   r.MoveJ(somePoint)
r.MoveJ(somePoint2)

This code will be interpreted and sent to the postprocessor like this:

Code:
r.RunMessage(r"""getDI(2) command is only available when using the API""", True)
r.MoveJ(somePoint)
r.MoveJ(somePoint2)

Technically, I could catch this RunMessage and I would know, where the if-condition starts. But I got no information about how far the if condition reaches and if MoveJ(somePoint2) was inside of the condition or not. Is there any possibility to get this to work?
Thanks.
  




Users browsing this thread:
1 Guest(s)