Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Production Management

Troubleshoot a code item

  • Last UpdatedFeb 20, 2024
  • 2 minute read

Some items to consider when troubleshooting code items.

Code items that wont compile

You can create code items that do not compile for one reason or another. For example, when you haven't finished writing it yet. Until you resolve the matter, your project cannot be saved to Server because AVEVA™ Production Management won't save code that it cannot compile. This stops a possible escalation of the problem through the propagation of unworkable code to the server and to any other connected clients.

CompileAction property

The CompileAction property is provided to permit a code item to be saved to the project and for its code to be flagged as incomplete, and not to be compiled or run. Set it to None while you develop your code and set it to Compile when the code is finished and you are ready to test the code functionality.

Working code items

If you want to add extra methods to an existing code item, and are concerned that setting the CompileAction property to None while you work on it would cause errors in other items (which reference the methods in the existing code item), do not worry. You can create a separate code item with the CompileAction property set to None to store the new methods temporarily until you finish them. After you finish working on the methods, copy them into your working project code item, and set the CompileAction property to Compile.

Determine why code item won't compile

  • If you have written some C# code, and it does not save, a common cause is incorrect C# syntax. To check this, and find out why your code does not compile, view the Output window and examine the Description field.

  • Basic errors like leaving a semi-colon off the end of a statement line causes the display of the message "; expected".

  • An error like forgetting to declare the data type of a variable, causes the message "identifier expected".

  • The Long Description field of the Output window displays the row and column number of the error to pinpoint the location of the problem.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in