def control (self, file_name, action): """ Function doc """ packet, trans_no = pkb.pkt_filecontrol_cmd(self.logger_id, self.cpu_id, file_name, action, self.security_code, None) pkb.send(self.socket, packet) header, message = pkb.wait_pkt(self.socket, self.logger_id, self.cpu_id, trans_no) return message
def progctrl(self, FileName, FileCmd, SecurityCode = 0x0000 , TranNbr = None): """ allows for commands to be sent to the data logger to control the program arguments: FileName: (string) the file to start FileCmd: <0|1> (int) 0 turns off program, 1 starts a program SecurityCode: (int) security code TranNbr: best left to default """ pkt, t = pakbus.pkt_filecontrol_cmd(self.l_id, self.c_id, FileName, FileCmd, SecurityCode, TranNbr) pakbus.send(self.link, pkt) hdr, msg = pakbus.wait_pkt(self.link,self.l_id, self.c_id, TranNbr) return msg