LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Look up Table

Hiya,
 
I'm trying to create a VI which will look up the price of electricity for a given period of time.
 
I'm have a table which gives the price of electricity for given time periods, e.g:
 
Time Period          Price
12:00 - 12:30        6.8
12:30 - 13:00        7
13:00 - 13:30        10
 
and i want to be able to see what the price of electricity is at the current time - so if it is 12:15 the VI will tell me that the price is 6.8 and when it is 13:01 the price will change to 10.
 
Any suggestions?
 
0 Kudos
Message 1 of 6
(3,251 Views)
some queries
Would the user enter the time in any specified format??
Or do you want the vi to read the system's current time and give the corresponding price??
0 Kudos
Message 2 of 6
(3,241 Views)
i want to read the systems current time
0 Kudos
Message 3 of 6
(3,240 Views)
Here is one method ( rather unelegant, I must confess )
 
Look at attached vi
0 Kudos
Message 4 of 6
(3,215 Views)

Hi,

  a more mathematical approach that doesn't use the case statement.

You didn't say which version of LabVIEW you were using, so this is in version 7.1

Hope that helps

Thanks

Sacha Emery
National Instruments (UK)

 

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 5 of 6
(3,189 Views)

cheers, both these methods will be useful

0 Kudos
Message 6 of 6
(3,165 Views)