Hi,
I’m writing a PC Application in Visual Studio 2005 and coding in VB.
I’m trying to implment a struct to represent a RECORD i have created in the IRC5 controller.
I have done this on the Flexpendant with no problems but I’m coding this project for a touch panel and i’m getting an unusual error for the line “Implements IRapidData”.
My code pretty much follows the example given in the RAB PC SDK - RapidDomain (user defined data) section.
I’ve implemented the FillFromString and ToString IRapidData methods but i get these 3 errors…
Error 1 Structure ‘LineData’ must implement ‘Function ToStructure() As DataNode’ for interface ‘ABB.Robotics.Controllers.RapidDomain.IRapidData’.
Error 2 Structure ‘LineData’ must implement ‘Sub Fill(root As DataNode)’ for interface ‘ABB.Robotics.Controllers.RapidDomain.IRapidData’.
Error 3 Structure ‘LineData’ must implement ‘Sub Fill(value As String)’ for interface ‘ABB.Robotics.Controllers.RapidDomain.IRapidData’.
I’ve tried writing the funtions and routines it says it requires but this just generates more errors ???
Here’s the code i have written…
Public Structure LineData
Implements IRapidData
Private data As UserDefined
Friend Sub New(ByVal rdt As RapidDataType)
data = New UserDefined(rdt)
End Sub
Private Property ProcessData() As UserDefined
Get
Return data
End Get
Set(ByVal Value As UserDefined)
data = Value
End Set
End Property
Public Property ProdData() As String
Get
Return ProcessData.Components(0).ToString()
End Get
Set(ByVal value As String)
ProcessData.Components(0) = New ABB.Robotics.Controllers.RapidDomain.String(value)
End Set
End Property
Public Property RollCount() As Single
Get
Dim res As Single = Convert.ToSingle(ProcessData.Components(1).ToString())
Return res
End Get
Set(ByVal value As Single)
ProcessData.Components(1).FillFromString(value.ToString())
End Set
End Property
Public Property LayerCount() As Single
Get
Dim res As Single = Convert.ToSingle(ProcessData.Components(2).ToString())
Return res
End Get
Set(ByVal value As Single)
ProcessData.Components(2).FillFromString(value.ToString())
End Set
End Property
Public Property LayerOffset() As Single
Get
Dim res As Single = Convert.ToSingle(ProcessData.Components(3).ToString())
Return res
End Get
Set(ByVal value As Single)
ProcessData.Components(3).FillFromString(value.ToString())
End Set
End Property
Public Sub FillFromString(ByVal newValue As String) Implements ABB.Robotics.Controllers.RapidDomain.IRapidData.FillFromString
ProcessData.FillFromString(newValue)
End Sub
Public Overrides Function ToString() As String Implements ABB.Robotics.Controllers.RapidDomain.IRapidData.ToString
Return ProcessData.ToString()
End Function
End Structure