LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i add new excel worksheet for every minute counting?

Solved!
Go to solution

Hi Everyone,

 

I'm trying to add excel worksheet for every minute passed, so i used the "get date/time in seconds" function and extract the minute (%M), and use event structure (value change) but nothing happened, the event structure doesn't respond to change in minutes. any bright ideas? here is the vi (LV8.5) of my problem.

 

 1.jpg

 

note: this is just an initial part of my program to acquire data (history records) from devices. i want to separate the data by its date in microsoft excel (but i am trying first to acquire data by minutes to see if my program works).

 

thanks in advanced..!

Ivel R. | CLAD
0 Kudos
Message 1 of 10
(3,309 Views)
Solution
Accepted by topic author ivelson

Several problems.

 

One, you have an event for the value change of minute.  However the event never gets fired because the only way minute gets changed is by writing to the indicator's terminal.  That does not fire an event.  Either the user has to write to the control (which they can't because it is an indicator and not a control), or you write to the value(signalling) property node of that control.  Note that although the event is called "value changed" the value itself would not have to actually change from its previous value in order for the event to fire.  You would have to compare the new value to the old value from within the event structure and made a decision in the code on what to do.

 

Second, if the that part of the code did work, your while loop would end and your case structure would execute.  But once that happens your program would end.  You would never be able to do it for the next minute.

Message Edited by Ravens Fan on 03-30-2010 10:24 PM
Message 2 of 10
(3,302 Views)

Thanks for response, i try what you've suggested "value signalling property node", and put while loop to entire program to prevent termination. what happens is that the event structure changed eventhough the value of 'minutes" hasn't changed yet... please see program below and correct me if i'm wrong.

 

 2.jpg

 

this program still doesn't succeed.

Ivel R. | CLAD
0 Kudos
Message 3 of 10
(3,297 Views)

anyway, how to compare old and new value in my program to be used to trigger the event structure? im not good in manipulating strings and not good also in using event structure.Smiley Sad.please show me some LV program sketch of yours so i may put this up in my program..

 

Thanks a million!...

Ivel R. | CLAD
0 Kudos
Message 4 of 10
(3,295 Views)

if you could post the VI people could help you better, but instead of a event structure use a case structure

 

also you only need one while loop

Message Edited by Harold Timmis on 03-30-2010 11:30 PM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 5 of 10
(3,284 Views)

hi harold,

 

 

my original VI is in the 1st message (LV8.5)... using case structure seems an easier way as you've suggested but i dont know how to used it in relation to old vs new value of my "minute" indicator to create different cases. what functions can i used to detect the changing of string values? anyway, here is the attached vi. i hope you can sketch your suggested idea (since i'm not really good in manipulating strings) or just be specific if no time for creating program.

 

thanks in advance...

Ivel R. | CLAD
0 Kudos
Message 6 of 10
(3,279 Views)
sorry i forgot. here's my vi...
Ivel R. | CLAD
0 Kudos
Message 7 of 10
(3,272 Views)

I had said in my post that Value Signalling causes the event to fire even if the value hasn't actually changed.  So you shouldn't be surprised that it happened that way.

 

In the nodes that are on the inside border of the case structure, you can select Old Value and New Value and compare them.

Message 8 of 10
(3,271 Views)

to ravens fan,

 

Oh i see, sorry for not figuring out your answer in your 1st reply. you mean "old val & new val" nodes inside border of event structure (not in case structure). yes it working now. i did'nt figure it out before coz' im not often using this event strucure in my previous programs. anyway thanks!

Ivel R. | CLAD
0 Kudos
Message 9 of 10
(3,260 Views)

to ravens fan,

 

Oh i see, sorry for not figuring out your answer in your 1st reply. you mean "old val & new val" nodes inside border of event structure (not in case structure). yes it working now. i did'nt figure it out before coz' im not often using this event strucure in my previous programs. anyway thanks!

Ivel R. | CLAD
0 Kudos
Message 10 of 10
(3,258 Views)