Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is possible to add a ModellingRule in Argument of a Method #187

Open
GizzScm opened this issue Aug 22, 2024 · 7 comments
Open

Is possible to add a ModellingRule in Argument of a Method #187

GizzScm opened this issue Aug 22, 2024 · 7 comments

Comments

@GizzScm
Copy link

GizzScm commented Aug 22, 2024

Hi,
I was trying to add in the following argument a modelling roule :

I noticed that this command isn't taken by the compliler . However the compiler doesn't get any error.
By loking in to the documentation:

https://reference.opcfoundation.org/Core/Part3/v104/docs/8.6

It's seems that you can't put the ModellingRoule in the argument of a method.
But if so why the compiler doesn't return an error, is that a bug of the compiler?
It's possible to add the ModellingRoule into the argument of a method ?

@opcfoundation-org
Copy link
Contributor

Can you attach you design file to the post?

@GizzScm
Copy link
Author

GizzScm commented Aug 22, 2024

Do you mean the xml file that i compile with visual studio ?

@opcfoundation-org
Copy link
Contributor

The file that you are providing as input to the model compiler.

@GizzScm
Copy link
Author

GizzScm commented Aug 22, 2024

OpcUaSacmiField.zip

@opcfoundation-org
Copy link
Contributor

Try appending 'MethodType' to names of the Methods that define the argument. This tells the tool that the 'Method' is not a Node that should appear in the address space but rather a template used to build Method nodes that reference it in their TypeDefinition.

@GizzScm
Copy link
Author

GizzScm commented Aug 30, 2024

you mean for example to add ad this method :

<Method SymbolicName="OpcUaSmField:LoadNextRecipe"  TypeDefinition="OpcUaSmField:LoadNextRecipe"  ModellingRule="Mandatory"/>`
 <Method SymbolicName="OpcUaSmField:LoadNextRecipe">
    <BrowseName>LoadNextRecipe</BrowseName>
    <Description>Planning of a recipe</Description>
    <InputArguments>
          <Argument Name="DatasetName" DataType="OpcUa:String" ValueRank="Scalar">
           <Description/> 
          </Argument>
          <Argument Name="DatasetGroup" DataType="OpcUa:String" ValueRank="Scalar">
           <Description/>
	      </Argument>
          <Argument Name="BillMaterialName" DataType="OpcUa:String" ValueRank="Array">
           <Description /> 
          </Argument>
           <Argument Name="Settings" DataType="OpcUaSmField:Setting" ValueRank="Array"  ModellingRule="Optional">
		       <Description/>
            </Argument>
    </InputArguments>
    <OutputArguments>
          <Argument Name="MethodResult" DataType="OpcUaSmField:MethodResult" ValueRank="Scalar">
           <Description/> 
          </Argument>
    </OutputArguments>
  </Method>

The following 'MethodType' in the name of the method like that :
<Method SymbolicName="OpcUaSmField:LoadNextRecipeMethodType" TypeDefinition="OpcUaSmField:LoadNextRecipe" ModellingRule="Mandatory"/>

If is this what you mean i have tried but it doesn't work for me. If i had misunderstood can you please make an example?
It would be good if you can explain where exactly i have to put the 'Methodtype'. Thanks

@opcfoundation-org
Copy link
Contributor

opcfoundation-org commented Aug 30, 2024

I mean:

<Method SymbolicName="OpcUaSmField:LoadNextRecipeMethodType"....

and

<Method SymbolicName="OpcUaSmField:LoadNextRecipe" TypeDefinition="OpcUaSmField:LoadNextRecipeMethodType" ModellingRule="Mandatory"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants