03-30-2018 03:06 PM
The link was broken so I can't look at the VI but I would recommend creating a new thread for this. Also attach a VI of what you tried to do, you should be able to just use a shift register with concatenate strings primitive but it depends on exactly what you are looking to do.
03-30-2018 03:12 PM
Here is the new link:
https://forums.ni.com/t5/Example-Programs/Basic-Functional-Global-Variable-Example/ta-p/3503982
I am just trying to modify this example to concatenate two strings together continuously. I need to keep the event structure intact. I wasn't able to implement a feed through shift register - been there, tried that. 🙂
03-30-2018 03:13 PM
Thank you for the quick response! 🙂
03-30-2018 03:22 PM
If you can use a feed through shift register and still get it to work - great! I was having issues defining the global variable within the event structure... I wasn't seeing the "Initialize", "Get" and "Increment" show up in the "Event Sources" pane when I tried to Edit Events Handled by This Case.
03-30-2018 03:31 PM
I would still recommend making a new thread for this issue but because the example you linked to doesn't have any strings at all I really don't understand what you are trying to do. If you could attach the VI you tried to modify and then explain what actions you want the user to take and what the results of those actions should be I'm sure we can help you out.
03-30-2018 08:18 PM
I have attached the functional global I need. I need to concatenate two strings.
1. String1 = a, b, c, d, e
2. String2 = f, g, h, i, j
Result = a, f, b, g, c, h, d, i, e, j
04-01-2018 06:51 AM
I am not seeing why you need this to be an Action Engine. And are those values arrays of strings? I ask because it does not look like you are asking for a simple concatenation.
04-01-2018 02:54 PM
@Newton2this1 wrote:
I have attached the functional global I need. I need to concatenate two strings.
1. String1 = a, b, c, d, e
2. String2 = f, g, h, i, j
Result = a, f, b, g, c, h, d, i, e, j
Concatenating String1 = "abcde" with String2 = "fghij" will yield "abcdefghij", and the Concatenate String function will do that for you.
What you seem to want is something else, something I would call "interleave", a very non-standard String function where you alternate taking one element from each string and concatenating them, then concatenating the result.
Hmm -- I just realized that you might have meant String1 to be "a,b,c,d,e" and String2 to be "f,g,h,i,j". Without quotation marks to delimit the String, readers (such as I) might make the wrong assumption. If this is your intended meaning, then the previous paragraph (describing how to do an Interleave) contains the Solution you need, after you pair it with Spreadsheet String to Array and Array to Spreadsheet String.
Here's the front panel of a VI I just knocked out:
As you can see, it does what you describe, interleaving the elements of the Strings. The first two functions of this little sub-VI are Spreadsheet String to Array, and the last is Array to Spreadsheet String, with some Array processing (you figure it out) in the middle.
Bob Schor
04-03-2018 03:08 PM
Thank you for the reply Bob. I am currently using the Write to Text File and Read from Text File.vi from the example folder for output. Can you share your block diagram for comparison? Thx.
04-03-2018 04:03 PM
Please do the following:
You mention "Write to Text File" and "Read from Text File". Why? Are you doing anything with the Spreadsheet functions (either in the Array Palette or in the Files Palette)? I've told you how to do what I understood you to say you wanted to do, and demonstrated that I could interleave two comma-separatated Strings -- did you try to reproduce the steps I outlined? If you reply (in a Brand New Message, please), be sure to attach your VI.
Bob Schor