• Not Answered

DeltaV Live parameter iteration.

Hello everyone.

I want to read or write to Layout parameter concatenated from text and variable.

I have parameters Lyt.EM1CMD up to Lyt.EM20CMD.

I know it is incorreect but I would like to do something similar to this ("i" is variable):

('Lyt.EM' + i +'CMD') = 1

Is it even possible in DeltaV Live TypeScript?

3 Replies

  • Yes it is possible!

    I took a button and put the below script to read the EM1CMD variable (in my case a string) and updated the Button Label with the value

    const i:number = 1; //Set the start value
    Dsp.Button1.Label = (Lyt as any)['EM' + i + 'CMD']; //Update the button text with EMxCMD value

    Then I took another button and put the below script to update layout variable with different text

    const i:number = 1; //Set the start value
    (Lyt as any)['EM'+i+'CMD'] = 'Command ' + (i + 1); //Update the Variable EMxCMD Text

  • In reply to Matt Stoner:

    Matt, you're a star!
    It works perfect.
    I really appreciate your help.
  • In reply to Jacek:

    No problem, if the variable was on display you would use (Dsp as any) or if it was a variable on an object on the display it would be (Dsp.ObjPathName as any)