07-06-2020 10:05 AM
Hello, I am trying to control a keysight DC power supply and o need to send a sine wave, so the problem is, when I use "concatenate string function" inside the loop, it looks like doesn't work. The same structure otside works, but inside just print the first word "VOLT" as you can see in "concatenated string 2", instead in "concatenate string" it is well printed and works to control the DC power supply. How can I solve the problem?
07-06-2020 11:06 AM
You have an array of values you are converting and then concatenating that into a string. When you concatenate an array of strings, it assumes each element of the array is a line of the string. So if you drag your indicator to show more lines, you will see this data. Use a FOR loop to iterate over your values and do the string building inside of the loop to then send.
As an aside, I much prefer to use Format Into String to build up these commands instead of the Concatenate String because it becomes simpler to read, especially when you get multiple strings going in. In this case, you can set the format string to "VOLT %0.3f,(@1)" and wire the numeric value straight into the node. The resulting string will be your command.
07-07-2020 02:03 AM
Could you explain it qith an example? I m not doing it right:
07-07-2020 02:15 AM
Hi andrea,
@andrea080690 wrote:
Could you explain it qith an example? I m not doing it right:
Because you don't follow the suggestions you already got…
Why don't you attach your VI instead of showing just images of your code?
How should the final command string look like? Can you provide a clear example?
07-07-2020 02:24 AM
There's probably more behind VOLT, but it gets truncated at the space.
Make the string wider (and taller) to see what is really in there.
Or use a probe.
Or unset the string wrapping function.
Or set the string to code display.
07-07-2020 02:31 AM - edited 07-07-2020 02:36 AM
Concatenating an array of strings doesn't assume that the strings are lines. The strings are simply concatenated. No lines are inserted.
Concatenating an array of strings is exactly the same as concatenating the individual elements.
One of the best features of concatenate string function.
In this problem, the string is simply too long. Note that all the numbers in the array are concatenated (better use Array To Spreadsheet String?) The indicator will truncate the string. So the solution (make the string bigger) will still work.
In >LV20 you'll get a nice indication if the string doesn't fit the indicator.
07-07-2020 02:39 AM
07-07-2020 06:32 AM - edited 07-07-2020 06:32 AM
The problem here is we are dealing with a DC power supply. So it can only accept 1 value at a time. This will not make a good sine wave. But as far as what I described earlier, you need something like this.

07-07-2020 08:12 AM
You were right, it send VOLT ....lots of number... (@1), but this is not what I want. I have to create a sine waveform to send to a keysight DC power supply, so I can send different values 0.01, 0.02 etc to have a sine weve out of the DC power supply. With the funcition I am using it send lots of numbers all toghether so the DC power supply have an error sending that command. How can I do it?
07-07-2020 08:23 AM
@andrea080690 wrote:
You were right, it send VOLT ....lots of number... (@1), but this is not what I want. I have to create a sine waveform to send to a keysight DC power supply, so I can send different values 0.01, 0.02 etc to have a sine weve out of the DC power supply. With the funcition I am using it send lots of numbers all toghether so the DC power supply have an error sending that command. How can I do it?
Use a FOR loop. Look at message 8 of this thread.