View previous topic :: View next topic |
Author |
Message |
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Thu Oct 15, 2020 11:01 pm Post subject: Printbin #4 limitation |
|
|
Hello,
Exists a quantity limitation of bytes with Printbin #n?
I can use 88 bytes maximal, is there a limitation?
Use Bascom 2.0.8.2
Regards
P_Santos
(BASCOM-AVR version : 2.0.8.2 , Latest : 2.0.8.3 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Oct 16, 2020 11:39 am Post subject: Re: Printbin #4 limitation |
|
|
P_Santos wrote: | is there a limitation? |
Did you find any described in the help? |
|
Back to top |
|
|
Evert :-)
Joined: 18 Feb 2005 Posts: 2156
|
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Oct 16, 2020 1:18 pm Post subject: |
|
|
Evert wrote: | Without sample code it's hard to test. |
Without sample code and proof, the likelihood is almost hundred percent that the limiting factor sits in front of the screen. |
|
Back to top |
|
|
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Fri Oct 16, 2020 3:40 pm Post subject: |
|
|
Hello,
Here a testcode, please try to uncomment five_b the last var on Printbin
The compile error
Error : 34 Line : 30 Invalid number of parameters [ _PARAM ; ONE ; TWO ; THREE ; FOUR ; FIVE ; SIX ; SEVEN ; EIGHT ; NINE ; TEN ; ELEVEN ; TWELVE ; THIRTEEN ; FOURTENN ; FIFTEEN ; SIXTEEN ; SEVETEEN_EIGHTEEN ; NINETEEN ; TWENTY ; TWENTY_ONE ; TWENTY_TWO ; TWENTY_THREE ; TWENTY_FOUR ; TWENTY_FIVE ; TWENTY_SIX ; TWENTY_SEVEN_EIGHT ; TWENTY_NINE ; THIRTY ; THIRTY_ONE ; THIRTY_TWO ; THIRTY_THREE_FOUR ; THIRTY_FIVE ; THIRTY_SIX ; THIRTY_SEVEN ; THIRTY_EIGHT ; THIRTY_NINE ; FORTY ; STRTABEL ; SEVENTY_THREE ; SEVENTY_FOUR ; SEVENTY_FIVE ; SEVENTY_SIX ; SEVENTY_SEVEN_EIGHT ; SEVENTY_NINE_EIGTHY ; ONEB ; TWO_B ; THREE_B ; FOUR_B ; FIVE_B] , in File : C:\Users\HP\Desktop\Dev_08-2020\Test_Printbin.bas
$hwstack = 120
$swstack = 120
$framesize = 120
$regfile = "m644Pdef.DAT"
$crystal = 7372800
$baud = 38400
Dim _param As Byte
Dim One As Byte , Two As Byte , Three As Byte , Four As Byte , Five As Byte , Six As Byte , Seven As Byte , Eight As Byte
Dim Nine As Byte , Ten As Byte , Eleven As Byte , Twelve As Byte , Thirteen As Byte , Fourtenn As Word , Fifteen As Word
Dim Sixteen As Byte , Seveteen_eighteen As Word , Nineteen As Byte , Twenty As Byte
Dim Twenty_one As Byte , Twenty_two As Byte , Twenty_three As Byte , Twenty_four As Byte , Twenty_five As Byte
Dim Twenty_six As Byte , Twenty_seven_eight As Word , Twenty_nine As Byte , Thirty As Byte
Dim Thirty_one As Byte , Thirty_two As Byte , Thirty_three_four As Word , Thirty_five As Byte , Thirty_six As Byte
Dim Thirty_seven As Byte , Thirty_eight As Byte , Thirty_nine As Byte , Forty As Byte
Dim Strtabel As String * 32 , Seventy_three As Byte , Seventy_four As Byte , Seventy_five As Byte , Seventy_six As Byte
Dim Seventy_seven_eight As Word , Seventy_nine_eigthy As Word , Oneb As Byte , Two_b As Byte , Three_b As Byte
Dim Four_b As Byte , Five_b As Byte
Config Com1 = 38400 , Synchrone = 0 , Parity = None , Stopbits = 1 , Databits = 8 , Clockpol = 0
Open "Com1:" For Binary As #4
'PD.0=RXD0 - PD.1=TXD0
Config Print0 = Portd.4 , Mode = Set '
Config Portd.4 = Output
Printbin #4 , _param ; One ; Two ; Three ; Four ; Five ; Six ; Seven ; Eight ; Nine ; Ten ; Eleven ; Twelve ; Thirteen ; _
Fourtenn ; Fifteen ; Sixteen ; Seveteen_eighteen ; Nineteen ; Twenty ; Twenty_one ; Twenty_two ; _
Twenty_three ; Twenty_four ; Twenty_five ; Twenty_six ; Twenty_seven_eight ; Twenty_nine ; Thirty ; _
Thirty_one ; Thirty_two ; Thirty_three_four ; Thirty_five ; Thirty_six ; Thirty_seven ; Thirty_eight ; _
Thirty_nine ; Forty ; Strtabel ; Seventy_three ; Seventy_four ; Seventy_five ; Seventy_six ; _
Seventy_seven_eight ; Seventy_nine_eigthy ; Oneb ; Two_b ; Three_b ; Four_b '; Five_b
End
Regards
P_Santos |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
|
Back to top |
|
|
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Fri Oct 16, 2020 7:00 pm Post subject: |
|
|
Hello Duval JP,
Thanks for try help
yes, i know about arrays, it only to easy demonstrate the problem
but the Config Serialout = Buffered , Size = 150 not fix the compile error.
My programm donīt have problem than i use less then this quantities of variables, the issue is if anyone need send more bytes, perhaps Mark can say a little about this
Regards
P_Santos |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Fri Oct 16, 2020 7:14 pm Post subject: |
|
|
P_Santos wrote: | Code: | Printbin #4 , _param ...; Four_b |
| Nobody needs such code nonsense.
Your post:
Quote: | Exists a quantity limitation of bytes with Printbin #n? | was misleading, it's not 'bytes', it's 'variables', huge difference to understand.
As Printbin does not send any LF/CR, more variables than accepted by one Printbin can be broken up into several Printbins. |
|
Back to top |
|
|
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Fri Oct 16, 2020 8:02 pm Post subject: |
|
|
Hello MWS,
Nobody needs such code nonsense??
The workarround is like you say to brocken it in more printbin
Regards
P_Santos |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Oct 16, 2020 8:16 pm Post subject: |
|
|
Indeed MWS is right.
You mean arguments. When is it sufficient for you ? At 100 or 1000 or 1000000 ?
There are way better ways to do what you do.
Use an array as JP suggest. Or better when you used mixed types : use an overlayed byte array. then you only have to use ONE printbin statement !
This will decrease code as well. because what you do will bloat code as each time the variable address need to be loaded. with an OVERLAY array this only has to be done once.
And as MWS also suggests : you can break up your code if you want to do it the hard way. _________________ Mark |
|
Back to top |
|
|
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Fri Oct 16, 2020 9:56 pm Post subject: |
|
|
Hello,
Thanks for the explanation
Regards
P_Santos |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Sat Oct 17, 2020 12:46 pm Post subject: |
|
|
albertsm wrote: | use an overlayed byte array. |
Code: | $Regfile="m328def.dat"
$Crystal=4000000
$hwstack=40
$swstack=16
$framesize=32
$baud=9600
' var block start
Dim A As Byte
Dim W As Word
Dim S As Single
Dim Strdata As String * 20
Dim VarEndAdr as Byte ' used to calculate memory end address of var block
' var block end
A = 70
W = 32768
S = 3.14159
Strdata = "TEST123"
Const Var_Start = VarPtr("A") ' get memory address of start var "A"
Const Var_End = VarPtr("VarEndAdr") ' get last memory address of end var "Strdata" + 1
Const Var_Size = Var_End - Var_Start - 1 ' calculate size, exclude helper var "VarEndAdr"
Dim VarArray(Var_Size) as Byte At A Overlay ' overlaid byte array over var block
Printbin VarArray(1)
end |
|
|
Back to top |
|
|
P_Santos
Joined: 07 Jul 2011 Posts: 114
|
Posted: Sun Oct 18, 2020 11:23 am Post subject: |
|
|
Hello MWS,
Very elegant way
Regards
P_Santos |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
|