LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending a 1D array (from state machine) to existing 2D array

I am having difficulty appending a 1D array created from a state machine to an existing 2D array. 
 
I would like to have a boolean button ("Append to Array?") that when pressed, allows me to append a 1D array to a 2D array while the program is running.  It works when I want to append an ordinary 1D array (not created from state machine).  And for this to work, the "Append to Array?" button must be pressed BEFORE I execute the program. 
 
I have a feeling my state machine is faulty.
 
I would also like to have an initial state in my state machine to be that of "Good."  You will see that before the VI is executed, the Good/Bad Array is BLANK.  I'd like it to say "Good".  I'm very unfamilar to State Machines, so I'm asking for your help 🙂
 
Part of this VI was created from this thread.
 
I am attaching my VI, along with other files.  You'll have to change the *.xls files to *.csv since this forum doesn't allow me to attach them.
 
Thanks!!
 
Amal Patel
Download All
0 Kudos
Message 1 of 3
(2,846 Views)
I made a mistake in my VI.  I am reattaching a revised VI.  Sorry.
Amal Patel
0 Kudos
Message 2 of 3
(2,842 Views)

Amal,

I might suggest taking a look at the State Machine template that is available when you select New... from the menu.  The state machine should be in the following path:

VI » From Template » Frameworks » Design Patterns » Standard State Machine

Taking a look at your code, it looks like you might need to make some adjustments to get things to work how you would like them to.  You don't really seem to have a state machine type of structure, so that template will give you a good idea what to do.  That way you can set up somewhat of a state diagram and implement that in code.  It seems like you need several cases including reading your file, parsing the values, user interface interaction, and any other steps that you might need. 

I would suggest sitting down and drawing a state diagram and sitting down with the template and run it using highlight execution (the little light on the Block Diagram toolbar) to get an idea of how you could implement that in LabVIEW.  We actually offer a toolkit that you might be interested called the State Diagram Toolkit, which would allow you to just draw that diagram and have the structure generated for you.

Let me know if you have any questions!  Thanks!
Andy F.

 
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 3 of 3
(2,821 Views)