Additional library for MikroBasic PRO 2009
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
Florin,
I have just used wireshark to monitor the activities of Send_TCP and Eth_UserTCP... and i found out that the delay is mainly due to Send_TCP.
When i call Send_TCP... it takes quite a while for Send_TCP to respond and always 2nd retransmit to get through. Every retransmit will give me another delay.
But when i reinstall the older version, Send_TCP responded almost immediately and the data got through also on every 2nd retransmit. But due to the immediate response from Send_TCP, the delay is not that critical.
Maybe you may give it a try on fixing the Send_TCP instead.
p/s: Why every 2nd retransmit will only get the data through?
Thanks.
I have just used wireshark to monitor the activities of Send_TCP and Eth_UserTCP... and i found out that the delay is mainly due to Send_TCP.
When i call Send_TCP... it takes quite a while for Send_TCP to respond and always 2nd retransmit to get through. Every retransmit will give me another delay.
But when i reinstall the older version, Send_TCP responded almost immediately and the data got through also on every 2nd retransmit. But due to the immediate response from Send_TCP, the delay is not that critical.
Maybe you may give it a try on fixing the Send_TCP instead.
p/s: Why every 2nd retransmit will only get the data through?
Thanks.
Please make for me an example to illustrate this problem, because I can't catch this... here all works OK, without delay...stevenindon wrote: I have just used wireshark to monitor the activities of Send_TCP and Eth_UserTCP... and i found out that the delay is mainly due to Send_TCP.
When i call Send_TCP... it takes quite a while for Send_TCP to respond and always 2nd retransmit to get through. Every retransmit will give me another delay.
Please send example to florin@microelemente.ro
Thanks.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
OKstevenindon wrote:Florin,
Attached example and library sent to your email for test and review.
Thank you for all your great support.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
Re: Additional library for MikroBasic PRO 2009
Ethernet library updated, both ENC28J60 and PIC18F97J60 family.
Now, library can receive UDP broadcast packets and can insert dynamic string variables in HTML code.
1. UDP broadcast
- can be enabled or disabled via udp_broadcast flag.
this flag is default false and can be activated after Eth_Init routine.
- when one UDP broadcast packet is received, this arrive in Eth_UserUDP routine and a new flag broadcast_packet become true. For non broadcast packet, this flag have false state.
2. Dynamic string variables in HTML code
- added a new value for Socket.RAM_ROM, this is 2.
- when Socket[j].RAM_ROM = 2, MCU will search in HTML const after "@" char. This must be followed by two numbers from 00 to 99.
- user must make a table (word[x]) with string variables address. When MCU will found "@00" will copy in ETH mem, the string that have start address located in first location of array of word table.
- this table must be compiled with absolute directive and the start address of table must be initialized in dynamic_var_addr variable.
Library here : http://www.microelemente.ro/MikroBasic/ ... y_V1_4.zip
Now, library can receive UDP broadcast packets and can insert dynamic string variables in HTML code.
1. UDP broadcast
- can be enabled or disabled via udp_broadcast flag.
this flag is default false and can be activated after Eth_Init routine.
Code: Select all
Eth_Init
udp_broadcast = true
2. Dynamic string variables in HTML code
- added a new value for Socket.RAM_ROM, this is 2.
- when Socket[j].RAM_ROM = 2, MCU will search in HTML const after "@" char. This must be followed by two numbers from 00 to 99.
- user must make a table (word[x]) with string variables address. When MCU will found "@00" will copy in ETH mem, the string that have start address located in first location of array of word table.
- this table must be compiled with absolute directive and the start address of table must be initialized in dynamic_var_addr variable.
Code: Select all
dim dat4 as string[10]
dat5 as string[5]
dat9 as string[10]
dat10 as string[5]
my_dynamic_var as word[4] absolute $100
...
sub procedure Init_dynamic_var
my_dynamic_var[0] = word(@dat4)
my_dynamic_var[1] = word(@dat5)
my_dynamic_var[2] = word(@dat9)
my_dynamic_var[3] = word(@dat10)
end sub
...
Eth_Init
dynamic_var_addr = $100 ' after Eth_Init...
Init_dynamic_var
Code: Select all
sub procedure HTTPProcDataIn(dim len_ as word, dim j as byte)
dim i as byte
getRequest,txt31 as string[32]
if len_ > 32 then len_ = 32 end if
CopyEthMem_CPToRam(word(@getRequest), len_)
txt31 = httpMethod
if Mem_Cmp(word(@getRequest), word(@txt31), Str_Len(txt31)) <> 0 then exit end if ' only GET method is supported here
Socket[j].RAM_ROM = 2 ' here ....
Socket[j].Keep_Alive = false
Socket[j].Start_addr = @indexPage1
Socket[j].Stop_addr = @indexPage1 + indexPage1_len
end sub
Code: Select all
'<table width="100%" cellspacing="0">'+
'<tr>'+
'<td class="gensmall">Last visit was: @00 </td>'+ ' MCU will put instead of @00, string dat4
'<td class="gensmall" align="right">It is currently @01 <br /></td>'+ ' MCU will put instead of @00, string dat5
'</tr>'+
'</table>'
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
Re: Additional library for MikroBasic PRO 2009
Florin,
Both functions are really so useful!... especially dynamic string variables in HTML code.
Now we dont even have to use jscript to put in values in our html pages. Cool!
Thanks for the update
Great job!
Both functions are really so useful!... especially dynamic string variables in HTML code.
Now we dont even have to use jscript to put in values in our html pages. Cool!
Thanks for the update
Great job!
Re: Additional library for MikroBasic PRO 2009
Florin,
Thanks too much for your libraries .. but I was working for long time with mikroC
Does your compiled library (.mcl) works with mikroC PRO ?? if not, do you have an example about making a web client app with mikroC ??
Best regards
Thanks too much for your libraries .. but I was working for long time with mikroC
Does your compiled library (.mcl) works with mikroC PRO ?? if not, do you have an example about making a web client app with mikroC ??
Best regards
Re: Additional library for MikroBasic PRO 2009
Well, I can't answer at this question, only Mikroe team can do this...HMA wrote: Thanks too much for your libraries .. but I was working for long time with mikroC
Does your compiled library (.mcl) works with mikroC PRO ?? if not, do you have an example about making a web client app with mikroC ??
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Re: Additional library for MikroBasic PRO 2009
Hi Florin
I know it is much to ask but does the new lib include documentation for the lib as I still use your previous lib with its documents and examples
Best Regards
Peter
I know it is much to ask but does the new lib include documentation for the lib as I still use your previous lib with its documents and examples
Best Regards
Peter
P.Erasmus
Saratov,Russia
--------------------------------------------------------------
Saratov,Russia
--------------------------------------------------------------
Re: Additional library for MikroBasic PRO 2009
Hello Peter,p.erasmus wrote:I know it is much to ask but does the new lib include documentation for the lib as I still use your previous lib with its documents and examples
I will try to update documentations and make examples, in MikroPascal only, no time for MikroBasic, sorry.
Best regards, Florin Andrei Medrea.
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/
mail : florin@microelemente.ro
Re: Additional library for MikroBasic PRO 2009
Florin
The documentation is for me the most important to track the changes and new features
examples not so important as I use in any case Basic
Thank you very much
Florin
The documentation is for me the most important to track the changes and new features
examples not so important as I use in any case Basic
Thank you very much
Florin
P.Erasmus
Saratov,Russia
--------------------------------------------------------------
Saratov,Russia
--------------------------------------------------------------
-
- Posts: 466
- Joined: 18 Apr 2008 03:46
Re: Additional library for MikroBasic PRO 2009
p.erasmus,
I guess by looking at example and documents programmed in Pascal, you are able to figure out how to use those functions (Thats what i do).
You just need to know how to call them anyway...
I guess by looking at example and documents programmed in Pascal, you are able to figure out how to use those functions (Thats what i do).
You just need to know how to call them anyway...
Re: Additional library for MikroBasic PRO 2009
stevenindon
Yes that is true I need only the docs as there I see how to call them and then Florin made some changes to the
ethernet lib so I would like to see what is new in the Ethernet Lib
Regards
Yes that is true I need only the docs as there I see how to call them and then Florin made some changes to the
ethernet lib so I would like to see what is new in the Ethernet Lib
Regards
P.Erasmus
Saratov,Russia
--------------------------------------------------------------
Saratov,Russia
--------------------------------------------------------------