Does anyone know how DIOCFGSV.VA tell me the names of DI and DO? I see " [MDIO_MAIN]NAME_NAME Storage: DRAM Access: RW : ARRAY[167] OF STRING[16]" but how does it relate to the digital input names and output names? Looks like it is jumbled up?

DIOCFGSV.VA
-
Robot Programmer -
March 25, 2021 at 1:39 PM -
Thread is Unresolved
-
-
Don't use that file. Use either ioconfig.dg or iostate.dg to get the names.
-
I'll try that next time. I did figure it out though. wrote this for Excel:
Code
Display MoreSub ReadDIOCFGSV() Dim F As FileDialog Dim TextLine As String, Ary As Integer Dim Idx As Integer, Valu As Integer, MyStr As String Dim Pt(512) As Integer, Pn(512) As Integer, Nm(512) As String, S As String Set F = Application.FileDialog(msoFileDialogOpen) F.AllowMultiSelect = True F.Filters.Add "DIOCFGSV", "*.VA", 1 F.FilterIndex = 1 F.InitialFileName = "DIO*" F.Show For Each FFile In F.SelectedItems 'files selected one at a time If InStr(FFile, "DIOCFGSV") Then 'Only if user picked the right file Open FFile For Input As #1 ' Open file. Do While Not EOF(1) ' Loop until end of file. Line Input #1, TextLine ' Read line into variable. If Len(TextLine) > 8 Then 'Not an empty line Idx = Val(Mid(TextLine, 4)) Valu = Val(Mid(TextLine, InStr(TextLine, "=") + 1)) MyStr = Mid(TextLine, InStr(TextLine, "= '") + 3) MyStr = Left(MyStr, Len(MyStr) - 1) Else Ary = 0 ' Empty? don't process this line End If Select Case Ary ' store value in an array Case 1: Pt(Idx) = Valu Case 2: Pn(Idx) = Valu Case 3: Nm(Idx) = MyStr Case 4: Nm(Idx) = Nm(Idx) & MyStr End Select ' New array line? If InStr(TextLine, "[MDIO_MAIN]NAME_LOG_PT") Then Ary = 1 If InStr(TextLine, "[MDIO_MAIN]NAME_LOG_PN") Then Ary = 2 If InStr(TextLine, "[MDIO_MAIN]NAME_NAME ") Then Ary = 3 If InStr(TextLine, "[MDIO_MAIN]NAME_NAME2") Then Ary = 4 Loop Close #1 'done with loop For t = 1 To 511 ' Store in sheet If Pt(t) = 1 Or Pt(t) = 2 Then ' Only DI and DO's ActiveSheet.Cells(Pn(t), Pt(t)) = Nm(t) End If Next End If Next End Sub
-