I tried BaseDataTyp, but than I get compiler errors like this:
"Fehler: »class UaVariant« hat kein Element namens »toVariant«"
Do you have a solution for me?
I know its pretty hard to handle the Variant Typ in the uaModeler, but I need it for my model.
How I can use the Built-in DataTyp “Variant” or “Variant[]” ?
Moderator: uamodeler
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
- Support Team
- Hero Member
- Posts: 3069
- Joined: 18 Mar 2011, 15:09
Re:How I can use the Built-in DataTyp “Variant” or “Variant[]” ?
I think you try to add a property to the Server object like in your last post.
The code examples in this post will be useful for exactly this.
BaseDataType is abstract, so normally you should not use it. If you want to use it anyway you can call
or
delete the line with "toVariant" and call
Kind Regards, Support Team
The code examples in this post will be useful for exactly this.
BaseDataType is abstract, so normally you should not use it. If you want to use it anyway you can call
Code: Select all
defaultValue.clear();
delete the line with "toVariant" and call
Code: Select all
pVariableType->setDataType(OpcUaId_BaseDataType);
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
Re:How I can use the Built-in DataTyp “Variant” or “Variant[]” ?
Ok, good to know.
Unfortunately, I didn' t mention that I created a subtype of "DeviceType" (from OPC UA Part DI) and this subtype has a method "Transfer".
The signature should look like this:
Transfer(
[in] String CommunicationRelationId,
[in] Variant[] SendData,
[out] Variant[] ReceiveData,
[out] Integer ServiceError);
I think I need the Variant[] Typ during the modeling process.
I had used a simpler DataTyp e.g. Int32 during the modeling time. After that I tried to change the type in the generated code, but there are to many dependence on the previous DataTyp Int32.
Do you have an idea/hint what I can do?
Thank you for your efforts
Unfortunately, I didn' t mention that I created a subtype of "DeviceType" (from OPC UA Part DI) and this subtype has a method "Transfer".
The signature should look like this:
Transfer(
[in] String CommunicationRelationId,
[in] Variant[] SendData,
[out] Variant[] ReceiveData,
[out] Integer ServiceError);
I think I need the Variant[] Typ during the modeling process.
I had used a simpler DataTyp e.g. Int32 during the modeling time. After that I tried to change the type in the generated code, but there are to many dependence on the previous DataTyp Int32.
Do you have an idea/hint what I can do?
Thank you for your efforts
-
- Hero Member
- Posts: 21
- Joined: 07 Oct 2012, 11:18
Re:How I can use the Built-in DataTyp “Variant” or “Variant[]” ?
Mmmm I don't know why, but the form put some extra text after the first
"Do you have an idea/hint what I can do?" If I use the Edit mode, I see the right message. The extra text occurs only in the preview and the final view.
"Do you have an idea/hint what I can do?" If I use the Edit mode, I see the right message. The extra text occurs only in the preview and the final view.
- Support Team
- Hero Member
- Posts: 3069
- Joined: 18 Mar 2011, 15:09
Re:How I can use the Built-in DataTyp “Variant” or “Variant[]” ?
Hi ChSch,
Can you update the UaModeler to version 1.2? This might fix the compile errors.
Note that the implementation class of the Type (.cpp) will not be overwritten when generating code. So you have to delete the file before generating code.
Kind Regards
Can you update the UaModeler to version 1.2? This might fix the compile errors.
Note that the implementation class of the Type (.cpp) will not be overwritten when generating code. So you have to delete the file before generating code.
Kind Regards
Best regards
Unified Automation Support Team
Unified Automation Support Team