Windows batch harness + extensive IT README for on-site Mitsubishi CNC testing. Covers connect/invia/scarica/validator/offset/param scenarios. Documents C1-C8 criticità found in code review: - path mapping mismatch (download /PRG/<int> vs upload relative <path>/<name>) - Standardize leading \n may trip validator first-line gate - hardcoded /PRG/ ProgramDirectory, no CLI override - Int16 -path limit, ASCII-only FTP, plaintext credentials Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
30 lines
1.2 KiB
Batchfile
30 lines
1.2 KiB
Batchfile
@echo off
|
|
REM ============================================================
|
|
REM T02 - SCARICO programma dal CNC
|
|
REM Legge /PRG/%PROGNUM% e salva in results\downloaded.txt.
|
|
REM Atteso: Errore:0 se il file /PRG/%PROGNUM% esiste sul CNC.
|
|
REM CRITICITA C1: -path accetta solo interi -> legge SEMPRE
|
|
REM /PRG/<intero>. Se i programmi sul CNC hanno nomi tipo "O1234"
|
|
REM o lettere, NON sono indirizzabili da CLI. Fare prima la
|
|
REM ricognizione FTP manuale (vedi README sezione 4).
|
|
REM CRITICITA C5: il file salvato NON e' NC grezzo ma formato
|
|
REM wrapper "program:{...} tooloffsetdata:{} workzerooffset:{}".
|
|
REM ============================================================
|
|
setlocal
|
|
call "%~dp0config.bat"
|
|
if not exist "%RESULTS%" mkdir "%RESULTS%"
|
|
set LOG=%RESULTS%\t02_scarica.log
|
|
set OUT=%RESULTS%\downloaded.txt
|
|
|
|
echo === T02 SCARICO === > "%LOG%"
|
|
"%EXE%" -manufacturer=mitsubishi -azione=Scarica -ip=%IP% -porta=%PORT% -username=%USER% -password=%PASS% -path=%PROGNUM% -pathprogramma=%OUT% >> "%LOG%" 2>&1
|
|
echo EXITCODE=%ERRORLEVEL% >> "%LOG%"
|
|
echo EXITCODE=%ERRORLEVEL%
|
|
echo File scaricato: %OUT%
|
|
echo Log: %LOG%
|
|
type "%LOG%"
|
|
if exist "%OUT%" (
|
|
echo --- CONTENUTO SCARICATO ---
|
|
type "%OUT%"
|
|
)
|
|
endlocal
|