Modified writeSingleCoil (and helper/wrapper functions) to accept scalar $data