Re: Versuche mehrfach durchlaufen lassen
Posted: Wed 14. Jan 2009, 13:02
Hallo,
ich bekomme die automatische Auswertung einfach nicht hin. Thomas hat mir schon deutlich geholfen, aber so richtig will es noch nicht.
Ich poste hier einfach mal meinen Quellcode der mir leider nicht das gewünschte Ergebnis liefert. Vielleicht habt ihr noch einen Tipp.
Der Quellcode kann in der Deklaration noch ein paar Variablen zu viel halten, weil dies nur der vereinfachte Ausschnitt ist, welcher mit fixen Dateien arbeitet.
Ziel dieses Skriptes ist es, die durch das Netz ermittelten Ergebnisse in die Datei versuch.csv einzutragen.
Allerdings bekomme ich bisher nur die Inputdaten eingetragen.
--------------------------------------------------------------------------------------------------------------------------------------------
' static variables
Dim sInCount As Long
Dim sOutCount As Long
Dim sChosenLesson As Integer
Dim sNetFileName As String
Dim sNetCount As Long
Dim sLessonName As String
Private Sub CheckDllError(result As Long)
If result <> 0 Then
HandleDllError
End If
End Sub
Private Sub HandleDllError()
MsgBox ("Dll reported error! The program will terminate!")
Unload Me
End Sub
Private Sub ButRun_Click()
Dim maxCount As Long
Dim inIdx As Long
Dim i As Long
Dim ret As Long
Dim OutAct As Double
Dim InAct As Double
Dim result As Long
Dim lessonCount As Long
Dim netIdx As Long
Dim Lesson As Long
Dim ValueSol As Double
Dim Name As String
'Netzdummy laden
result = MB_LoadNet("Y:\Dissertation\MemBrain\Versuch_1S_3N.mbn" + vbNullChar)
CheckDllError (result)
sNetFileName = "Y:\Dissertation\MemBrain\Versuch_1S_3N.mbn"
'result = MB_LoadNet(sNetFileName + vbNullChar)
'Lessondummy laden
result = MB_LoadLesson("Y:\Dissertation\MemBrain\validierung.mbl" + vbNullChar)
CheckDllError (result)
Range("N14") = MB_GetLessonSize
maxCount = MB_GetLessonSize
sChosenLesson = 0
result = MB_SelectLesson(sChosenLesson)
CheckDllError (result)
lessonCount = MB_GetLessonCount
sInCount = MB_GetInputCount
sOutCount = MB_GetOutputCount
If (sOutCount < 1) Then
MsgBox "The loaded net does not have any outputs!"
Exit Sub
End If
If (sNetFileName = "") Then
MsgBox "No net loaded!"
Exit Sub
End If
'result = MB_ThinkLesson()
'CheckDllError (result)
'inIdx = MB_GetLessonCount()
MB_SetLessonCount (2) 'es soll zwei Lesson geben, den eingeladenen und den neu errechneten
MB_SelectLesson (1) ' Lesson eins wird ausgewählt
MB_SetRecordingType (1)
result = MB_StartRecording(1, 1)
CheckDllError (result)
'MB_EnableLessonOutData (1)
MB_ThinkLesson
MB_StopRecording
inIdx = MB_GetSelectedLesson()
MB_SelectLesson (1)
Name = "C:\Dokumente und Einstellungen\Desktop\versuch.csv"
result = MB_ExportLessonRaw(Name, maxCount)
CheckDllError (result)
'Öffnet die Versuch.csv Datei um zu prüfen ob die richtigen Daten eingetragen wurden
'Workbooks.Open "C:\Dokumente und Einstellungen\Desktop\versuch.csv"
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------
Gruß
Bastian
ich bekomme die automatische Auswertung einfach nicht hin. Thomas hat mir schon deutlich geholfen, aber so richtig will es noch nicht.
Ich poste hier einfach mal meinen Quellcode der mir leider nicht das gewünschte Ergebnis liefert. Vielleicht habt ihr noch einen Tipp.
Der Quellcode kann in der Deklaration noch ein paar Variablen zu viel halten, weil dies nur der vereinfachte Ausschnitt ist, welcher mit fixen Dateien arbeitet.
Ziel dieses Skriptes ist es, die durch das Netz ermittelten Ergebnisse in die Datei versuch.csv einzutragen.
Allerdings bekomme ich bisher nur die Inputdaten eingetragen.
--------------------------------------------------------------------------------------------------------------------------------------------
' static variables
Dim sInCount As Long
Dim sOutCount As Long
Dim sChosenLesson As Integer
Dim sNetFileName As String
Dim sNetCount As Long
Dim sLessonName As String
Private Sub CheckDllError(result As Long)
If result <> 0 Then
HandleDllError
End If
End Sub
Private Sub HandleDllError()
MsgBox ("Dll reported error! The program will terminate!")
Unload Me
End Sub
Private Sub ButRun_Click()
Dim maxCount As Long
Dim inIdx As Long
Dim i As Long
Dim ret As Long
Dim OutAct As Double
Dim InAct As Double
Dim result As Long
Dim lessonCount As Long
Dim netIdx As Long
Dim Lesson As Long
Dim ValueSol As Double
Dim Name As String
'Netzdummy laden
result = MB_LoadNet("Y:\Dissertation\MemBrain\Versuch_1S_3N.mbn" + vbNullChar)
CheckDllError (result)
sNetFileName = "Y:\Dissertation\MemBrain\Versuch_1S_3N.mbn"
'result = MB_LoadNet(sNetFileName + vbNullChar)
'Lessondummy laden
result = MB_LoadLesson("Y:\Dissertation\MemBrain\validierung.mbl" + vbNullChar)
CheckDllError (result)
Range("N14") = MB_GetLessonSize
maxCount = MB_GetLessonSize
sChosenLesson = 0
result = MB_SelectLesson(sChosenLesson)
CheckDllError (result)
lessonCount = MB_GetLessonCount
sInCount = MB_GetInputCount
sOutCount = MB_GetOutputCount
If (sOutCount < 1) Then
MsgBox "The loaded net does not have any outputs!"
Exit Sub
End If
If (sNetFileName = "") Then
MsgBox "No net loaded!"
Exit Sub
End If
'result = MB_ThinkLesson()
'CheckDllError (result)
'inIdx = MB_GetLessonCount()
MB_SetLessonCount (2) 'es soll zwei Lesson geben, den eingeladenen und den neu errechneten
MB_SelectLesson (1) ' Lesson eins wird ausgewählt
MB_SetRecordingType (1)
result = MB_StartRecording(1, 1)
CheckDllError (result)
'MB_EnableLessonOutData (1)
MB_ThinkLesson
MB_StopRecording
inIdx = MB_GetSelectedLesson()
MB_SelectLesson (1)
Name = "C:\Dokumente und Einstellungen\Desktop\versuch.csv"
result = MB_ExportLessonRaw(Name, maxCount)
CheckDllError (result)
'Öffnet die Versuch.csv Datei um zu prüfen ob die richtigen Daten eingetragen wurden
'Workbooks.Open "C:\Dokumente und Einstellungen\Desktop\versuch.csv"
End Sub
--------------------------------------------------------------------------------------------------------------------------------------------
Gruß
Bastian