public CanOpenStatus setIO(int index, bool value) { byte ioByte = output_mirror_values[index / 8]; byte bit = 0x1; int shifts = index % 8; ioByte = (byte)(bit << (byte)shifts); if (value == true) { output_mirror_values[index / 8] |= ioByte; } else { byte test = (byte)~ioByte; output_mirror_values[index / 8] &= (byte)~ioByte; } transmit_pdo.setup((uint)0x200 + this.node_id, this.output_mirror_values, (byte)(this.digital_outputs / 8)); return(transmit_pdo.transmit()); }