After puttering around for a while with that, I tried a different method.
I exported the project and converted it to a text file.
Then I edited out the unecessary parts.
Then I renamed it as a .txt file so that I could access it with VBE.NET
The following is the code that I tried, followed by a comment which shows what the .txt file looks like:
[code]Imports System
Imports System.IO
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ReadFromFile()
End Sub
Private Sub ReadFromFile()
Dim letter, word, line, WholeLine As String
Dim LetterCount, WordCount, LineCount, TimingCount As Integer
Dim position(LineCount, WordCount)
Dim timing(LineCount, TimingCount)
Using sr As StreamReader = New StreamReader(“C:\ServoPositionsAndTiming.txt”)
Do
LineCount += 1
LetterCount = 0
WordCount = 0
TimingCount = 0
line = Nothing
WholeLine = sr.ReadLine()
Do
LetterCount += 1
letter = sr.Read()
line &= letter
If letter <> “;” Then
word &= letter
End If
If letter = “;” Then
WordCount += 1
If WordCount > LineCount * 38 And WordCount < LineCount * 38 + 20 Then
position(LineCount, WordCount) = CSng(word)
word = Nothing
TextBox1.Text &= position(LineCount, WordCount)
End If
If WordCount > LineCount * 38 + 19 And WordCount < LineCount * 38 + 39 Then
TimingCount = WordCount - 19
timing(LineCount, TimingCount) = CSng(word)
word = Nothing
TextBox1.Text &= timing(LineCount, TimingCount)
End If
End If
Loop Until letter = line
Loop Until letter = “z”
sr.Close()
End Using
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
End Class
‘’’’’'This is exactly what the file that I’m reading is, except for the apostrophe’s, of course:
‘’’’’'PIN0;PIN1;PIN2;PIN3;PIN4;PIN12;PIN13;PIN14;PIN15;PIN16;PIN17;PIN18;PIN19;PIN20;PIN24;PIN28;PIN29;PIN30;PIN31;T0;T1;T2;T3;T4;T12;T13;T14;T15;T16;T17;T18;T19;T20;T24;T28;T29;T30;T31
‘’’’’’-10.8;7.5;-18;26.129;-28.286;90;3.12;90;38.4;26.182;3;24.646;-13.2;38;6.429;-90;-11.793;90;-49.355;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510
‘’’’’’-10.8;7.5;-18;26.129;-28.286;90;3.12;90;38.4;26.182;3;24.646;-13.2;38;-69.686;1.277;-46.924;90;24.039;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510
‘’’’’’-10.8;7.5;-18;26.129;-28.286;90;3.12;90;38.4;26.182;3;24.646;-13.2;38;6.429;-90;-11.793;90;-49.355;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510
‘’’’’’-10.8;7.5;-18;26.129;-28.286;-3.84;3.361;90;6.36;26.182;3;24.646;-13.2;38;77.271;-90;-11.421;90;-49.355;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510;510
‘’’’’'z[/code]
Apparently, I messed something up, because when I debug, the Form never loads.
So, something up there is infinitely executing.
Does anyone know a better way to use the Sequencer’s positioning data, without having to go and edit every single one?