A portable electronic device, such as a flashlight, with a battery pack assembly is provided. The IO module further includes a part program that specifies first and second positions of the tool without reference to the working space limits. When the external signal is in ON state, a position command or the like is corrected by the correction amount obtained by the correction amount generating section and sent via switches.