Embed has Extern Read, Extern Write and Extern Function blocks to read and write external variables, as well as to call external functions.
To merge your code
1. Use Extern Read and Extern Write blocks to read and write external variables.
2. Use Extern Function blocks to call your functions. You can specify parameters as input connectors to the block and access the function result as an output connector on the block.
3. Add your OBJ file to the targetCL.BAT file (for example, F280xcl.bat) found in the \Embed-install-directory\CG directory. To add your OBJ file to the BAT file, open the BAT file in Notepad and type the path to your OBJ after “set USER_OBJS=” in the first line of the file. If you have more than one file, separate them with commas.
To run your initialization code, put the code in a function called userStartup(). This function is called by Embed-generated code at boot time. You can install your interrupt handler and perform any other initialization task in this function.