Temp variables exceeding LastTvar "Increase the MaxTvars constant"


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Temp variables exceeding LastTvar "Increase the MaxTvars constant"

    Quote Originally Posted by richard View Post
    try array read ...
    Thanks, it works perfect with MaxTvars CON 4 now.


    Code:
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue1,[wait(UsartRight,UsartSlave,Usart0,UsartC,Usart2)]
             GOSUB DisplayCOM1
             UsartFlag = 0
           MainloopContinue1:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue2,[wait(UsartRight,UsartSlave,Usart0,UsartC,Usart3)]
             GOSUB DisplayCOM1_Standby
             UsartFlag = 0
           MainloopContinue2:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue3,[wait(UsartRight,UsartSlave,Usart0,UsartE,Usart2)]
             GOSUB DisplayCOM2
             UsartFlag = 0
           MainloopContinue3:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue4,[wait(UsartRight,UsartSlave,Usart0,UsartE,Usart3)]
             GOSUB DisplayCOM2_Standby
             UsartFlag = 0
           MainloopContinue4:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue5,[wait(UsartRight,UsartSlave,Usart0,UsartD,Usart2)]
             GOSUB DisplayNAV1
             UsartFlag = 0
           MainloopContinue5:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue6,[wait(UsartRight,UsartSlave,Usart0,UsartD,Usart3)]
             GOSUB DisplayNAV1_Standby
             UsartFlag = 0
           MainloopContinue6:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue7,[wait(UsartRight,UsartSlave,Usart0,UsartF,Usart2)]
             GOSUB DisplayNAV2
             UsartFlag = 0
           MainloopContinue7:
        endif
    
        IF (UsartFlag = 1) then        
             ARRAYREAD RecvData,5,MainloopContinue8,[wait(UsartRight,UsartSlave,Usart0,UsartF,Usart3)]
             GOSUB DisplayNAV2_Standby
             UsartFlag = 0
           MainloopContinue8:
        endif
    (add another PBP command to the list of stuff I never tried before).
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,671


    Did you find this post helpful? Yes | No

    Default Re: Temp variables exceeding LastTvar "Increase the MaxTvars constant"

    it could simplify further

    Code:
     IF (UsartFlag = 1) then  
            ARRAYREAD RecvData,5,itsadud,[wait(UsartRight,UsartSlave,Usart0)]
     select case RecvData[3]
     case UsartC
        IF RecvData[4] == Usart2 THEN
          GOSUB  GOSUB DisplayCOM1
          else
          GOSUB  GOSUB DisplayCOM1_Standby
        endif
    case UsartD
        IF RecvData[4] == Usart2 THEN
          GOSUB  GOSUB DisplayCOM2
          else
          GOSUB  GOSUB DisplayCOM2_Standby
        endif
    case UsartE
        IF RecvData[4] == Usart2 THEN
          GOSUB  GOSUB DisplayNAV1
          else
          GOSUB  GOSUB DisplayNAV1_Standby
        endif
    case UsartF
        IF RecvData[4] == Usart2 THEN
          GOSUB  GOSUB DisplayNAV2
          else
          GOSUB  GOSUB DisplayNAV2_Standby
        endif
    end select
    itsadud: 
    UsartFlag = 0
    endif
    Warning I'm not a teacher

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Temp variables exceeding LastTvar "Increase the MaxTvars constant"

    Quote Originally Posted by richard View Post
    it could simplify further...
    Definitely, but I'm not finished adding conditions.

    I really like your original ArrayRead suggestion; it'll be easy to keep expanding new record layouts (sorry, old mainframe habits ).
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. "Stretching" a byte variable into two byte variables?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th October 2021, 23:48
  2. How to do the "SerIN" and "SerOut " for the usb ?
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th March 2015, 02:01
  3. Replies: 0
    Last Post: - 14th November 2013, 03:32
  4. Replies: 3
    Last Post: - 15th October 2012, 08:06
  5. Message (Temp variables exceeding T7) ?
    By circuitpro in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st December 2011, 18:54

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