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

Abb s4c+ Postprocessor modification for IO

#2
You can simply override the setDO function inside your RobotPost class by using a function like the one below.

I attached the post processor I believe you need.

Code:
class RobotPost(BasePost):

def setDO(self, io_var, io_value):
"""Set a Digital Output"""
if type(io_var) != str: # set default variable name if io_var is a number
io_var = 'DO_%02i' % io_var

if type(io_value) != str: # set default variable value if io_value is a number
if io_value > 0:
io_value = '1'
else:
io_value = '0'

# at this point, io_var and io_value must be string values
self.addline('SetDO %s, %s;' % (io_var, io_value))


Attached Files
.py ABB_RAPID_S4C_Custom.py(Size: 5.33 KB / Downloads: 98)


Messages In This Thread
RE: Abb s4c+ Postprocessor modification for IO - byAlbert- 12-02-2022, 11:03 AM



Users browsing this thread:
1 Guest(s)