• Not Answered

DeltaV Live: Update entered datalink value


Hello,

I’m currently working with a datalink named "DataLink1", which is connected to the MINUTE parameter (Integer type). I also have a MINUTE_STR parameter (String type), which is updated through logic in the action block to add a leading zero when the entered value is less than 10—this helps display minutes in a double-digit format.

The challenge I’m facing is that when a value is entered through Live, it only shows as a single digit because the datalink is tied to the integer parameter, and leading zeros are ignored. I would like to display the formatted string value (MINUTE_STR) without directly referencing it in the datalink, but still using the value entered through the datalink.

Unfortunately, I can't use MINUTE_STR directly for user input, as it’s part of a larger logic that constructs a time string used elsewhere. I’m also trying to keep all of this logic within DeltaV Live.

Could you please let me know if there’s a way to achieve this using a datalink? I’ve managed to make it work using a Text Editor, but I’m hoping there’s a solution that works with datalinks as well.

Thank you in advance for your help!

4 Replies

  • Try this on a datalink: String(DLSYS[ModulePath]).padStart(2,'0') or DLSYS[MODULEPATH.STR].padStart(2,'0')

    This should add a leading 0 if the length is < 2 chars.

  • In reply to Matt Stoner:

    Thank you for the suggestion, Matt. I tried this approach but was not able to write anything to the parameter.

    Here’s what I did: I created a datalink of string type and entered the expression String(DLSYS[ModulePath]).padStart(2, '0'). When I switched to run mode, it allowed me to enter a value, but it did not update the parameter value.
  • In reply to CuriousDuncan:

    so you want to be able to change the value but include the added 0? You are using the data write option of the datalink?

    you may not be able to do it this way and may have use a variable to get this done and reference the variable on the datalink. Unfortunately I don't have time right now to test this out with my other activities.
  • In reply to Matt Stoner:

    In short, the entry on the datalink should be tied to the integer parameter, but the displayed value on the datalink will come from the string parameter, since it is already formatted. So, there’s no need to format the value entered by the user.

    That said, I’ll go ahead with the text entry box since it’s working as expected. Thanks, Matt, for giving it some thought.