Author |
Topic: LBB runs 7 times slower than LB on my GBRL-Sender (Read 1570 times) |
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #39 on: Dec 25th, 2017, 11:27pm » |
|
This is part 2 of form + code this code runs 3 100 counts then terminates for testing
normally the count is 1776 approx 30 seconds
The TIC value is displayed after each 100 count Run program do nothing else program runs slow Run program then immediately click the print window program runs fast.......... running on w10 pro , but suspect same may happen on Wxp
I think that if a lot of buttons + other is deleted it will run ok
Code:
button #main.path,"<Path$>",[PathClr],UL, 445,70,50,16
graphicbox #main.PathBox, 445,48,413,20
statictext #main.drive, "Drive",415,104,30,16
combobox #main.drvbox, drv$(), comboClick,445,102,50,25
ComboboxColor$ = "yellow"
combobox #main.selbox1, fdr$(),comboClick,500,104,358,2
ComboboxColor$ = "green"
combobox #main.selbox2, fil$(),comboClick,500,104,358,2
graphicbox #main.Fdrbox,500,87,72,17
button #main.yellow,"Folder", comboClick,UL,513,89,45,12
graphicbox #main.Filebox,573,87,72,17
button #main.green,"File",comboClick,UL,586,89,45,12
statictext #main.nbrfdrname, "#Fdr's",500,70,30,14
textbox #main.nbrfdr, 535,69,30,17
statictext #main.nbrfilename, "#File's",570,70,30,14
textbox #main.nbrfile, 605,69,50,17
statictext #main.FilLen, "#FileLen", 660,69,50,14
textbox #main.fbox, 710,69,68,17
button #main.MZX, "Zx", [MZX], UL, 165, 0, 30, 30
button #main.MZY, "Zy", [MZY], UL, 165, 35, 30, 30
button #main.MZZ, "Zz", [MZZ], UL, 165, 70, 30, 30
button #main.MZR, "ZR", [MZR], UL, 195, 0, 25, 100
stylebits #main.DROMPx, _ES_RIGHT,0,0,0
textbox #main.DROMPx, 55, 0, 110, 30
stylebits #main.DROMPy, _ES_RIGHT,0,0,0
textbox #main.DROMPy, 55, 35, 110, 30
stylebits #main.DROMPz, _ES_RIGHT,0,0,0
textbox #main.DROMPz, 55, 70, 110, 30
stylebits #main.DROWCx, _ES_RIGHT,0,0,0
textbox #main.DROWCx, 220, 0, 110, 30
stylebits #main.DROWCy, _ES_RIGHT,0,0,0
textbox #main.DROWCy, 220, 35, 110, 30
stylebits #main.DROWCz, _ES_RIGHT,0,0,0
textbox #main.DROWCz, 220, 70, 110, 30
stylebits #main.DROWPx, _ES_RIGHT,0,0,0
textbox #main.DROWPx, 330, 0, 110, 30
stylebits #main.DROWPy, _ES_RIGHT,0,0,0
textbox #main.DROWPy, 330, 35, 110, 30
stylebits #main.DROWPz, _ES_RIGHT,0,0,0
textbox #main.DROWPz, 330, 70, 110, 30
listbox #main.S1, SA$(),[Prm1],476,125,102,108
listbox #main.S2, SB$(),[Prm2],580,125,102,108
listbox #main.S3, SC$(),[Prm3],686,125,102,108
listbox #main.S4, SD$(),[Prm4],792,125,102,108
listbox #main.S5, SE$(),[Prm5],898,125,102,108
texteditor #main.PopUp, 500, 250, 475,350
graphicbox #main.Plot3, 476, 235, 525,405
Open "Liberty Basic GRBL GUI" for Window as #main
#main "trapclose [quit]"
oldtime=time$("ms")
etime=0 : lastsent=0
bucketdelay=15
[LoadMacros]
[Glog]
[ErrLoop1]
[LoopExit]
timer bucketdelay, [ckbuf]
wait
[ckbuf]
nowtime=time$("ms")
Qcnt=Qcnt+1
if Qcnt >99 then
x$=time$()
elapsedtime=(nowtime-oldtime)/1000
oldtime=time$("ms")
etime=etime+elapsedtime
mstime=int((etime/100)*10000)/10
Xtime$="<";x$;"> <";Qcnt;"> <";etime;"sec> <";mstime;"msTIC";">"
#main.GCwindow, Xtime$
print Xtime$
abc=abc+1
end if
if abc=3 then [quit]
if CommOpen=0 then [LoopExit]
[getbuffer]
[getmessage]
[loopx]
[PreProcess]
[StepWait]
[PrintResponse]
goto [LoopExit]
[ESTOP]
[quit]
close #main
END
|
| « Last Edit: Dec 25th, 2017, 11:39pm by xtal » |
Logged
|
|
|
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #40 on: Dec 25th, 2017, 11:56pm » |
|
After deleteing different combinations of buttons etc ,, the TIC value speeds up , but I think it's just because FORM OVERHEAD is being removed.
removing all except MENU and texteditor #main.WinStatus, 55,125, 420, 80 texteditor #main.GCwindow, 55, 210, 420, 260 Will give 15+ TIC value then adding 7 buttons TIC is 18+ adding 7 graphicboxes TIC is 20+ adding 5 listboxes TIC 15-16 adding 7 text boxes TIC 19+ adding 7 comboboxes TIC 17-18 adding 7 statictext TIC 18+ adding 7 style bits TIC 15+
It appears to me that the more you add to the form the more you increase the TIC value unless the print window is selected...
|
| « Last Edit: Dec 26th, 2017, 12:56am by xtal » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #41 on: Dec 26th, 2017, 10:20am » |
|
on Dec 25th, 2017, 11:27pm, xtal wrote:| Run program do nothing else program runs slow |
|
Results here, after commenting-out reference to non-existent bitmap (line 110):
Windows 10 laptop: <11:16:11> <100> <1.562sec> <15.6msTIC> <11:16:11> <101> <1.579sec> <15.7msTIC> <11:16:11> <102> <1.596sec> <15.9msTIC>
Windows 10 desktop: <11:27:28> <100> <1.612sec> <16.1msTIC> <11:27:28> <101> <1.626sec> <16.2msTIC> <11:27:28> <102> <1.641sec> <16.4msTIC>
Windows 7 desktop: <11:38:11> <100> <1.611sec> <16.1msTIC> <11:38:11> <101> <1.629sec> <16.2msTIC> <11:38:11> <102> <1.646sec> <16.4msTIC>
Windows XP desktop: <11:37:37> <100> <2.015sec> <20.1msTIC> <11:37:37> <101> <2.031sec> <20.3msTIC> <11:37:37> <102> <2.062sec> <20.6msTIC>
Windows 2000 laptop: <21:45:20> <100> <2.003sec> <20msTIC> <21:45:20> <101> <2.023sec> <20.2msTIC> <21:45:20> <102> <2.043sec> <20.4msTIC>
It's very rare that I get to fire up my Windows 2000 machine for testing, but it's pleasing to see that it still works well (LBB 3.04, the others are all up-to-date); note that its clock is not set - battery long since dead!
What are other people getting with the OP's latest program (to copy LBB's mainwin to the clipboard type Ctrl+Tab)?
Richard.
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #42 on: Dec 26th, 2017, 12:03pm » |
|
Win XP desktop <15:59:22> <100> <1.563sec> <15.6msTIC> <15:59:22> <101> <1.578sec> <15.7msTIC> <15:59:22> <102> <1.594sec> <15.9msTIC>
|
|
Logged
|
|
|
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #43 on: Dec 26th, 2017, 1:56pm » |
|
Interesting, I find little difference with or without BMP , and I do have the BMP...
My 2 core W10 pro with bmp approx 464ms without bmp approx 470 ms select print window = very big decrease 4 core - main unit W10 pro with bmp approx 469ms without bmp approx 266 ms select print window = very big decrease 4 core - adam W10 pro with bmp approx 21ms without bmp approx 20 ms select print window = can't select fast enough to test
6 core - mike W10 pro with bmp approx 26.5ms without bmp approx 26.5 ms select print window = 16.4 lucky select
Win XP laptop with bmp approx 75ms without bmp approx 83 ms select print window = can't select fast enough to test
Win 2000 server laptop with bmp approx 21ms without bmp approx 20 ms select print window = can't select fast enough to test
Richard it would be interesting to see what results you get with LB4 pro 4.5.1
If I increase the 100 loop counts from 3 to 30 it looks like the TIC value slowly grows on both Lb and LBB?
The following code give you 5 seconds to select the print window.. I still don't know WHY the slow tic growth
Code:
Open "Liberty Basic GRBL GUI" for Window as #main
#main "trapclose [quit]"
td = time$("milliseconds") +5000 ' delay 5 seconds to allow move window
while time$("milliseconds") < td '
wend
'
etime=0 : lastsent=0
bucketdelay=15
oldtime=time$("ms")
[LoadMacros]
[Glog]
[ErrLoop1]
[LoopExit]
timer bucketdelay, [ckbuf]
wait
[ckbuf]
nowtime=time$("ms")
x$=time$()
elapsedtime=(nowtime-oldtime)/1000
oldtime=nowtime
etime=etime+elapsedtime
mstime=int((etime/100)*10000)/10
Qcnt=Qcnt+1
if Qcnt >99 then
Xtime$="<";x$;"> <";Qcnt;"> <";etime;"sec> <";mstime;"msTIC";">"
#main.GCwindow, Xtime$
print Xtime$
abc=abc+1
end if
if abc=5 then [quit]
if CommOpen=0 then [LoopExit]
[getbuffer]
[getmessage]
[loopx]
[PreProcess]
[StepWait]
[PrintResponse]
goto [LoopExit]
[ESTOP]
[quit]
close #main
END
|
| « Last Edit: Dec 26th, 2017, 2:56pm by xtal » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #44 on: Dec 26th, 2017, 2:32pm » |
|
on Dec 26th, 2017, 1:56pm, xtal wrote:| If I increase the 100 loop counts fro 3 to 30 it looks like the TIC value slowly grows ? |
|
I'm not too sure what 'TIC' stands for, but your program is measuring the time taken for 100, 101, 102, 103... etc. timer 'ticks' so of course the value grows! By the time you are measuring 200 ticks the value is doubled.
Perhaps your calculation isn't what you intended it to be. To stop the final printed value growing you would need to change this line:
Code:mstime=int((etime/100)*10000)/10 to this:
Code:mstime=int((etime/Qcnt)*10000)/10 so that it divides the total elapsed time (etime) by the total number of timer ticks (Qcnt).
All my tests, and Anatoly's, confirm that LBB is working correctly. There is no trace of any 'slow down' even on the slowest PCs (and my Windows 2000 laptop is very slow). If you are getting different results you need to be looking locally for the cause.
Richard.
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #45 on: Dec 26th, 2017, 7:55pm » |
|
I'm not too sure what 'TIC' stands for too but if you just print elapsedtime you'll see it 15-16 ms. Sometimes 31-32
Interesting then I set bucketdelay=10 I got elapsedtime 15-16 ms, never 31-32.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #46 on: Dec 26th, 2017, 8:06pm » |
|
on Dec 26th, 2017, 7:55pm, tsh73 wrote:| I set bucketdelay=10 I got elapsedtime 15-16 ms, never 31-32. |
|
That's exactly what you would expect, isn't it? With bucketdelay=15 it's close to the minimum timer period (about 16 ms usually) so sometimes you get 16 and sometimes it creeps over the threshold and you get 32. When bucketdelay=10 it's well below the minimum, so you get 16 ms consistently.
I would expect that if you set bucketdelay=20 you will get 32 ms consistently.
Richard.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #47 on: Dec 26th, 2017, 8:14pm » |
|
>>I would expect that if you set bucketdelay=20 you will get 32 ms consistently. Yes, 31-32
|
|
Logged
|
|
|
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #48 on: Dec 26th, 2017, 8:52pm » |
|
TIC is my shorthand for clock tic
you know like TICK-TOCK-TICK-TOCK ;D
I have no idea why clicking the print window speeds up , but it does on more than 1 of my machines , maybe W10 build 15063 and 16299 compatability issue , who knows, I guess I'll have to stick with LB and the 8 additional dll files it generates. LBB was generating about 135k where as LB totals close to 2 meg...
Since I tweaked that test code and applied it to main pgm LB consistantly says 15.6 millisec on my main unit [if you are not clicking any thing] which is the one with the largest delay on LBB.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #49 on: Dec 26th, 2017, 9:18pm » |
|
on Dec 26th, 2017, 8:52pm, xtal wrote:| I have no idea why clicking the print window speeds up , but it does on more than 1 of my machines |
|
By "print window" I presume you mean the 'mainwin' (it helps understanding to use the correct terminology). What's interesting is not so much that clicking on it speeds things up, but that it's slow in the first place!
A possible explanation is that you've installed some non-standard utility on both machines, such as a shell extension or other productivity tool. What do the slow machines have in common that most PCs don't have?
Have you tried disabling your virus scanner? They can be responsible for all sorts of peculiar side-effects.
Quote:| I guess I'll have to stick with LB and the 8 additional dll files it generates. LBB was generating about 135k where as LB totals close to 2 meg... |
|
That's entirely up to you. Other people use LBB to build large commercial applications - I suppose Cabinet Planner is the best known example - and neither they nor their customers seem to be troubled by any similar effect.
Your profiler reports don't show anything 'wrong' as such, only that your program is spending more time in the WAIT statement than expected. So long as the serial input buffer doesn't overflow in that period, does it actually matter very much?
Since it's the WAIT that is affected, have you tried the same trick that is sometimes necessary in LB (for example when used with WMLiberty) which is to replace the WAIT with a SCAN/Sleep loop? Maybe that would make a difference:
Code:[waitnow]
scan
calldll #kernel32, "Sleep", 1 as long, r as void
goto [waitnow] Richard.
|
|
|
|
Rod
Full Member
member is offline


