Hello,
I have created a module that I am trying to use to store recipe parameters in arrays, and then mapping elements of the arrays into the tuning parameters and the min/max value into a different Equipment module.
Below is my code for an action block
I have 2 while loops that are writing to tuning parameters for a PCSD EM TP_VALUE, TP_MIN, and TP_MAX from an array that I have set up. However, what I’m noticing is that it is executing the whole code in 1 scan and only updating the value for the final TP055. The while loop is incrementing the index, but are not writing the TP_TARGET, TP_TARGET_MIN, and TP_TARGET_MAX for every iteration of i, only the final iterarion. Any idea how to make this work?
i := 1;WHILE i < 10 DO'^/TP_VALUE_INDEX.CV' := "/TP00" + i + "_VALUE.CV";'^/TP_MIN_INDEX.CV' := "/TP00" + i + "_MIN.CV";'^/TP_MAX_INDEX.CV' := "/TP00" + i + "_MAX.CV";'^/TP_TARGET.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_VALUE_INDEX.CV';'^/TP_TARGET_MIN.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_MIN_INDEX.CV';'^/TP_TARGET_MAX.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_MAX_INDEX.CV';IF '^/TP_TARGET.CST' = 0 AND '^/TP_TARGET.$REF' = '^/FERMENTER_INDEX.CV' + '^/TP_VALUE_INDEX.CV' THEN'^/TP_TARGET.CV' := '^/DNA_T_PARAM'[i][1];'^/TP_TARGET_MIN.CV' := '^/DNA_T_LIM'[i][1];'^/TP_TARGET_MAX.CV' := '^/DNA_T_LIM'[i][2];i := i + 1;ENDIF;END_WHILE;WHILE i >= 10 AND i <= 55 DO'^/TP_VALUE_INDEX.CV' := "/TP0" + i + "_VALUE.CV";'^/TP_MIN_INDEX.CV' := "/TP0" + i + "_MIN.CV";'^/TP_MAX_INDEX.CV' := "/TP0" + i + "_MAX.CV";'^/TP_TARGET.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_VALUE_INDEX.CV';'^/TP_TARGET_MIN.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_MIN_INDEX.CV';'^/TP_TARGET_MAX.$REF' := '^/FERMENTER_INDEX.CV' + '^/TP_MAX_INDEX.CV';IF '^/TP_TARGET.CST' = 0 AND '^/TP_TARGET.$REF' = '^/FERMENTER_INDEX.CV' + '^/TP_VALUE_INDEX.CV' THEN'^/TP_TARGET.CV' := '^/DNA_T_PARAM'[i][1];'^/TP_TARGET_MIN.CV' := '^/DNA_T_LIM'[i][1];'^/TP_TARGET_MAX.CV' := '^/DNA_T_LIM'[i][2];i := i + 1;ENDIF;END_WHILE;'IN_D.CV' := 0;
In reply to Matt Forbis:
In reply to vmvmhatre:
In reply to gnvsrikanth1357:
In reply to rhamlin:
Andre Dicaire
In reply to Andre Dicaire: