Additional library for MikroBasic PRO 2009

General discussion on mikroBasic PRO for PIC.
Post Reply
Author
Message
stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

#61 Post by stevenindon » 28 Jan 2010 18:04

Florin,

Eth_UserTCP will still return something even tho i dont call Do_EthernetProc() in the loop?

I just remarked Do_EthernetProc()... and it still work.

:roll:

stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

#62 Post by stevenindon » 28 Jan 2010 19:37

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.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#63 Post by yo2lio » 31 Jan 2010 17:11

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 make for me an example to illustrate this problem, because I can't catch this... here all works OK, without 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

stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

#64 Post by stevenindon » 02 Feb 2010 18:43

Florin,

Attached example and library sent to your email for test and review.


Thank you for all your great support.

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

#65 Post by yo2lio » 02 Feb 2010 19:09

stevenindon wrote:Florin,

Attached example and library sent to your email for test and review.

Thank you for all your great support.
OK
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

stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

#66 Post by stevenindon » 04 Feb 2010 06:38

Florin,

Thanks for the update through email. Problem solved!

Now my TCP client runs perfectly!!


Thanks again

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Re: Additional library for MikroBasic PRO 2009

#67 Post by yo2lio » 09 Mar 2010 23:06

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.

Code: Select all

  Eth_Init
  udp_broadcast = true 
- 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.

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>'
Library here : http://www.microelemente.ro/MikroBasic/ ... y_V1_4.zip
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

stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

Re: Additional library for MikroBasic PRO 2009

#68 Post by stevenindon » 11 Mar 2010 05:35

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!

HMA
Posts: 2
Joined: 09 Feb 2010 08:03

Re: Additional library for MikroBasic PRO 2009

#69 Post by HMA » 13 Mar 2010 16:30

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 :D

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Re: Additional library for MikroBasic PRO 2009

#70 Post by yo2lio » 13 Mar 2010 20:21

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 ??
Well, I can't answer at this question, only Mikroe team can do this...
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

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Additional library for MikroBasic PRO 2009

#71 Post by p.erasmus » 15 Mar 2010 12:04

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
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

yo2lio
Posts: 1878
Joined: 19 Sep 2006 12:57
Location: Romania, Arad City
Contact:

Re: Additional library for MikroBasic PRO 2009

#72 Post by yo2lio » 15 Mar 2010 20:36

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
Hello Peter,

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

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Additional library for MikroBasic PRO 2009

#73 Post by p.erasmus » 15 Mar 2010 22:06

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
--------------------------------------------------------------

stevenindon
Posts: 466
Joined: 18 Apr 2008 03:46

Re: Additional library for MikroBasic PRO 2009

#74 Post by stevenindon » 16 Mar 2010 05:45

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...

p.erasmus
Posts: 3391
Joined: 05 Mar 2009 10:28

Re: Additional library for MikroBasic PRO 2009

#75 Post by p.erasmus » 16 Mar 2010 21:18

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
P.Erasmus
Saratov,Russia
--------------------------------------------------------------

Post Reply

Return to “mikroBasic PRO for PIC General”