9/13/2005
Programming the SMLC
68
CoDeSys - Importing functions and code
•
CoDeSys has the ability to import and
export code, anywhere from a single
variable to an entire project.
•
We’ll use this feature to import some useful
functions so we don’t have to type them in.
•
Go to the Project | Import menu and import
the file UtilityFunctions.exp. This file should
be available on the ORMEC web site or it
may be found on the CDS-SDK CD-ROM.
•
We can see the Import has given us
several useful functions, including
EnableAxis and JogAxis.
•
We’ll use EnableAxis to enable our motors
and JogAxis to make the motors move.
•
Another way to access external code is via a library. The difference between
importing code and using a library is that imported code gives you access to the
source while a library does not.