Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Invalid font #10... Post ReplyPost New Topic
<< Prev Page of 2
Author
Message << Prev Topic | Next Topic >>
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 4871
Posted: 07 September 2017 at 12:39am | IP Logged Quote Grogster

UPDATE:

Appears to only happen from power-up.

That is, from initial power-up, you get this error if you are going to get it, but you can work-around it at the console, by calling the offending page TWICE. The first attempt(at the console) always generates the same error, then 2nd attempt does not.

From that point on, RUN the code, it works fine.
Even CPU RESTART and the code works fine.







__________________
Smoke makes things work. When the smoke gets out, it stops!


Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
GoodToGo!
Senior Member
Senior Member
Avatar

Joined: 23 April 2017
Location: Australia
Online Status: Offline
Posts: 104
Posted: 08 September 2017 at 3:55am | IP Logged Quote GoodToGo!

When I get a chance I'll dig out my LCD+ backpack and re-run my original code......

GTG!

__________________
...... Don't worry mate, it'll be GoodToGo!
Back to Top View GoodToGo!'s Profile Search for other posts by GoodToGo!
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 368
Posted: 08 September 2017 at 8:59am | IP Logged Quote panky

@Grogster,

Would you be able to post the full code so we can run and investigate a source of the problem?

Doug.


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
GoodToGo!
Senior Member
Senior Member
Avatar

Joined: 23 April 2017
Location: Australia
Online Status: Offline
Posts: 104
Posted: 09 September 2017 at 12:45am | IP Logged Quote GoodToGo!

Grogster wrote:

Appears to only happen from power-up.

That is, from initial power-up, you get this error if you are going to get it, but you can work-around it at the console, by calling the offending page TWICE. The first attempt(at the console) always generates the same error, then 2nd attempt does not.

From that point on, RUN the code, it works fine.
Even CPU RESTART and the code works fine.


Confirmed! The exact same sequence occurs with my test code.


> run
[56] Page 3,9
Error: Invalid font number #16
> page 3
> run
[56] Page 3,9
Error: Invalid font number #16
> page 9
Error: Invalid font number #16
> page 9
> run
(Works)

** Reset MM+ by reset switch **

> Micromite Plus MMBasic Ver 5.04.05
Copyright 2011-2017 Geoff Graham

> run
(Works)

**Cycle power to MM+**

Micromite Plus MMBasic Ver 5.04.05
Copyright 2011-2017 Geoff Graham

> run
[56] Page 3,9
Error: Invalid font number #16
> page 9
Error: Invalid font number #16
> page 9
> run
(Works)


Interestingly, now it's page 9 that's having a hernia, not page 3.

Code below if anyone wants to have a play....

option default integer
base = 1

'Page 3 GUI Elements

const Page3label_CH = 54
const Page3label_MaxAmps = 55
const Page3label_TripAmps = 56
const Page3label_Status = 57
const Page3label_Ch1 = 58
const Page3label_Ch2 = 59
const Page3label_Ch3 = 60
const Page3label_Ch4 = 61
const Page3MaxAmps_Ch1 = 62
const Page3MaxAmps_Ch2 = 63
const Page3MaxAmps_Ch3 = 64
const Page3MaxAmps_Ch4 = 65
const Page3TripAmps_Ch1 = 66
const Page3TripAmps_Ch2 = 67
const Page3TripAmps_Ch3 = 68
const Page3TripAmps_Ch4 = 69
const Page3Status_Ch1 = 70
const Page3Status_Ch2 = 71
const Page3Status_Ch3 = 72
const Page3Status_Ch4 = 73
const Page3Frame = 74

'Tab Elements
const Tab1 = 91
const Tab2 = 92
const Tab3 = 93
const Tab4 = 94

'Misc Variables
const Ok = 1
const Trip = 2
const Fail = 3
Dim as Float  TripAmps(4), MaxAmps(4)

'------------------------------------------------------------------

'Main Program for testing

CLS
pwm 2, 500, 50  'Set backlight to on (MM+ LCD Backpack)
font 1, 1 'Set font to #1, scale 1.

for I = 1 to 4
    TripAmps(I) = 1.25  'Test figures for display
    MaxAmps(I) = 1.43
next I 

GuiSetup  'Setup Pages
page 3,9
gui show all

do 
  for I = 1 to 4
    ChangeStatus(Page3Status_ch1,I)
    ChangeStatus(Page3Status_ch2,I)
    ChangeStatus(Page3Status_ch3,I)
    ChangeStatus(Page3Status_ch4,I)
    pause 500
  next I
loop

'------------------------------------------------------------------

