Best way to modify single I/O pin on CANOpen DS 401
There's not a lot of data involved, so in case your node is the only node in the network that will access the particular DS401 node, the ultimate solution is to keep an "output mirror bitmap" in your own microcontroller RAM, which corresponds directly to all outputs you have sent to the DS401 node. That way you already know in advance the status of the other bits.

Which such a configuration you can also send out the data cyclically to the DS401 node and thereby contantly refresh it (industry de facto way of designing mission critical systems).

In case multiple nodes will be writing to the DS401 node, you have to use method B), read the data first, alter it and write it back.

The filter &amp; polarity etc features of DS401 are mildly useful. They are mainly intended to be used for on-site calibration purposes, in a system where the end user has access to the DS401 object dictionary but otherwise can't configure anything in the system. It doesn't make sense to use those features when you are writing software for microcontroller, since doing things like bit masking is trivial from inside the C program.