An error detector comprising: an error detection data generating unit that generates error detection data from a data string sent from a first apparatus (1100, 50, 11), the error detection data being added to the data string to be stored in a second apparatus (1200, 13, 21); an error detecting unit that performs a parity check on the data string read from the second apparatus with the error detection data added thereto to detect an error in the data string read from the second apparatus; a data switching unit that switchingly outputs, as the error detection data to be added to the data string, either the error detection data sent from the error detection data generating unit or diagnostic data, for use as error detection data during testing, sent from a diagnostic data sending unit, based on an input state of a force generation enable signal received by the data switching unit; a failure diagnosing unit that determines whether the error detecting unit operates abnormally, based on whether a result of a parity check by the error detecting unit on the data string, to which the diagnostic data has been added, read from the second apparatus corresponds to errata information that indicates whether the diagnostic data sent from the diagnostic data sending unit makes a result of a parity operation on the data string normal or abnormal; and a determining unit that determines the data switching unit operates normally when the diagnostic data output from the diagnostic data sending unit and the error detection data read from the second apparatus match while the force generation signal is set to on and the data switching unit is switched to output the diagnostic data sent from the diagnostic data sending unit as the error detection data to be added to the data string for storage in the second apparatus, and further when the diagnostic data output from the diagnostic data sending unit and the error detection data read from the second apparatus do not match while the force generation signal is set to off and the data switching unit is switched to output the error detection data sent from the error detection data generating unit as the error detection data to be added to the data string for storage in the second apparatus; wherein the determining unit determines that the error detecting unit operates abnormally when the determining unit determines that the data switching unit operates normally and the failure diagnosing unit determines that the error detection function operates abnormally. an error detection data generating unit that generates error detection data from a data string sent from a first apparatus (1100, 50, 11), the error detection data being added to the data string to be stored in a second apparatus (1200, 13, 21); an error detecting unit that performs a parity check on the data string read from the second apparatus with the error detection data added thereto to detect an error in the data string read from the second apparatus; a data switching unit that switchingly outputs, as the error detection data to be added to the data string, either the error detection data sent from the error detection data generating unit or diagnostic data, for use as error detection data during testing, sent from a diagnostic data sending unit, based on an input state of a force generation enable signal received by the data switching unit; a failure diagnosing unit that determines whether the error detecting unit operates abnormally, based on whether a result of a parity check by the error detecting unit on the data string, to which the diagnostic data has been added, read from the second apparatus corresponds to errata information that indicates whether the diagnostic data sent from the diagnostic data sending unit makes a result of a parity operation on the data string normal or abnormal; and a determining unit that determines the data switching unit operates normally when the diagnostic data output from the diagnostic data sending unit and the error detection data read from the second apparatus match while the force generation signal is set to on and the data switching unit is switched to output the diagnostic data sent from the diagnostic data sending unit as the error detection data to be added to the data string for storage in the second apparatus, and further when the diagnostic data output from the diagnostic data sending unit and the error detection data read from the second apparatus do not match while the force generation signal is set to off and the data switching unit is switched to output the error detection data sent from the error detection data generating unit as the error detection data to be added to the data string for storage in the second apparatus; wherein the determining unit determines that the error detecting unit operates abnormally when the determining unit determines that the data switching unit operates normally and the failure diagnosing unit determines that the error detection function operates abnormally.