LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strings, Arrays, and Tables oh my!

Hello all,

I'm running a test that detects when a device fails. Basically when a greater than comparison specific to a device evaluates to 1 I want to display that the specific device failed and what time it failed at. I've been reading up on strings, arrays, and tables and have an elementary understanding of them but I was wondering if anyone had any advice on the best way to implement such a system.

The table I want displayed would look like this:
   
Failure        Date/Time
1A               7/4/2008 6:30pm
1B               7/4/2008 7:00pm
4A               7/6/2008 2:00am

etc.

The devices are numbered 1-6 and each has either A or B. I suppose the Date and Time could be separate columns.

I was thinking of just building a string for devices and a string for the times and then using the 'spreadsheet string to array' function to create 1d arrays and then combining them before displaying to a table. Is there a better way to accomplish this?
0 Kudos
Message 1 of 11
(3,629 Views)

That's probably your best bet, although rather than use Spreadsheet String to Array (which would require you to delimit your data), you can just build them into a 2D Array and display that as a table or array.  Granted, this method uses two Build Arrays, one of which could grow infinitely, but I would hope you don't have hundreds of thousands of failuresSmiley Wink.



Message Edited by JeffOverton on 07-02-2008 03:27 PM
0 Kudos
Message 2 of 11
(3,626 Views)
Hi Fouzaan,
if you have both strings separatly you can use the build array function.
Mike
0 Kudos
Message 3 of 11
(3,625 Views)
Thanks guys, I'll let you know if I hit any snags 🙂
0 Kudos
Message 4 of 11
(3,617 Views)
I'm stuck on how to get it to execute only once when a boolean goes from 0 to 1. When the change occurs I need it to update the array, but then not update again even though the boolean remains at 1.
0 Kudos
Message 5 of 11
(3,572 Views)


Fouzaan wrote:
I'm stuck on how to get it to execute only once when a boolean goes from 0 to 1. When the change occurs I need it to update the array, but then not update again even though the boolean remains at 1.

Use a shift register (or feedback node) and an "implies" logic.
 
 
 

 
Message 6 of 11
(3,559 Views)
nevermind, solved the issue i posted about. 


Message Edited by Fouzaan on 07-03-2008 12:35 PM

Message Edited by Fouzaan on 07-03-2008 12:37 PM

Message Edited by Fouzaan on 07-03-2008 12:41 PM
0 Kudos
Message 7 of 11
(3,546 Views)

Please "pull back the curtain" at let us know how you solved the problem (of the wicked witch). This will help the Dorthy's of the future find their way "home from Oz".

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 8 of 11
(3,530 Views)
I used the method altenbach suggested but he has a button inside the loop which changes the boolean shift register to true and keeps it true after the appropriate conditions are met. In my program I had dynamic data instead of a button so I had to figure out how to convert dynamic data to a bool. It took a bit of digging but I found the function that does exactly that. Once I was able to convert it altenbach's method worked perfectly.
Message 9 of 11
(3,509 Views)

Sorry for the hijack but - BEN would you please contact me concerning SDLC communications under LV.

remerling@moog.com

 

0 Kudos
Message 10 of 11
(3,505 Views)