Loop expression HELP

Hi All

I am having an issue at the moment with a loop function.
Background
We are using a CB3 UR10 cobot and a Sensopart vision camera using the Visor URCAP for comms.

The Cobot send an expression to the camera to load a particular job. The camera sends a response back to the cobot whether the job has been successfully loaded of failed to load.
I need to add a loop that is the camera sends a failed to load job expression then the cobot resends the request until the job had loaded successfully.

Cobot to camera expression - CJB003 (example)
Camera successful load expression - CJBPT003
Camera failed to load job expression - CJBFT003

If I use the ‘Loop when expression is True’
str_find(visor _response,‘‘F’’)>0 The loop does not work
str_find(visor _response,‘‘P’’)>0 The loop does work when a job load successful expression is given.

Any help would be appreciated.

what about something around the lines:

visor _response = ""
fail_cnt = 0           #nr. of times the system has failed

while str_find(visor _response,‘‘P’’)>0:
     # send job nr.
     visor _response = # receive job nr. response

     # if it fails too many times, maybe the program does not exist?
     if str_find(visor _response,‘‘P’’)>0:
           fail_cnt = fail_cnt+1
     end

     if fail_cnt > 10:
           break
     end
 
     sleep(0.1)    
end

if fail_cnt > 10:
     # pop-up message here:
     # "Failed to load job too many times
     # please review camera connection and camera job"'
end

Hi,

unfortunately, we can not monitor this forum continously. If you have any questions to our products, please contact
support@sensopart.com.

Thank you and best regards
Klaus

Klaus Berdel
Product Management Vision
SensoPart Industriesensorik GmbH