RobotStudio event

Error while download [WebWare SDK]

Options

Hi!

I got a strange behavior of the SDK @ the moment:

- VB6.0
- Webware SDK 3.2
- S4C+ machine

I do s4DIR with the machine like this:

Public Function abb_DIR(ByVal device, ByVal path, ByRef txtOutPut As Object) As Boolean
 Dim i_Result As Integer
 Dim l_ResultID As Long
 Dim i_ResultSpec As Integer
 Dim dTimeRead As Date
 Dim i_Count As Integer
 i_ResultSpec = cABB_ResultSpec_WaitForCompletition
 i_Result = abb_Helper.S4Dir(device, path, 0, i_ResultSpec, l_ResultID)
 If Not txtOutPut Is Nothing Then txtOutPut.Text = "S4Dir:->" & i_Result & ":" & abb_Helper.ErrorMessage(i_Result)
 If i_Result = 0 Then
  If Not txtOutPut Is Nothing Then
   For i_Count = 0 To abb_Helper.DirListCount - 1
    txtOutPut = txtOutPut & vbCrLf & "[" & path & abb_Helper.DirList(i_Count) & cABB_PathSeparator & "]"
   Next
   For i_Count = 0 To abb_Helper.FileListCount - 1
    txtOutPut = txtOutPut & vbCrLf & abb_Helper.FileList(i_Count)
   Next
  End If
 End If
 abb_DIR = i_Result = 0
End Function

The path i enter is the following: "/hd0a/"  path is "/", like the helper tells me to.

Then i get the following results:

[/BIN/]
[/BACKUP/]
[/temp/]
[/3HAC6811-1.6/]
[/EHMANN007/]
[/MODULE/]
[/MICHA/]
[/Labor-S4C+/]
BOOTROM.SYS
mc.cfg
system.dir
ctrlused
ctrl.bin
TEST1126.prg
PLEUEL_OBERT
logfile1.log
PLEUEL_UT_BR

next i try to download all stuff like this:


Public Const cABB_ResultSpec_WaitForCompletition = 3
Public Const cABB_PathSeparator = "/"
Public Const cABB_WINPathSeparator = ""

Public Function ABB_FullDownload(ByVal deviceS, ByVal pathS, ByVal deviceT, ByVal pathT, ByRef txtOutPut As Object) As Boolean
 'Schachtelung beginnen
 If Not txtOutPut Is Nothing Then txtOutPut = "Full Download started"
 ABB_FullDownload = ABB_DownloadDIR(deviceS, pathS, deviceT, pathT, txtOutPut)
End Function

Private Function ABB_DownloadDIR(ByVal deviceS, ByVal pathS, ByVal deviceT, ByVal pathT, ByRef txtOutPut As Object) As Boolean
 Dim i_Result As Integer
 Dim l_ResultID As Long
 Dim i_ResultSpec As Integer
 Dim s_DirTemp() As String
 Dim i_DirCount As Integer
 Dim i_FileCount As Integer
 'zuerst DIR
 Debug.Print "Call:", deviceS, pathS, deviceT, pathT
 If Not fso.FolderExists(deviceT & cABB_WINPathSeparator & pathT) Then
  CreateDir deviceT & cABB_WINPathSeparator & pathT
 End If
 txtOutPut = txtOutPut & vbCrLf & "Download Folder [" & deviceS & pathS & "]"
 i_ResultSpec = cABB_ResultSpec_WaitForCompletition
 i_Result = abb_Helper.S4Dir(deviceS, pathS, 0, i_ResultSpec, l_ResultID)
 If i_Result <> 0 Then txtOutPut = txtOutPut & vbCrLf & "S4DIR:->" & i_Result & ":" & abb_Helper.ErrorMessage(i_Result): ABB_DownloadDIR = False: Exit Function
 'lokal alles merken
 ReDim s_DirTemp(0 To abb_Helper.DirListCount)
 For i_DirCount = 0 To abb_Helper.DirListCount - 1
  s_DirTemp(i_DirCount) = abb_Helper.DirList(i_DirCount)
 Next
 'Dateien laden
 For i_FileCount = 0 To abb_Helper.FileListCount - 1
  i_ResultSpec = cABB_ResultSpec_WaitForCompletition
  If Right(pathS, 1) <> cABB_PathSeparator Then pathS = pathS & cABB_PathSeparator
  i_Result = abb_Helper.S4FileCopy(deviceS, _
                                   pathS & abb_Helper.FileList(i_FileCount), _
                                   deviceT, _
                                   pathT & cABB_WINPathSeparator & abb_Helper.FileList(i_FileCount), _
                                   i_ResultSpec, l_ResultID)
  If i_Result <> 0 Then
   If Not txtOutPut Is Nothing Then txtOutPut = txtOutPut & vbCrLf & "S4FileCopy:->" & i_Result & ":" & abb_Helper.ErrorMessage(i_Result)
  End If
  If i_Result = 0 Then
   If Not txtOutPut Is Nothing Then
    txtOutPut = txtOutPut & vbCrLf & "Datei kopiert von """ & _
                                      deviceS & _
                                      pathS & abb_Helper.FileList(i_FileCount) & _
                                      """ nach """ & _
                                      deviceT & cABB_WINPathSeparator & _
                                      pathT & cABB_WINPathSeparator & abb_Helper.FileList(i_FileCount) & """"""
   End If
  Else
   'abbruch!
