Hi
In past versions (at least v3.02) of Adv.HMI it was working to write to 2-dimensional arrays in Twincat plc by treating them as 1-dimensional in AdvancedHMI.
Like this:
Plc declaration:
controlcurve: ARRAY [0..99,0..1] OF REAL:= 200(0);
vb.net declaration:
Dim cc(200) As String
TwinCATCom1.Write(".controlcurve", cc, 200)
But now in version 3.99a application breaks with error "WriteData2b, not possible to convert the string 99,0..1 to type integer" (error message translated from Swedish so it's not the literally exact message)
Public Function Write(ByVal startAddress As String, ByVal dataToWrite() As String, ByVal numberOfElements As UInt16) As Integer
If Not DLL.ContainsKey(MyDLLInstance) OrElse DLL(MyDLLInstance) Is Nothing Then CreateDLLInstance()
Try
Dim Sym As MfgControl.AdvancedHMI.Drivers.TcAdsSymbolInfo
'Dim SymIndex As Integer
Try
Sym = GetSymbolInfo(startAddress)
Catch ex2 As Exception
System.Windows.Forms.MessageBox.Show("WriteData2b. " & ex2.Message)
Throw
End Try
With v3.99a the following is still working, but I don't like to rewrite the plc program.
Plc declaration:
controlcurve: ARRAY [0..199] OF REAL:= 200(0);
vb.net declaration:
Dim cc(200) As String
TwinCATCom1.Write(".controlcurve", cc, 200)
Can this be solved?
I could do it by looping through the array and write one element at time, but it's not elegant...
Best Regards
Mattias