LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with array/table and capturing last data

Solved!
Go to solution

Hi All,

 

Newbie is back :smileyvery-happy: and I have a problem with my program.

Here is a brief introduction of what i'm trying to do.

 

I'm indicating a fault event of a system.

Based on every event, i will need to log the Fault description, the tag, the start fault time and also the duration.

All event informations will be displayed on the front panel table and this table will grow when new event occured.

 

For descriptions and tags - this is fixed based on which fault button pressed,respectively.

The issue that i am having is to capture the duration.

What i have in mind is to use the elapsed time to capture the start time and also duration. 

Start time is no issue because once i press boolean = true, it gives the start time.

For duration, when i press boolean = false, it wil gives the total duration.

However, i have a problem as following:

 

1) To capture this one set of complete data (E.g Desc : Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:05) and passed it inside Fault Trap Table.

2) If the same fault occured, it will overwrite the last information. However, I need to maintain displaying both old and new event.

 

Please advise.

Opinions and suggestions are mosssssst welcome.

Million of thanks in advance. :smileywink:

 

0 Kudos
Message 1 of 7
(3,374 Views)

You need to use shift registers for your master array.  That holds the information from one iteration of the loop to the next.  If a fault occurs, then you append new data to the array in the shift register and feed it to the indicator.

 

You may want to use some other shift registers to maintain some boolean logic such as whether a given fault is new in which case you want to append the new data to the array, or false, just a continuation of the the previous fault in which case you may just want to update the elapsed time value by replacing that portion of the array.

0 Kudos
Message 2 of 7
(3,366 Views)

Hi Ravens fan,

 

Thank you very much for the reply  :smileyhappy: Appreciate that a lot!!~

 

Actually i have tried to use the shift registers for the master table.

It does append new data in fact, it append the same data which is still counting.

E.g 

 

Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:01

Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:02 

Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:03

Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:04 

.

.

.

.

Fault 1, Tag : A, Start Time : 12/16/2008 11:15:06 AM, Duration :  0 00:00:15

 

And this keep on appending until boolean = false. :smileysad:

 

What i need to be display and to be append on the master table is just the final information of the Duration, not the information while it is still counting..

 

Any idea guyz?

 

 

 

 

 

 

0 Kudos
Message 3 of 7
(3,355 Views)
Solution
Accepted by topic author Aleizor

Hi Roziela,

 

Thanks for the post and I hope your well today.

 

You need to add some logic to detect the event change (No Fault to Fault) and produce one boolean output per 'raising' edge.

 

I have some code for this, 

 

 

 

Let me know what you think,

Message Edited by Hillman on 12-16-2008 10:45 AM
Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Download All
Message 4 of 7
(3,341 Views)

Hi Hillman,

 

I'm very well today,thank you :smileywink:.

Too bad I can't open the file coz I'm using version that is earlier than you, Its 8.0.

Is it possible for u to re-send again the VI for 8.0 version?

 

Thank you in advance  :smileywink:

 

rgds.

0 Kudos
Message 5 of 7
(3,338 Views)

Hillman,

 

I forgot about the pic u attached, can view it from there also.. Thanks!!  :smileyvery-happy:

 

Anyway, it is exactly as what i've expected.

I have use the method and it works!!~  :smileyvery-happy:

Its just that i need to increase a bit the delay to be able to compare with previous state..

 

Thanks Hillman!!~

 

rgds.

0 Kudos
Message 6 of 7
(3,329 Views)

Hi rgds,

 

Thanks for the reply.

 

Here it is in LV8 - sorry if its too late.

 

Im glad it works ! 😄

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 7 of 7
(3,325 Views)