At the European level, Directive 2009/24 seeks to harmonise Member States’ legislation in the field of legal protection of computer programs by defining a minimum level of protection. Member States protect computer software as such by copyright, by analogy to the protection given to literary works within the meaning of the Berne Convention for the Protection of Literary and Artistic Works.
Copyright will protect only the computer program in the form written by a programmer i.e. its source code. Neither the functionality of a computer program, nor the programming language or the format of data files used in a computer program in order to exploit certain of its functions constitute a form of expression of that program, and thus, those are not protected by copyright.
Article 52 of the European Patent Convention excludes software from patentability to the extent that a patent application relates to a computer program as such. A distinction is, however, made between “software patents” which are excluded according to Article 52 EPC and so called computer-implemented inventions which are accepted at the European Patent Office. In this respect, “computer-implemented inventions” can be defined as inventions whose implementation involves the use of a computer, a computer network or other programmable apparatus, having one or more features realised by means of a computer program. It seems therefore that patentability must not be denied merely because a computer program is involved. You could seek patent protection if the subject matter of your invention as a whole, i.e. a machine with related software, has a technical character - this technical character must be present in all variants covered by the patent claim.