Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
Limitations of live mappings?
Yes-subscribe to the update failure event
Not precisely. Not a separate class. Just pick one of the properties that do not update, and add an extra property to the same class, next to it. E.g. besides having "public double Input1 { get; set; }, add also "public Exception Input1Exception { get; set; }". And use "[UAData(Kind = UADataMappingKind.Exception)]" as you have in your example. BUT, everything else (attribute-wise) should be the same as on the original property. So if your original property for subscriptions and reads, the exception one should be too - so that you can diagnose the subscription/read issues.-mapping the a similiar class with a different mapping kind (exception, error code, etc.) to the struct on the server where the data type should match the mapping kind?
Please Log in or Create an account to join the conversation.
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
- Posts: 69
- Thank you received: 0
-subscribe to the update failure event
-mapping the a similiar class with a different mapping kind (exception, error code, etc.) to the struct on the server where the data type should match the mapping kind? --> do you have an example for this?
Do you mean something like this?
[UANode, UAData(Operations = UADataMappingOperations.Write, Kind = UADataMappingKind.Exception)] // not readable
public Exception Input1 { get; set; }
Please Log in or Create an account to join the conversation.
First thing to do in the troubleshooting is to make sure you have all information about possible errors that might be occurring. Please read "Error Handling in the Mapper Object": opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...n%20the%20Mapper%20Object.html .
Make sure you have some way to detect all these kinds of errors. Specifically, make sure you also add some mapping with Kind of Exception (or ErrorMessage or ErrorCode) (opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...rame.html#Mapping%20Kinds.html ), so that you can discover the issues described under letter (D). But other possible causes, e.g. (C), cannot be ruled out either, so please have some handling for them too.
Please Log in or Create an account to join the conversation.
- Captain_Dash
- Topic Author
- Offline
- Platinum Member
- Posts: 69
- Thank you received: 0
I tried to use the live mapping feature for struct on the opc server. I created a class which is similiar to the struct and equipped the class with the attributes of your live mapping feature. Of this class I created 3 instances because I need to map each class to a different instance of the struct on the server. In the first place I started to map this class and everything works fine, so added the second, still everything is fine. I am getting the changes from the server, so the subscription is working, i call the read method and all values are read. But if I add the 3rd instance nothing is working anymore, neither the subscription nor the reading of the values. If I only run the 3rd instance alone everything is working again.
Why is this happening? Are there any limitations in the count of the mappings?
[UANamespace("XXXANamespaceXXX")]
[UAType]
public class MotionAxis : BindableBase
{
private Meta metaInfo = new Meta();
[UANode(BrowsePath = ".meta")]
public Meta MetaInfo { get { return metaInfo; } set { SetProperty(ref metaInfo, value); } }
private Control control = new Control();
[UANode(BrowsePath = ".control")]
public Control Control { get { return control; } set { SetProperty(ref control, value); } }
}
[UAType]
public class Control : BindableBase
{
# region private fields
private byte mode;
private double setPosition;
private double setVelocity;
private bool power;
private bool execute;
private bool reset;
private byte readDigitalInputs;
private int readAnalogInputs;
private double currentPosition;
private bool done;
private bool busy;
private bool error;
private uint errorCode;
private byte writeDigitalOutputs;
private ushort controlword;
private int targetPos;
private byte modeOfOperation;
private byte digitalIn;
private byte digitalOut;
private int analogIn;
private int targetVelocity;
private int profileVelocity;
private int actualVelocity;
private ushort statusword;
private int actualPos;
private short hwErrorcode;
private int univar0;
private int univar1;
#endregion
/// <summary>
/// Gets or sets the value of Mode.
/// </summary>
[UANode(BrowsePath = ".Mode"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte Mode
{
get { return mode; }
set { SetProperty(ref mode, value); }
}
/// <summary>
/// Gets or sets the value of SetPosition.
/// </summary>
[UANode(BrowsePath = ".Set_position"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public double SetPosition
{
get { return setPosition; }
set { SetProperty(ref setPosition, value); }
}
/// <summary>
/// Gets or sets the value of Set_velocity.
/// </summary>
[UANode(BrowsePath = ".Set_velocitiy"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public double SetVelocity
{
get { return setVelocity; }
set { SetProperty(ref setVelocity, value); }
}
/// <summary>
/// Gets or sets the value of Power.
/// </summary>
[UANode(BrowsePath = ".Power"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Power
{
get { return power; }
set { SetProperty(ref power, value); }
}
/// <summary>
/// Gets or sets the value of Execute.
/// </summary>
[UANode(BrowsePath = ".Execute"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Execute
{
get { return execute; }
set { SetProperty(ref execute, value); }
}
/// <summary>
/// Gets or sets the value of Reset.
/// </summary>
[UANode(BrowsePath = ".Reset"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Reset
{
get { return reset; }
set { SetProperty(ref reset, value); }
}
/// <summary>
/// Gets or sets the value of Read_digital_inputs.
/// </summary>
[UANode(BrowsePath = ".Read_digital_inputs"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte ReadDigitalInputs
{
get { return readDigitalInputs; }
set { SetProperty(ref readDigitalInputs, value); }
}
/// <summary>
/// Gets or sets the value of Read_analog_inputs.
/// </summary>
[UANode(BrowsePath = ".Read_analog_inputs"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int ReadAnalogInputs
{
get { return readAnalogInputs; }
set { SetProperty(ref readAnalogInputs, value); }
}
/// <summary>
/// Gets or sets the value of CurrentPosition.
/// </summary>
[UANode(BrowsePath = ".Current_position"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public double CurrentPosition
{
get { return currentPosition; }
set { SetProperty(ref currentPosition, value); }
}
/// <summary>
/// Gets or sets the value of done.
/// </summary>
[UANode(BrowsePath = ".Done"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Done
{
get { return done; }
set { SetProperty(ref done, value); }
}
/// <summary>
/// Gets or sets the value of Busy.
/// </summary>
[UANode(BrowsePath = ".Busy"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Busy
{
get { return busy; }
set { SetProperty(ref busy, value); }
}
/// <summary>
/// Gets or sets the value of Error.
/// </summary>
[UANode(BrowsePath = ".Error"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Error
{
get { return error; }
set { SetProperty(ref error, value); }
}
/// <summary>
/// Gets or sets the value of Error_code.
/// </summary>
[UANode(BrowsePath = ".Error_code"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public uint ErrorCode
{
get { return errorCode; }
set { SetProperty(ref errorCode, value); }
}
/// <summary>
/// Gets or sets the value of Write_digital_outputs.
/// </summary>
[UANode(BrowsePath = ".Write_digital_outputs"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte WriteDigitalOutputs
{
get { return writeDigitalOutputs; }
set { SetProperty(ref writeDigitalOutputs, value); }
}
/// <summary>
/// Gets or sets the value of Controlword.
/// </summary>
[UANode(BrowsePath = ".Controlword"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public ushort Controlword
{
get { return controlword; }
set { SetProperty(ref controlword, value); }
}
/// <summary>
/// Gets or sets the value of Target_pos.
/// </summary>
[UANode(BrowsePath = ".Target_pos"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int TargetPos
{
get { return targetPos; }
set { SetProperty(ref targetPos, value); }
}
/// <summary>
/// Gets or sets the value of Mode_of_operation.
/// </summary>
[UANode(BrowsePath = ".Mode_of_operation"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte ModeOfOperation
{
get { return modeOfOperation; }
set { SetProperty(ref modeOfOperation, value); }
}
/// <summary>
/// Gets or sets the value of Digital_in.
/// </summary>
[UANode(BrowsePath = ".Digital_in"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte DigitalIn
{
get { return digitalIn; }
set { SetProperty(ref digitalIn, value); }
}
/// <summary>
/// Gets or sets the value of Digital_out.
/// </summary>
[UANode(BrowsePath = ".Digital_out"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public byte DigitalOut
{
get { return digitalOut; }
set { SetProperty(ref digitalOut, value); }
}
/// <summary>
/// Gets or sets the value of Analog_in.
/// </summary>
[UANode(BrowsePath = ".Analog_in"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int AnalogIn
{
get { return analogIn; }
set { SetProperty(ref analogIn, value); }
}
/// <summary>
/// Gets or sets the value of Target_velocity.
/// </summary>
[UANode(BrowsePath = ".Target_velocity"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int TargetVelocity
{
get { return targetVelocity; }
set { SetProperty(ref targetVelocity, value); }
}
/// <summary>
/// Gets or sets the value of Profile_velocity.
/// </summary>
[UANode(BrowsePath = ".Profile_velocity"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int ProfileVelocity
{
get { return profileVelocity; }
set { SetProperty(ref profileVelocity, value); }
}
/// <summary>
/// Gets or sets the value of Actual_velocity.
/// </summary>
[UANode(BrowsePath = ".Actual_velocity"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int ActualVelocity
{
get { return actualVelocity; }
set { SetProperty(ref actualVelocity, value); }
}
/// <summary>
/// Gets or sets the value of Statusword.
/// </summary>
[UANode(BrowsePath = ".Statusword"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public ushort Statusword
{
get { return statusword; }
set { SetProperty(ref statusword, value); }
}
/// <summary>
/// Gets or sets the value of Actual_pos.
/// </summary>
[UANode(BrowsePath = ".Actual_pos"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int ActualPos
{
get { return actualPos; }
set { SetProperty(ref actualPos, value); }
}
/// <summary>
/// Gets or sets the value of Hw_errorcode.
/// </summary>
[UANode(BrowsePath = ".Hw_errorcode"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public short HwErrorcode
{
get { return hwErrorcode; }
set { SetProperty(ref hwErrorcode, value); }
}
/// <summary>
/// Gets or sets the value of Univar0.
/// </summary>
[UANode(BrowsePath = ".Univar0"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int Univar0
{
get { return univar0; }
set { SetProperty(ref univar0, value); }
}
/// <summary>
/// Gets or sets the value of Univar1.
/// </summary>
[UANode(BrowsePath = ".UniVar1"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public int Univar1
{
get { return univar1; }
set { SetProperty(ref univar1, value); }
}
}
[UAType]
public class Meta : BindableBase
{
#region private fields
private bool available;
private string fwVer;
private string paramVer;
private string fullName;
private string enable;
private string isEnabled;
#endregion
[UANode(BrowsePath = ".b_available"), UAData(Operations = UADataMappingOperations.ReadAndSubscribe, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public bool Available
{
get { return available; }
set { SetProperty(ref available, value); }
}
[UANode(BrowsePath = ".fw_ver"), UAData(Operations = UADataMappingOperations.ReadAndSubscribe, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public string FwVer
{
get { return fwVer; }
set { SetProperty(ref fwVer, value); }
}
[UANode(BrowsePath = ".param_ver"), UAData(Operations = UADataMappingOperations.ReadAndSubscribe, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public string ParamVer
{
get { return paramVer; }
set { SetProperty(ref paramVer, value); }
}
[UANode(BrowsePath = ".full_name"), UAData(Operations = UADataMappingOperations.ReadAndSubscribe, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public string FullName
{
get { return fullName; }
set { SetProperty(ref fullName, value); }
}
[UANode(BrowsePath = ".b_enable"), UAData(Operations = UADataMappingOperations.All, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public string Enable
{
get { return enable; }
set { SetProperty(ref enable, value); }
}
[UANode(BrowsePath = ".b_is_enabled"), UAData(Operations = UADataMappingOperations.ReadAndSubscribe, Kind = UADataMappingKind.Value), UAMonitoring(SamplingInterval = 20), UASubscription(PublishingInterval = 200)]
public string IsEnabled
{
get { return isEnabled; }
set { SetProperty(ref isEnabled, value); }
}
}
Please Log in or Create an account to join the conversation.