Help with look up table


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Help with look up table

    Isaac, I think I would do it this way, eliminating the AND in each of the statements by using a CASE statement. I also notice there is no compare for the value of 389. Is this intentional?

    select case datax
    case is < 323
    pressure = 999
    case is < 326
    pressure = 0
    case is < 329
    pressure = 25
    case is < 332
    pressure = 50
    case is < 337
    pressure = 75
    case is < 340
    pressure = 100
    case is < 343
    pressure = 120
    case is < 347
    pressure = 140
    case is < 352
    pressure = 160
    case is < 356
    pressure = 180
    case is < 361
    pressure = 200
    case is < 365
    pressure = 220
    case is < 371
    pressure = 240
    case is < 376
    pressure = 260
    case is < 380
    pressure = 280
    case is < 388
    pressure = 300
    case is > 389
    pressure = 999
    end select
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Apr 2007
    Location
    Pennsylvania, USA
    Posts
    158


    Did you find this post helpful? Yes | No

    Default Re: Help with look up table

    For what it's worth, in my experiences, using IF THEN commands compile to a smaller file size than using the CASE command. That said, I would use a lookup table as Darrel provided an example.

    What sensor are you using?
    Shawn

  3. #3
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default Re: Help with look up table

    Thanks all for your advise
    the at 389 the pressure is 3.3Bar but if its more than 3 bar i raise an alarm
    my results are divided by 100 before its displayed.
    Darrel the Lookup table works fine .
    Shawn FYI ..........its a Vibrating Wire Sensor

    Respect To You Guys
    Isaac

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Help with look up table

    Subtract 255 from all the values and you can use bytes in the lookup table and add 255 after the lookup.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts