LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues within an event structure...

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.

Matt J | National Instruments | CLA
0 Kudos
Message 21 of 30
(850 Views)

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. 🙂

0 Kudos
Message 22 of 30
(847 Views)

Thank you for the quick response! 🙂

0 Kudos
Message 23 of 30
(846 Views)

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.

0 Kudos
Message 24 of 30
(838 Views)

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.

Matt J | National Instruments | CLA
0 Kudos
Message 25 of 30
(836 Views)

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

0 Kudos
Message 26 of 30
(821 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 27 of 30
(812 Views)

@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:

Interleave.png

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

 

0 Kudos
Message 28 of 30
(801 Views)

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.

0 Kudos
Message 29 of 30
(779 Views)

Please do the following:

  1. As Jacobson asked you to do, abandon this thread.
  2. Start a new Thread, with a new Title ("How can I interleave two Strings?" or something that makes sense to you).
  3. State (again) clearly what you are trying to do.
  4. Attach your VI.  Do not attach a .JPG of part of the Block Diagram -- we don't want to try to reproduce your code just to help us understand what you are doing.

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

0 Kudos
Message 30 of 30
(766 Views)