Funzionamento statements while wend – Support Elsist https://support.elsist.biz/forums/topic/funzionamento-statements-while-wend/feed/ Fri, 30 Oct 2026 09:03:50 +0000 https://bbpress.org/?v=2.6.20 it-IT https://support.elsist.biz/forums/topic/funzionamento-statements-while-wend/#post-59463 Funzionamento statements while wend https://support.elsist.biz/forums/topic/funzionamento-statements-while-wend/#post-59463 Tue, 06 Apr 2021 06:58:18 +0000 av 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)?

]]>
https://support.elsist.biz/forums/topic/funzionamento-statements-while-wend/#post-59512 Rispondi a: Funzionamento statements while wend https://support.elsist.biz/forums/topic/funzionamento-statements-while-wend/#post-59512 Tue, 06 Apr 2021 07:00:08 +0000 Sergio Bertana Ho verificato la macro e non ho riscontrato problemi di funzionalità.

]]>