RoboDK Forum
Abb s4c+ Postprocessor modification for IO- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK)
+--- Thread: Abb s4c+ Postprocessor modification for IO (/Thread-Abb-s4c-Postprocessor-modification-for-IO)



Abb s4c+ Postprocessor modification for IO-De Besturing-12-01-2022

Hi ?

We’re currently having some issues concerning the post processor for an abb s4c+ Controller. The robodk s4c postprocessor now generates
SetDO D_OUT_3 when we load the program the controller want is to change it to DO_03

We have run the program and did a manual replacement of the SetDO D_OUT_3 to DO_03 in visual studio code an that works.

我们瞧oked at the base post, but need to go deeper in the post. Obviously we want the postprocessor to do the correction how can we approach the issue here. Can someone elaborate on this!

Regards de besturing


RE: Abb s4c+ Postprocessor modification for IO-Albert-12-02-2022

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))



RE: Abb s4c+ Postprocessor modification for IO-De Besturing-12-02-2022

Hi Albert,

For future modifications of the post can we adjust and use your attached script to do the same for DI, AO, AI, or do you have to do this ? (were learning here... steep learning curve :) Were grateful for the added post-processor/script, next Monday we will be testing the new post with added script for the DO (Digital out) in conjunction with the hardware that's connected to the robot controller Output.

Another Thank You!!

Regards The Besturing


RE: Abb s4c+ Postprocessor modification for IO-Albert-12-02-2022

Yes you can fully customize the post processor, including setting analog outputs and more. You can contact us by email requesting the source code of the original post processor and we can provide it to you.

More information about customizing post processors here:
//www.sinclairbody.com/doc/en/Post-Processors.html#EditPost