Debug.Print "abb_Helper.S4FileCopy(" & deviceS, _
                                   pathS & abb_Helper.FileList(i_FileCount), _
                                   deviceT, _
                                   pathT & cABB_WINPathSeparator & abb_Helper.FileList(i_FileCount), _
                                   i_ResultSpec, l_ResultID & ")"
   ABB_DownloadDIR = False
   Exit Function
  End If
 Next
 'Unterverzeichnisse abarbeiten
 For i_DirCount = 1 To abb_Helper.DirListCount - 1
  If pathS = cABB_PathSeparator Then pathS = ""
  If Not ABB_DownloadDIR(deviceS, _
                         pathS & cABB_PathSeparator & s_DirTemp(i_DirCount), _
                         deviceT, _
                         pathT & cABB_WINPathSeparator & s_DirTemp(i_DirCount), _
                         txtOutPut) Then
   ABB_DownloadDIR = False
   Exit Function
  End If
 Next
End Function

The Results are

Full Download started
Download Folder [/hd0a//]
Datei kopiert von "/hd0a//BOOTROM.SYS" nach "c:TempBOOTROM.SYS""
Datei kopiert von "/hd0a//mc.cfg" nach "c:Tempmc.cfg""
Datei kopiert von "/hd0a//system.dir" nach "c:Tempsystem.dir""
Datei kopiert von "/hd0a//ctrlused" nach "c:Tempctrlused""
Datei kopiert von "/hd0a//ctrl.bin" nach "c:Tempctrl.bin""
Datei kopiert von "/hd0a//TEST1126.prg" nach "c:TempTEST1126.prg""
S4FileCopy:->-3102:No such path

then i got a error with the following S4Download:

abb_Helper.S4FileCopy("/hd0a/"," /PLEUEL_OBERT", "c:","TempPLEUEL_OBERT",3,11)

the error i get is: -3102

But the file exists on the robot.

Am I wrong with the code?

thx

M

--------
01000111

Comments

  • RussD
    Options

    It looks like you are trying to copy a long (not 8.3) file name. This will fail due to limitations in the RAP protocol. You must either enable the FTP interface in your robot profile or rename any long file names.

     

    Russell Drown
  • [QUOTE=RussD]

    It looks like you are trying to copy a long (not 8.3) file name. This will fail due to limitations in the RAP protocol. You must either enable the FTP interface in your robot profile or rename any long file names.

     

    [/QUOTE]

    Is it possible to download the file in 8.3 format (like using progra~1 for programms / like windows does?) I am not sure, if I can rename all long file names since the workers are used to them. If i enable the ftp can I use RAP parallel?

    --------
    01000111
  • RussD
    Options

    Enabling the FTP interface only changes the way that Interlink moves files from one device to another; it does not disable Interlink's ability to access all of the other RAP services, i.e. data access, I/O, etc.

    There is no mechanism for aliasing the file names like you described (Progra~1...);the exact file name must be used.

    Russell Drown