Serial Interrupt with DT_Ints - Error


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The best solution ... I've never found one of those.
    Found things that "work" along the way, but there's always something better.

    Don't know if this is better or not, but it is definitely different.
    Code:
    <font color="#000000"><b>ID     </b><font color="#008000"><b>VAR BYTE
    
    </b></font><b>Interr</b>: 
        <font color="#008000"><b>Hserin </b></font><font color="#800000"><b>100</b></font>,<b>RXfail</b>, [<b>wait</b>(<font color="#FF0000">&quot;OK&quot;</font>),<font color="#008000"><b>DEC2 </b></font><b>ID</b>, <font color="#008000"><b>str </b></font><b>DAdos</b>\<font color="#800000"><b>4</b></font>] 
    
        <font color="#008000"><b>if </b></font><b>ID </b>= <font color="#800000"><b>32 </b></font><font color="#008000"><b>then
            </b></font><b>ARRAYREAD DAdos</b>, <font color="#800000"><b>4</b></font>,<b>No_Hugo</b>,[<b>WAIT</b>(<font color="#FF0000">&quot;Hugo&quot;</font>)]
                <font color="#008000"><b>high </b></font><b>led
                </b><font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$fe</b></font>, <font color="#800000"><b>1 
                </b></font><font color="#008000"><b>lcdout </b></font><font color="#FF0000">&quot;      Teste USB&quot;
                </font><font color="#008000"><b>lcdout </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>$C0</b></font>,<font color="#FF0000">&quot;Recebido H          &quot;
            </font><b>No_Hugo</b>:         
    
            <b>ARRAYREAD DAdos</b>, <font color="#800000"><b>4</b></font>,<b>No_LuLu</b>,[<b>WAIT</b>(<font color="#FF0000">&quot;LuLu&quot;</font>)]
                <font color="#008000"><b>low </b></font><b>led
                </b><font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$fe</b></font>, <font color="#800000"><b>1 
                </b></font><font color="#008000"><b>lcdout </b></font><font color="#FF0000">&quot;      Teste USB&quot;
                </font><font color="#008000"><b>lcdout </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>$C0</b></font>,<font color="#FF0000">&quot;Recebido L          &quot; 
            </font><b>No_LuLu</b>:
    
            <b>ARRAYREAD DAdos</b>, <font color="#800000"><b>2</b></font>,<b>NO_LH</b>,[<b>WAIT</b>(<font color="#FF0000">&quot;LH&quot;</font>)]
                <font color="#008000"><b>LCDOUT </b></font><font color="#800000"><b>$fe</b></font>, <font color="#800000"><b>1 
                </b></font><font color="#008000"><b>lcdout </b></font><font color="#FF0000">&quot;      Teste USB&quot;
                </font><font color="#008000"><b>lcdout </b></font><font color="#800000"><b>$FE</b></font>,<font color="#800000"><b>$C0</b></font>,<font color="#FF0000">&quot;Recebido    :&quot;</font>,<font color="#008000"><b>STR </b></font><b>DADOS</b>\<font color="#800000"><b>4
            </b></font><b>NO_LH</b>:
    
        <font color="#008000"><b>endif
    </b></font><b>RXfail</b>:
    <font color="#000080">@ INT_RETURN
    </font>
    If nothing else, you should add the RXfail timeout to the HSERIN statement.
    DT

  2. #2
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    The best solution ... I've never found one of those.
    Found things that "work" along the way, but there's always something better.

    Don't know if this is better or not, but it is definitely different.

    If nothing else, you should add the RXfail timeout to the HSERIN statement.
    WOW, Thank you Darrel. Much more btter and organized... must "better solution" than mine!

    Just tell me one thing, were can i find a descripion of he arrayread comand? I search on the PBP manual, but i cannot find it.

    Thanks

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    ARRAYREAD/ARRAYWRITE are new in PBP 2.60.

    I guess the RTFM would be section 5.3 (page 50) in the manual.
    There haven't been any tutorials that I know of yet.

    Essentially, ARRAYREAD is the same as a SERIN2.
    But it works on data that is already in an Array, instead of data being received via RS232.

    All the same modifiers work. WAIT DEC HEX BIN etc.
    Instead of a timeout, you specify the number of bytes to check.
    If it runs out of bytes before it satisfies the parameters, it jumps to the label. (ex. No_Hugo)

    The way I used it makes it more like an IF statement for Strings.

    hth,
    DT

  4. #4
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    ARRAYREAD/ARRAYWRITE are new in PBP 2.60.

    I guess the RTFM would be section 5.3 (page 50) in the manual.
    There haven't been any tutorials that I know of yet.

    Essentially, ARRAYREAD is the same as a SERIN2.
    But it works on data that is already in an Array, instead of data being received via RS232.

    All the same modifiers work. WAIT DEC HEX BIN etc.
    Instead of a timeout, you specify the number of bytes to check.
    If it runs out of bytes before it satisfies the parameters, it jumps to the label. (ex. No_Hugo)

    The way I used it makes it more like an IF statement for Strings.

    hth,
    Thanks for reply.

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