def communicate_through(self, file):
if self._communication is not None:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>self._communication = communication = Communication(<EOL>file, self._get_needle_positions,<EOL>self._machine, [self._on_message_received],<EOL>right_end_needle=self.right_end_needle,<EOL>left_end_needle=self.left_end_needle)<EOL>return communication<EOL>
Setup communication through a file.

        :rtype: AYABInterface.communication.Communication