using a string in a command line

Hi folks.

Quick question:

I have this script in a CALC block. I have two identical productions lines, with the same equipement name, except for the line number: 2211 and 2212.

Now, I have the operator select which line he's configuring.

Here's the sigle line example:

   '//2211-YV03/DC1/SP_D.CV' := 1; 
   '//2211-YV04/DC1/SP_D.CV' := 1;
   '//2211-YV06/DC1/SP_D.CV' := 1;

I would like to modify it for something like that:

if LINE_SEL = 1 then
 LINE := "2211";
else
 LINE := "2212";
endif;

   '//LINE-YV03/DC1/SP_D.CV' := 1; 
   '//LINE-YV04/DC1/SP_D.CV' := 1;
   '//LINE-YV06/DC1/SP_D.CV' := 1;

OF course, this doesn't work, as well as the two dozen other possibilities I've tried.

Any idea how to achieve this? Rather new to DeltaV, going to my training next week.

Regards,

Pierre.

  • In reply to Steve Elves:

     You might also want to look at creating an SFC or State Driven module instead of burying all of this in a calc block with dynamic referencing.Either case will be much easier to troubleshoot in the future.  (Especially if you need to do this for 70 pieces of equipment for each line.)