I currently am doing something that i need a for loop with a 2 function block named LinuxSysCallAsync and WriteCSVData_Linear and when i do it the functions block don't have time to finish executing their code and i don't know how to do it here an example :
FOR i := 1 TO 5 BY 1 DO
cmd_LinuxSysCallAsync(xExecute:=TRUE,sCommand('touch txt.txt')
if cmd_LinuxSysCallAsync.xDone = TRUE THEN
do something
end_if
END_FOR
and it cannot by done
Can someone help me
Cordially
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
if the IF condition is not satisfied, it's simply skipped and the FOR loop continues with the next iteration. So you call cmd_LinuxSysCallAsync() in 5 successive scans.
Try to do in steps with a CASE, e.g.
hello,
I currently am doing something that i need a for loop with a 2 function block named LinuxSysCallAsync and WriteCSVData_Linear and when i do it the functions block don't have time to finish executing their code and i don't know how to do it here an example :
FOR i := 1 TO 5 BY 1 DO
cmd_LinuxSysCallAsync(xExecute:=TRUE,sCommand('touch txt.txt')
if cmd_LinuxSysCallAsync.xDone = TRUE THEN
do something
end_if
END_FOR
and it cannot by done
Can someone help me
Cordially
if the IF condition is not satisfied, it's simply skipped and the FOR loop continues with the next iteration. So you call cmd_LinuxSysCallAsync() in 5 successive scans.
Try to do in steps with a CASE, e.g.
Last edit: peterned 2022-02-25