Changing from If..Then to Select Case


Results 1 to 8 of 8

Threaded View

  1. #3
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Default Re: Changing from If..Then to Select Case

    Thanks for the reply Archangel,

    In the beginning I looked at a lookup table but didn't know enough about using it so I went with the IF .. Then senario.

    There are 20 slaves with 8 inputs on each. They send 000 thru 007 for the first card, 008 thru 015 for the second and so on. The Master then assigns the apartment number and based on the numbers and their grouping, sends the program to the appropriate display/printout routines. The first 160 apartment numbers are grouped by two buildings and then the second 160 numbers represent when the signal has been returned to normal and that gets the apartment number assigned then goes to a printout routine. I have a serial data line connected between the Master and a busy line that controls the traffic.

    This is an alarm annunciator system that I built for my customer. There is one panel in the apartment lobby and another is in a nursing station in another building.

    Here are a couple of examples:

    If B7 = 065 then Apt = 509: goto DispAlarm1 (DispAlarm1 would be for the first building)
    If B7 = 082 then Apt = 018: goto DispAlarm2 (DispAlarm2 would be for the second building)
    If B7 = 163 then Apt = 107: goto PrntRestore (The PrntRestore routine simply time stamps the return to normal)

    The first two types of lines would printout a time stamp showing which building and which apartment and the last line would printout the time and which apartment number has returned to normal meaning the reponder has reset the alarm switch. The Master panel also has a 4 x 20 display and a beeper that shows the alarm information for the office staff.
    Last edited by BobK; - 26th March 2013 at 23:38. Reason: More info

Similar Threads

  1. About Select Case
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th February 2010, 11:54
  2. Select case...Just wondering....
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th December 2006, 23:23
  3. select case question
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2006, 10:01
  4. Select Case syntax
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th September 2005, 19:19
  5. Select Case
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th June 2005, 19:18

Members who have read this thread : 2

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