Sub ChangeStatus(Element,State)

  select case State
  Case Ok
    gui fcolour rgb(green),Element
    gui bcolour rgb(black),Element
    ctrlval(Element) = "OK"
  Case Trip
    gui fcolour rgb(yellow),Element
    gui bcolour rgb(red),Element
    ctrlval(Element) = "TRIP"
  case Fail
    gui fcolour rgb(Black),Element
    gui bcolour rgb(red),Element
    ctrlval(Element) = "FAIL"
  Case else
    gui fcolour rgb(red),Element
    gui bcolour rgb(black),Element
    ctrlval(Element) = "????"
  end select
end sub

'------------------------------------------------------------------

sub GuiSetup
  
  'Tab Buttons
  
  GUI SETUP 9
  GUI Switch Tab1, "Main", 0, 0, 78, 30, RGB(white), RGB(Gray)
  GUI Switch Tab2, "Relays", 80, 0, 78, 30, RGB(White)
  GUI Switch Tab3, "Current", 160, 0, 78, 30, RGB(White)
  GUI Switch Tab4, "Config", 240, 0, 78, 30, RGB(White)
  CtrlVal(Tab1) = 0
  CtrlVal(Tab2) = 1
  CtrlVal(Tab3) = 1
  CtrlVal(Tab4) = 1

  'Page 3
  
  GUI SETUP 3
  
  Gui frame Page3Frame,"Current (Amps) Page",0,45,320,193,rgb(white)
  gui caption Page3label_CH, "CH.", 10,60,,rgb(cyan)
  gui caption Page3label_TripAmps, "Trip Amps", 68,60,,rgb(cyan)
  gui caption Page3label_MaxAmps, "Max Amps", 159,60,,rgb(cyan)
  gui caption Page3label_Status, "Status", 250,60,,rgb(cyan)
  gui caption Page3label_Ch1, "1", 18,93,,rgb(cyan)
  gui caption Page3label_Ch2, "2", 18,131,,rgb(cyan)
  gui caption Page3label_Ch3, "3", 18,169,,rgb(cyan)
  gui caption Page3label_Ch4, "4", 18,207,,rgb(cyan)

  gui caption Page3TripAmps_Ch1,str$(TripAmps(1),2,2)+"A",76,93,,rgb(white)
  gui caption Page3TripAmps_Ch2,str$(TripAmps(2),2,2)+"A",76,131,,rgb(white)
  gui caption Page3TripAmps_Ch3,str$(TripAmps(3),2,2)+"A",76,169,,rgb(white)
  gui caption Page3TripAmps_Ch4,str$(TripAmps(4),2,2)+"A",76,207,,rgb(white)

  gui caption Page3MaxAmps_Ch1,str$(MaxAmps(1),2,2)+"A",163,93,,rgb(white)
  gui caption Page3MaxAmps_Ch2,str$(MaxAmps(2),2,2)+"A",163,131,,rgb(white)
  gui caption Page3MaxAmps_Ch3,str$(MaxAmps(3),2,2)+"A",163,169,,rgb(white)
  gui caption Page3MaxAmps_Ch4,str$(MaxAmps(4),2,2)+"A",163,207,,rgb(white)

  gui displaybox Page3Status_Ch1,250,87,45,25,rgb(green),rgb(black)
  gui displaybox Page3Status_Ch2,250,125,45,25,rgb(green),rgb(black)
  gui displaybox Page3Status_Ch3,250,163,45,25,rgb(green),rgb(black)
  gui displaybox Page3Status_Ch4,250,201,45,25,rgb(green),rgb(black)

  ctrlval(Page3Status_Ch1) = "OK"
  ctrlval(Page3Status_Ch2) = "OK"
  ctrlval(Page3Status_Ch3) = "OK"
  ctrlval(Page3Status_Ch4) = "OK"
end sub


Blanked the MM+, loaded with below and.......
memory
Flash:
   1K ( 1%) Program (7 lines)
  99K (99%) Free

RAM:
   0K ( 0%) 0 Variables
   0K ( 0%) General
 101K (100%) Free
> list

GuiSetup
Page 3

Sub GuiSetup
  GUI SETUP 3
End Sub
> run
[3] Page 3
Error: Invalid font number #16
>



Hope it helps with the bug squashing

GTG!

__________________
...... Don't worry mate, it'll be GoodToGo!
Back to Top View GoodToGo!'s Profile Search for other posts by GoodToGo!
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 4871
Posted: 09 September 2017 at 4:34am | IP Logged Quote Grogster

@ panky - No, it is 1700 line long, and effectively closed-source(by me). I am 99.9% sure this is not a programming bug on my part.

@ GTG - Nice extra information, thanks. Also nice to see you are getting the same error(ignoring the font number for now) AT THE SAME POINT in the procedure, which should help isolate where this is happening(when Geoff reads this and/or gets the time to look at it)

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
<< Prev Page of 2
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0938 seconds.
Privacy Policy     Process times : 0.02, 0, 0, 0.08