convert data coming in from a PD to C structs