BL4S200 - Output #30 or #31 Not Off


We have been using the BL4S200 for a couple of years with very good success.

Recently, we found that when the digital I/O numbers 30 & 31 are set to outputs, they appear to randomly get stuck in an On state even though the last command execute (setDigOut) was executed to turn off the output.

The time duration from turning on the output to clearing the output is approximately 37ms.

We noticed in the documentation that DIO 30 & 31 do not have their output functionality controlled by an RIO chip.

Currently we moved the outputs to other DIO numbers to see if we still have the failure.

Note: We have the setDigOut method wrapped inside of a semaphore.

Dynamic C Version - 10.72B

Any feedback would be greatly appreciated.

Best Regards,


I don’t have a BL4S200 handy to do any testing, but I reviewed the libraries and didn’t see anything obvious.

I’d recommend using the Dynamic C debugger to single-step through the code for setDigOut and step into the library code to see what line is responsible for turning the output on.

It might be some other I/O call stepping on the “__latch_sr” shadow register used for those pins.

You’ll need to define RSB_DEBUG in the project or your program in order to step through RIO_SBC.LIB and define BL_DEBUG to step through BLxS2xx.LIB.

If you can provide more details, I can investigate possible causes and recommend a fix. I’m not too familiar with exactly how those I/O pins are supposed to work with the output controlled by a latch and the input controlled by the RIO.

A simple workaround would be to only use DIO30 & 31 as inputs, but it should be possible to use them as outputs.


Thanks for your reply.

The issue is that I cannot recreate the scenario which causes the outputs DIO 30 & 31 to fail in shop.

I tried running the outputs at a rate of 500hz and everything functions properly.

The issue which I reported only occurs at an install offsite, and very randomly.

I am suspecting the issue may be related to the wiring, or possibly environmental (noise, voltage…).

Since we moved the I/O from DIO 30 / 31 to other outputs we have not encountered any issues.

I will continue researching the issue and let you know if / when a resolution is discovered.