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!
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:
In reply to CuriousDuncan: