Like any computer system, imaginary numbers will have to be handled as either a structure or array where each "number" has two sub-elements; the real part and the imaginary part.
You will then have to define your own functions for all of the operations you wish to perform on the imaginary numbers. In FORTRAN these are sometimes also called Complex Numbers so that you could write functions such as
CADD for adding
CSUB for subrraction
CMUL for multiplication
etc....
At some level of complexity you will have to weigh the option of writing the impginary part of your program in a higher level language such as C++ where you can find ready made libraries for dealing with imaginary numbers.
I believe there are ways to link your own programs into CoDeSys but I have never done it myself. Others will have to comment on this.
Good Luck
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does anybody know how to use imaginary number in CoDeSys?
thanks for your help
Like any computer system, imaginary numbers will have to be handled as either a structure or array where each "number" has two sub-elements; the real part and the imaginary part.
You will then have to define your own functions for all of the operations you wish to perform on the imaginary numbers. In FORTRAN these are sometimes also called Complex Numbers so that you could write functions such as
CADD for adding
CSUB for subrraction
CMUL for multiplication
etc....
At some level of complexity you will have to weigh the option of writing the impginary part of your program in a higher level language such as C++ where you can find ready made libraries for dealing with imaginary numbers.
I believe there are ways to link your own programs into CoDeSys but I have never done it myself. Others will have to comment on this.
Good Luck