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: 5061
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: 122
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: 394
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: 122
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: 5061
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
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5061
Posted: 14 October 2017 at 4:47am | IP Logged Quote Grogster

BUMP!

Geoff - have you had any time to look at this one? No problem if not as I know you will squish it in due course, but I ran into it again today when I powered up one of my boards.

As with the previous posts, you only run into this error once from power-up. Once you clear it by typing the page(s) in at the command prompt TWICE, it then works flawlessly until you next turn off the power.

__________________
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
 
ion507
Newbie
Newbie


Joined: 05 December 2014
Location: Australia
Online Status: Offline
Posts: 10
Posted: 18 October 2017 at 11:57pm | IP Logged Quote ion507

I also experienced this happening a couple of days ago on my E100 project. I upgraded 5 boards to V5.04.05 a few weeks back but didn't get much time to work on my timer project. The timer is mostly up and running but I'm still trying to develop a couple more features using trial and error programming through MMIDE. In my program there is an initial selection menu then it displays a warning page before running the selection. I know that it had worked several times up till this week so when Error: Invalid font number #10 came up on the screen I thought my last program changes must have caused the problem. The error pointed to the Page 30, 31 line in the code below. This was not a recent change.
CLS
Page 30, 31 'WARNING - PRESS TO FACE TARGETS
Do
If FLAG_1 = 0 THEN
Loop
EndIf

I tried with just “Page 30” on the line and the program ran. I tried with just “Page 31” on the line and the error returned. This is the code for 31:

GUI SETUP 31 ' TARGET WARNING_PAGE
Font 4, 2
GUI BUTTON WARNING_GO, "PRESS TO FACE TARGETS", 30, 120, 740, 240, RGB(BLACK), RGB(RED)

I tried changing the font thinking that this was the problem but no joy. The E100 PCB I was using had been damaged when I tried to solder in my first SMD PIC so I tried another board but it also showed the same problem. That’s when I suspected that V5.04 might be causing the error. I’ve gone back to V5.03.02 and it seems to be working correctly on both boards.

When the error began to appear I had been using VAR SAVE and VAR RESTORE for the first time. I don’t know if this caused it.
Back to Top View ion507's Profile Search for other posts by ion507
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5061
Posted: 19 October 2017 at 6:46am | IP Logged Quote Grogster

Hi there.

I can confirm that I have had an email from Geoff on this matter, and this invalid font issue IS on his bug-list for the next release, but he mentioned that won't be for at least a month or so - he's away seeing the world again.

__________________
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
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5061
Posted: 29 October 2017 at 10:49pm | IP Logged Quote Grogster

Just an update. I changed some of the GUI pages, and the same problem has cropped up, and exactly the same fix - type the problem GUI page TWICE at the command prompt, then RUN the code, and everything works. Different page this time thowing the error, but same font - #10, which does not exist. Also different line number throwing it. Just for everyone's information, and Geoff if he happens to read 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.1113 seconds.
Privacy Policy     Process times : 0, 0.02, 0, 0.09