Browse FAQs

SoMachine - An Unhandled Exception appears when I type an opening parenthesis to instantiate a function call in Structured Text

Published date: 17 July 2019

Issue
In EcoStruxure Machine Expert / SoMachine, after declaring a Function Block in a POU's declaration area previously, if I type an opening parenthesis "(" after typing the name of the function block in Structured Text language, an Unhandled Exception message pops up starting with:
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at . . (String , ISignature& , LList`1& )
   at . . (String , IVariable& , ISignature& , IPrecompileScope& )
   at . . (VariableExpression )
   at _3S.CoDeSys.LanguageModelManager.VariableExpression. ( )
   at _3S.CoDeSys.LanguageModelManager.PreCompileContext.FindSubelements(Guid guidSignature, String stAccessPathOrType, FindSubelementsFlags flags, Boolean& bError)
   at _3S.CoDeSys.IECTextEditor.IECTextEditor.GetQuickTipData(String accessPath)
   at _3S.CoDeSys.IECTextEditor.TokenMarker.GetQuickTipForPosition(SynEdControl syned, Int32 position, QuickTipData& quickTipData, Int32& quickTipPosition)
… 


Product Line
EcoStruxure Machine Expert / SoMachine

Environment
PLC Configuration Software

Cause
The likely cause is that if the POU where the Function Block is defined is Excluded from Build, the context lookup will not be able to auto-complete the phrase.

Resolution
Steps:
  1. Find the POU that has the declaration of the Function Block you wish to use in it that is Excluded from Build. The node that are excluded from build will appear as light-blue text under Application.
  2. Right-click on the POU where the Function block is declared (it may be different than the POU that you are writing the Structured Text program). 
  3. Select Properties
  4. Click on the "Build" tab
  5. Untick "Exclude from build"
  6. Click OK

Was this helpful?

What can we do to improve the information ?

Can't find what you are looking for?

Reach out to our customer care team to receive information on technical support, assistance for complaints and more.