gmitchell
Joined on 12-01-2003
Optomation Systems, Madrid, Spain
Posts 153
Programming Tips:ioControl & OptoControl
[B]Successfully Exporting and Importing charts containing OptoScript[/B]
Chart export and import functionality is perfect for transferring code between different strategies or projects, but does give problems when the charts contain OptoScript blocks. Variables contained only in OptoScript blocks will not be added and must be added manually. If you are using OptoScript to reduce flow chart logic, the chances are the OptoScript code only uses a few variables and works with multiple indexes of float, integer and string tables. A useful tip to importing these variables, along with associated table lengths, descriptors and download options etc with the corresponding chart, is to create an independent action block marked “Delete This Block”.
Naming the same variables as used by OptoScript in any instruction within the block (such as “Move”, “Move to String”, or “Move to Table Element”), is good enough for the export function to identify and process the corresponding variables. After importing the chart in your new project, “Delete This Block” can be deleted, and the corresponding variables will be located and merged, successfully compiling code contained in the OptoScript blocks.
Checking the Chart Import Report will inform you of any variables that you forgot to include in the block, but are still present in OptoScript blocks. Simply return to the original chart, add them to the block, repeat the export activity and replace the previously imported chart to relink previously missing variables.