Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Do Loop and Scan Conflict


zms Jun 30, 2020 05:28 PM

HI CSI folks!

Hope you are doing well!

I have a project using a CR6 that will turn various pumps on and off depending on measurement criteria

For example, I need to leave some pumps on indefinitely unless certain measurement criteria are met, and then I need to turn the pumps off: 

%%%%%%

BeginProg

Scan

'Take Measurements

Do

   'all pumps on (i.e. Portset(C1,1))

Loop Until

   ' condition 1 is met

   ' turn pumps off (i.e. Portset (C1,0))

OR

   ' condition 2 is met

   ' turn pumps off

OR

   ' condition 3 is met

   ' turn pumps off

ExitDo

NextScan

EndProg

%%%%%%%%

Questions: 

1. In this format, I"m assuming portset will stay high assuming conditions are not met.  The pumps will stay on.  

2. Will the program exit the do loop and perform a next scan if conditions are not met and if an exitdo is not specified?  Is an Exitdo required to reach 'nextscan'? 

3. In this do loop format, will the pumps come back on (portset =high) when measurement conditions fall back within operational thresholds? 

I appreciate your help - please let me know if additional/different syntax may be needed to execute this automation.  

​thanks!

zach

Log in or register to post/reply in the forum.