LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Return month and year

Solved!
Go to solution

Hi All, 

 

I am new to LabVIEW.

I have an array which calculates the return of investment. Currently I am extracting month and year from the excel. But I want to display the month and year without extracting it from excel. 

 

Example 

Date of solar installation: 1st march 2018

Input the number of months : 10

In period column I want to output from march 2018 to January 2019 (10 month). 

 

I am not sure how to do that.  I have also attached a snapshot of it. 

 

0 Kudos
Message 1 of 9
(2,717 Views)

Sigh -- I'd expect a more cogent question from someone who chooses a Forum Name of "caltect".

 

It is unclear (to me) what you are using as the "input" (is it a string that is of the form "1st March 2018", and you need to parse it into "Month" and "Year", or it is a number that represents the Date according to some (unspecified) Algorithm (for example, an Excel Timestamp or a LabVIEW Timestamp), or "something else".

 

Assume you specify the nature of the input, and can "solve the problem" of isolating a string called "Month" and a numeric called "Year".  Can't you figure out how to generate a list of 10 "Dates" of the form <Mon>-<Year>, where <Mon> is a string representing the first three letters of a Month and <Year> is a string representing the Year as a 4-digit integer?  You'd need to figure out how to "go to the next month" and also how/when to "go to the next year".

 

With a name like Caltect, can't you do this?

 

Go ahead, take a piece of paper, write down some steps, then learn enough LabVIEW (a couple of Beginning LabVIEW tutorials should suffice) and try to do it yourself in LabVIEW.  If you are still stuck, come back here and post your VI (the actual file with the extension ".vi") so we can see what you tried.

 

Bob Schor

0 Kudos
Message 2 of 9
(2,702 Views)

thank you. 

any one with a solution please do help me. 

0 Kudos
Message 3 of 9
(2,678 Views)

so you wanted the vi.. here it is... the issue it after dec,2021, it does not really go to jan 2022.

 

0 Kudos
Message 4 of 9
(2,670 Views)

The previous vi showed number, this vi is basically what I really wanted with a correction to work for 2022 as well. 

0 Kudos
Message 5 of 9
(2,666 Views)

When your month becomes 13, subtract 12 and add 1 to the year!

0 Kudos
Message 6 of 9
(2,648 Views)

Solved it 

 

Now that a solution.. 

 

Ill attach it for you to refer

 

 

With regards

 

CALTECT

0 Kudos
Message 7 of 9
(2,647 Views)

@caltect wrote:

Solved it 


Did you even test it? Your "no of months" input is the wrong representation and you get duplicate and missing output elements (Try with a start time of Jan 31, 2021, for example, and Feb will be missing).

0 Kudos
Message 8 of 9
(2,619 Views)
Solution
Accepted by caltect

Try something like this:

 

altenbach_0-1614759433289.png

 

Message 9 of 9
(2,604 Views)