Ho generato uno script per esportare il database ricette nella USB disk 1. La LW250 è la word di comando e la LW252 è la word del risultato.
unsigned int printCycleIndex, result_int
unsigned short EXPORTrcpCmd = 3 //export and overwrite
unsigned short intZero = 0
bool while_cond = false
SetData(intZero, "VR-HMI", LW, 252, 1) //Clear result
SetData(EXPORTrcpCmd, "VR-HMI", LW, 250, 1) //export and overwrite
result_int = 0
while_cond = false
while not(while_cond)
if result_int == 0 then
GetData(result_int, "VR-HMI", LW, 252, 1)
end if
if result_int <> 0 then
while_cond = true
end if
wend
Ho inserito il while per attendere un esito diverso da 0 nel risultato. In realtà la macro va avanti e appoggiando il valore di “result_int” ho 0. Non dovrebbe restare dentro al while fino a che il GetData non restituisce un valore diverso da 0 (LW252 <>0)?