Strange Blockly function behaviour

I wrote a program in blockly to plant seeds in a seedling tray. It worked fine until I tried adding code to the CO1 output port on the control box to drive a relay. The relay is used to operate a solenoid valve on an air line.
Now the code bounces back and forth between two function calls and doesn’t finish either function. It may be related to the port issue or due to the various wait() calls. None of the wait or sleep calls seem to match with the timing specified.
Any thoughts?

Hello,

  1. Please reproduce the issue,and send the log of the controller to us.
    For the method of download log,please refer the article: http://help.xarm.cc/en/articles/3965923-guide-to-download-the-log-file-on-the-xarm-studio
  2. Please send your program to us.
  3. Please send a picture about the interface of the IO configuration to us.