Now that you have seen both techniques, use the method editor to implement the driver.
Note that this is C code with some %-delimited commands. Those commands are part of the Processor Expert scripting language. When Processor Expert generates code, it reads the state of the property and modifies the generated code based on the if/else condition. This minimizes the generated code.
int i, res = 0;
// Compute parity using shifting and XOR
for (i = 0; i < 8; i++) {
res = res ^ (Data >> i);
}
%if %EvenParity = 'yes'
return (byte)(res & 1); // mask result
%else
return (byte)(~res & 1); // mask result
%endif