Gender: 
Posts: 110
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #50 on: Dec 27th, 2017, 3:23pm » |
|
I have had time to test and get the same results, the program runs at 16ms on my Win10 machine whether LB or LBB.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #51 on: Dec 27th, 2017, 6:02pm » |
|
on Dec 27th, 2017, 3:23pm, Rod wrote:| I have had time to test and get the same results, the program runs at 16ms on my Win10 machine whether LB or LBB. |
|
Thanks. It's pretty clear that the OP's 'problem' is very specific to a couple of his machines rather than being more general. I still think the likely explanation is that some third-party framework is installed that is changing the behavior of standard Windows controls.
If he still wants to use LBB I can think of three possible workarounds:
Replacing the WAIT with a SCAN/Sleep loop, as I suggested before, might help; this is the same fix as is sometimes necessary in LB 4 when used with the WMLiberty DLL. This code, or something similar, can be used instead of the WAIT:
Code:[waitnow]
scan
calldll #kernel32, "Sleep", 1 as long, r as void
goto [waitnow] Replacing the 'branch label' TIMER handler with a SUB handler might also be an effective cure (the WAIT is then only executed once!). It's more elegant to use a SUB handler, and it improves program structure, but unfortunately you can't (reliably) do so in LB 4 because of a bug. To implement this fix the TIMER statement must be changed as follows:
Code: and the handler changed into a SUB called ckbuf, terminating in END SUB rather than GOTO [LoopExit] of course. It may also require some variables being declared as globals.
It's misleading to describe the issue as LBB 'running slow'. What is actually happening is that when there's nothing for the program to do - so a WAIT is executed - it is taking longer to resume normal execution than expected. The possible throughput of the program isn't actually reduced, but it would mean processing the incoming serial data less frequently but in bigger chunks. If this less frequent processing is acceptable it may not be necessary to make any changes, other than perhaps setting Com to increase the size of the serial buffer. I will be interested to learn whether the OP finds one of these effective.
Richard.
|
|
|
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #52 on: Dec 28th, 2017, 12:25am » |
|
Form part 1 Code:
[WindowSetup]
''NOMAINWIN
WindowWidth = 1020 : WindowHeight = 700 '877
UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
Menu #main, "DROreset", "Reset MPX", [ZX], "Reset MPY", [MZY], "Reset MPZ", [MZZ], "ResetALL", [MZR]
Menu #main, "HELP", "Q/A.txt", [HELPx],"LibertyBasic.chm",[HELPchm],"LB-Forum",[HELPforum]
[ControlSetup]
statictext #main.statictext2, "MPOS", 60, 105, 40, 20
button #main.hle, "Hard Limits",[HLTOGGLE], UL, 100, 103, 60, 20
graphicbox #main.HLimit, 165, 103, 35, 20
statictext #main.statictext3, "WCO", 230, 105, 25, 20
statictext #main.statictext4, "WPOS", 350, 105, 40, 20
button #main.button5, "$RST=$",[RSTdollar], UL, 5, 0, 45, 20
button #main.button6, "$RST=#",[RSTnumber], UL, 5, 25, 45, 20
button #main.button7, "$RST=*",[RSTastric], UL, 5, 50, 45, 20
button #main.button8, "$SLP",[SLP], UL, 5, 75, 45, 20
button #main.buttonx, "$G val", [GGG], UL, 5, 100, 45, 20
button #main.buttony, "$# GC ", [NBR], UL, 5, 125, 45, 20
button #main.button9, " win$ ",[button9], UL, 5, 150, 45, 20
button #main.button10, " WIN$ ",[button10], UL, 5, 175, 45, 20
button #main.button11, " ? ", [STATUS], UL, 5, 200, 45, 20
button #main.Ncode, "$N 1st", [NCMD], UL, 5, 225, 45, 20
button #main.Ccode, "$C chk", [CCMD], UL, 5, 250, 45, 20
button #main.info, "$I Info", [INFO], UL, 5, 275, 45, 20
button #main.help, "$ Help ", [HELP], UL, 5, 300, 45, 20
button #main.ALRReset, "$X ALR", [XCMD], UL, 5, 325, 45, 20
button #main.home, "$H Hm", [HOME], UL, 5, 350, 45, 20
button #main.softReset, "Ctl-X ", [softRest], UL, 5, 375, 45, 20
button #main.params,"$$ Stat", [PARAMS], UL, 5, 400, 45, 20
button #main.Resume, "Resume", [RESUME], UL, 5, 425, 45, 20
button #main.Pause, "Pause", [PAUSE], UL, 5, 450, 45, 20
textbox #main.ManualTx, 5, 475, 470, 20
button #main.Enter,"",[Enter],UL,473,475,5,20
button #main.ManualSend, "SEND COMMANDS", [SEND], UL, 190, 500, 180, 20
button #main.JXplus, "X ++", [JogXP], UL, 5, 495, 55, 20
button #main.JYplus, "Y ++", [JogYP], UL, 65, 495, 55, 20
button #main.JZplus, "Z ++", [JogZP], UL, 125, 495, 55, 20
button #main.JXPa,"+",[JXPa],UL,5,515,12,13
button #main.JXPb,"+",[JXPb],UL,16,515,12,13
button #main.JXPc,"+",[JXPc],UL,27,515,12,13
button #main.JXPd,"+",[JXPd],UL,38,515,12,13
button #main.JXPe,"+",[JXPe],UL,49,515,12,13
stylebits #main.JX, _ES_CENTER,0,0,0
textbox #main.JX, 5, 528, 55, 20
button #main.JXMa,"--",[JXMa],UL,5,549,12,13
button #main.JXMb,"--",[JXMb],UL,16,549,12,13
button #main.JXMc,"--",[JXMc],UL,27,549,12,13
button #main.JXMd,"--",[JXMd],UL,38,549,12,13
button #main.JXMe,"--",[JXMe],UL,49,549,12,13
button #main.JYPa,"+",[JYPa],UL,65,515,12,13
button #main.JYPb,"+",[JYPb],UL,76,515,12,13
button #main.JYPc,"+",[JYPc],UL,87,515,12,13
button #main.JYPd,"+",[JYPd],UL,98,515,12,13
button #main.JYPe,"+",[JYPe],UL,109,515,12,13
stylebits #main.JY, _ES_CENTER,0,0,0
textbox #main.JY, 65, 528, 55, 20
button #main.JYMa,"--",[JYMa],UL,65,549,12,13
button #main.JYMb,"--",[JYMb],UL,76,549,12,13
button #main.JYMc,"--",[JYMc],UL,87,549,12,13
button #main.JYMd,"--",[JYMd],UL,98,549,12,13
button #main.JYMe,"--",[JYMe],UL,109,549,12,13
button #main.JZPa,"+",[JZPa],UL,125,515,12,13
button #main.JZPb,"+",[JZPb],UL,136,515,12,13
button #main.JZPc,"+",[JZPc],UL,147,515,12,13
button #main.JZPd,"+",[JZPd],UL,158,515,12,13
button #main.JZPe,"+",[JZPe],UL,169,515,12,13
stylebits #main.JZ, _ES_CENTER,0,0,0
textbox #main.JZ, 125, 528, 55, 20
button #main.JZMa,"--",[JZMa],UL,125,549,12,13
button #main.JZMb,"--",[JZMb],UL,136,549,12,13
button #main.JZMc,"--",[JZMc],UL,147,549,12,13
button #main.JZMd,"--",[JZMd],UL,158,549,12,13
button #main.JZMe,"--",[JZMe],UL,169,549,12,13
button #main.JXminus, "X ---", [JogXM], UL,5, 563, 55, 20
button #main.JYminus, "Y ---", [JogYM], UL,65, 563, 55, 20
button #main.JZminus, "Z ---", [JogZM], UL,125, 563, 55, 20
button #main.JXFa,"+",[JXFa],UL,5,585,14,13
button #main.JXFb,"+",[JXFb],UL,18,585,14,13
button #main.JXFc,"+",[JXFc],UL,31,585,14,13
button #main.JXFd,"+",[JXFd],UL,44,585,14,13
stylebits #main.JXF, _ES_CENTER,0,0,0
textbox #main.JXF, 5, 600, 55, 22
button #main.JXFe,"--",[JXFe],UL,5,624,14,13
button #main.JXFf,"--",[JXFf],UL,18,624,14,13
button #main.JXFg,"--",[JXFg],UL,31,624,14,13
button #main.JXFh,"--",[JXFh],UL,44,624,14,13
button #main.JYFa,"+",[JYFa],UL,65,585,14,13
button #main.JYFb,"+",[JYFb],UL,78,585,14,13
button #main.JYFc,"+",[JYFc],UL,91,585,14,13
button #main.JYFd,"+",[JYFd],UL,104,585,14,13
stylebits #main.JYF, _ES_CENTER,0,0,0
textbox #main.JYF, 65, 600, 55, 22
button #main.JYFe,"--",[JYFe],UL,65,624,14,13
button #main.JYFf,"--",[JYFf],UL,78,624,14,13
button #main.JYFg,"--",[JYFg],UL,91,624,14,13
button #main.JYFh,"--",[JYFh],UL,104,624,14,13 '
button #main.JZFa,"+",[JZFa],UL,125,585,14,13
button #main.JZFb,"+",[JZFb],UL,138,585,14,13
button #main.JZFc,"+",[JZFc],UL,151,585,14,13
button #main.JZFd,"+",[JZFd],UL,164,585,14,13
stylebits #main.JZF, _ES_CENTER,0,0,0
textbox #main.JZF, 125, 600, 55, 22
button #main.JZFe,"--",[JZFe],UL,125,624,14,13
button #main.JZFf,"--",[JZFf],UL,138,624,14,13
button #main.JZFg,"--",[JZFg],UL,151,624,14,13
button #main.JZFh,"--",[JZFh],UL,164,624,14,13
texteditor #main.WinStatus, 55,125, 420, 80
texteditor #main.GCwindow, 55, 210, 420, 260
''''bmpbutton #main.EMRRESET, BMPdir$;"estop6.bmp",[ESTOP],UL, 188,575 '*********
button #main.M5, "M3", [M3], UL, 290, 580, 30, 20
button #main.M5, "M5", [M5], UL, 290, 605, 30, 20
button #main.Connect, "CONNECT", [CONNECT], UL, 375, 500, 60, 20
button #main.Connect, "Scan", [ScanPorts], UL, 440, 500, 35, 20
combobox #main.CommPort, port$(), [portclick], 375, 525, 60, 20
combobox #main.Baudrate, baud$(), [BaudSel], 375, 550, 60, 20
button #main.Disconnect, "HANG UP", [DISCONNECT], UL, 375, 575, 60, 20
stylebits #main.Mag1, _ES_CENTER,0,0,0
textbox #main.Mag1, 435, 575, 40, 20
button #main.rtz, "RTNZERO", [Ret2ZERO], UL, 375, 600, 60, 30
button #main.magnify, "MAG",[MAGNIFY],UL,435,600,40,30
stylebits #main.PLOTa, _ES_CENTER,0,0,0
textbox #main.PLOTa, 435, 525, 40, 20
button #main.plotting, "PLOT",[PLOTXY],UL,435,550,40,20
graphicbox #main.Status, 188, 522, 180, 50
TextboxColor$ = "yellow"
textbox #main.Comx, 320,580,50,20
textbox #main.Baud, 320,605,50,20
TextboxColor$ = "white"
button #main.park, "Park", [PARK], UL, 445, 0, 40, 20
button #main.mac1, "Mac1", [mac1], UL, 485, 0, 40, 20
button #main.mac2, "Mac2", [mac2], UL, 525, 0, 40, 20
button #main.mac3, "Mac3", [mac3], UL, 565, 0, 40, 20
button #main.mac4, "Mac4", [mac4], UL, 605, 0, 40, 20
button #main.mac5, "Mac5", [mac5], UL, 645, 0, 40, 20
button #main.mac6, "Mac6", [mac6], UL, 687, 0, 40, 20
button #main.mac7, "Mac7", [mac7], UL, 728, 0, 40, 20
button #main.mac8, "Mac8", [mac8], UL, 773, 0, 40, 20
button #main.mac9, "Mac9", [mac9], UL, 818, 0, 40, 20
button #main.X1,"ScrT1",[SCRa],UL, 860,0,40,20
button #main.X2,"ScrT2",[SCRb],UL, 900,0,40,20
button #main.X3,"ScrT3",[SCRc],UL, 860,25,40,20
button #main.X4,"ScrT4",[SCRd],UL, 900,25,40,20
button #main.X5,"ScrT5",[SCRe],UL, 860,49,40,20
button #main.X6,"ScrT6",[SCRf],UL, 900,49,40,20
button #main.X7,"ScrT7",[SCRg],UL, 860,75,40,20
button #main.X8,"PLOT",[PLOTTING],UL, 900,75,40,20
graphicbox #main.PlotIndicator, 900,69,40,6
button #main.X9,"P I P",[PIP],UL, 860,104,40,20
button #main.X10,"Log",[LOG],UL, 900,104,40,20
graphicbox #main.LogIndicator, 900,97,40,6
button #main.mac10, "MP_1", [macP1], UL, 445, 25, 40, 20
button #main.mac11, "MP_2", [macP2], UL, 485, 25, 40, 20
button #main.mac12, "MP_3", [macP3], UL, 525, 25, 40, 20
button #main.mac10, "MP_4", [macP4], UL, 565, 25, 40, 20
button #main.mac10, "Level T", [macP5], UL, 605, 25, 40, 20
button #main.mac10, "Drill T",[macP6] , UL, 645, 25, 40, 20
button #main.maca, "AtoolZ", [AutoTZ], UL, 685, 25, 40, 20
button #main.macb, "SaveM", [SaveM], UL, 725, 25, 40, 20
combobox #main.ldmac, lac$(),[ldmac],765,25,50,20
combobox #main.svmac, mac$(),[svmac],817,25,42,20
button #main.LdGcode, "Opn GCode", [OpenCode], UL, 940, 0, 62, 20
button #main.RunGcode, "Run GCode", [RunCode], UL, 940, 25, 62, 20
button #main.buttonx, "Step GCode", [StepGC], UL, 940, 49, 62, 20
button #main.buttony, "Cls GCode",[CloseGC], UL, 940, 75, 62, 20
button #main.EditGcode, "Edt GCode", [EditCode], UL, 940,104, 62, 20
|
|
Logged
|
|
|
|
xtal
New Member
member is offline


Gender: 
Posts: 27
|
 |
Re: LBB runs 7 times slower than LB on my GBRL-Sen
« Reply #53 on: Dec 28th, 2017, 12:32am » |
|
Part 2
Code:
button #main.path,"<Path$>",[PathClr],UL, 445,70,50,16
graphicbox #main.PathBox, 445,48,413,20
statictext #main.drive, "Drive",415,104,30,16
combobox #main.drvbox, drv$(), comboClick,445,105,50,25
ComboboxColor$ = "yellow"
combobox #main.selbox1, fdr$(),comboClick,500,104,358,2
ComboboxColor$ = "green"
combobox #main.selbox2, fil$(),comboClick,500,104,358,2
graphicbox #main.Fdrbox,445,87,72,17
button #main.yellow,"Folder", comboClick,UL,455,89,45,12
graphicbox #main.Filebox,525,87,72,17
button #main.green,"File",comboClick,UL,535,89,45,12
statictext #main.nbrfdrname, "#Fdr's",500,70,30,14
textbox #main.nbrfdr, 535,69,30,17
statictext #main.nbrfilename, "#File's",570,70,30,14
textbox #main.nbrfile, 605,69,50,17
statictext #main.FilLen, "#FileLen", 660,69,50,14
textbox #main.fbox, 710,69,68,17
button #main.MZX, "Zx", [MZX], UL, 165, 0, 30, 30
button #main.MZY, "Zy", [MZY], UL, 165, 35, 30, 30
button #main.MZZ, "Zz", [MZZ], UL, 165, 70, 30, 30
button #main.MZR, "ZR", [MZR], UL, 195, 0, 25, 100
stylebits #main.DROMPx, _ES_RIGHT,0,0,0
textbox #main.DROMPx, 55, 0, 110, 30
stylebits #main.DROMPy, _ES_RIGHT,0,0,0
textbox #main.DROMPy, 55, 35, 110, 30
stylebits #main.DROMPz, _ES_RIGHT,0,0,0
textbox #main.DROMPz, 55, 70, 110, 30
stylebits #main.DROWCx, _ES_RIGHT,0,0,0
textbox #main.DROWCx, 220, 0, 110, 30
stylebits #main.DROWCy, _ES_RIGHT,0,0,0
textbox #main.DROWCy, 220, 35, 110, 30
stylebits #main.DROWCz, _ES_RIGHT,0,0,0
textbox #main.DROWCz, 220, 70, 110, 30
stylebits #main.DROWPx, _ES_RIGHT,0,0,0
textbox #main.DROWPx, 330, 0, 110, 30
stylebits #main.DROWPy, _ES_RIGHT,0,0,0
textbox #main.DROWPy, 330, 35, 110, 30
stylebits #main.DROWPz, _ES_RIGHT,0,0,0
textbox #main.DROWPz, 330, 70, 110, 30
listbox #main.S1, SA$(),[Prm1],476,125,102,108
listbox #main.S2, SB$(),[Prm2],580,125,102,108
listbox #main.S3, SC$(),[Prm3],686,125,102,108
listbox #main.S4, SD$(),[Prm4],792,125,102,108
listbox #main.S5, SE$(),[Prm5],898,125,102,108
texteditor #main.PopUp, 500, 250, 475,350
graphicbox #main.Plot3, 476, 235, 525,405
'------- added for test ?Delay and TicMs
graphicbox #main.BMPB, 188, 575, 100, 65
button #main.CLO, "CLOSE", [quit], UL, 198, 584, 80, 25
button #main.STP, "E-STOP", [ESTOP], UL, 198, 606, 80, 25
statictext #main.Dly0,"?Delay", 600,87,35,17
textbox #main.Dly1, 640,87,25,17
statictext #main.Tic0,"TicMS", 670,87,35,17
textbox #main.Tic1, 710,87,45,17
Open "Liberty Basic GRBL GUI" for Window as #main
#main "trapclose [quit]"
#main.Filebox, "fill green"
#main.Fdrbox, "fill yellow"
#main.Filebox, "fill green"
#main.BMPB, "fill red"
#main.yellow,"!font roman 6 10"
#main.green,"!font roman 6 10"
td = time$("milliseconds") +5000
while time$("milliseconds") < td
wend
etime=0 : lastsent=0
bucketdelay=15
oldtime=time$("ms")
[LoadMacros]
[Glog]
[ErrLoop1]
[LoopExit]
timer bucketdelay, [ckbuf]
wait
[ckbuf]
Qcnt=Qcnt+1
nowtime=time$("ms")
x$=time$()
elmstime=nowtime-oldtime
elapsedtime=(elmstime)/1000
oldtime=nowtime
etime=etime+elapsedtime
ztime=int((etime/Qcnt)*10000)/10
#main.Dly1, int(ztime)
#main.Tic1, ztime
#main.ManualTx,int(ztime);" - ";ztime
if Qcnt >99 then
mstime=int((etime/100)*10000)/10
Xtime$="<";x$;"> <";Qcnt;"> <";etime;"sec> <";mstime;"msTIC";">"
#main.GCwindow, Xtime$
print Xtime$
Qcnt=0 : etime=0
abc=abc+1
end if
if abc=15 then [quit]
if CommOpen=0 then [LoopExit]
[getbuffer]
[getmessage]
[loopx]
[PreProcess]
[StepWait]
[PrintResponse]
goto [LoopExit]
[ESTOP]
[quit]
close #main
END
Changed BMPBUTTON added ?Delay text box and TicMS textbox
added code to write to ?Delay, TicMS, ManualTx boxes
These all dislpay in LB only ManualTx displays in LBB Also Folder [green] & File [yellow] not displaying very well ?font
Program run after 5 sec LBB will see only ManualTx data
Looking into trying subroutine , it would be pretty big though...
|
| « Last Edit: Dec 28th, 2017, 12:41am by xtal » |
Logged
|
|
|
|
|