09-15-2023 09:09 AM
In the below control, the "Channels" control is an input of double and the "Task Channels" is an input of string and also in a different format to communicate with the VIs I'm using. I am trying to eliminate having two separate controls for this input as they are linearly related besides a formatting issue. Is there a way to convert it in the following format below:
DBL STRING
4 = 0:3
3 = 0:2
2 = 0:1
1 = 0
The part that seems like it might be complicated with what I am doing is that a value of 1 eliminates the colon and second digit.
Thank you for any help.
Solved! Go to Solution.
09-15-2023 10:42 AM
A simple lookup table would probably be the easiest. You have an array of the string values and you use Index Array with the Channels value as the index.
09-15-2023 11:06 AM - edited 09-15-2023 11:07 AM
Try this
(note, you probably want to handle the case where the user passes a "0" to the Channels input)
09-15-2023 11:44 AM
Appreciate the help, this is perfect for my input condition. In response to the control for a "0" input, it is not necessary because the VI for the DAC I'm using will throw an error with no channels selected and fail to run anyway.