Hi, I am using the serial-to-ethernet boar with the easypic v7.
I have made that one example for the easypic v6 and the PIC16F887. works in the new v7, only changing some register and it ran very well.
Now, I have a question?, how can I do a text-box in the webpage (java script) to write a value or string into it a send this data inside the PIC18F45k22 through a defined variable.
I made some modification to the javascrip code to send any variable I want and show it in the webpage, but I need to receibe a data or variable inside the PIC18F45k22 but the user has to write it in the webpage.
Could you help me giving me an example.
thanks for all.
please see the Java scrip code bellow:
'const indexPage as string[1000] =
' "<meta http-equiv=" + Chr(34) + "refresh" + Chr(34) + " content=" + Chr(34) + "3;url=http://192.168.20.60" + Chr(34) + ">" +
' "<HTML><HEAD></HEAD><BODY>"+
' "<h1>SISTEMA CONTROL DE TIEMPO MANTENIMIENTO V1.0</h1>"+
' "<h1></h1>"+
' "<a href=/>Reload</a>"+
' "<script src=/s></script>"+
' "<table><tr><td valign=top><table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "+
' "<tr><th colspan=2>TIEMPO ACTUAL</th></tr>"+
' "<tr><td>MAQ1</td><td><script>document.write(AN5)</script></td></tr>"+
' "<tr><td>MAQ2</td><td><script>document.write(AN6)</script></td></tr>"+
' "<tr><td>MAQ3</td><td><script>document.write(AN7)</script></td></tr>"+
' "</table></td><td><table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "+
' "<tr><th colspan=2>TIEMPO AJUSTE MANTENIMIENTO</th></tr>"+
' "<tr><td><script>document.write(AN2)</script></td></tr>"+
' "<tr><td><script>document.write(AN3)</script></td></tr>"+
' "<tr><td><script>document.write(AN4)</script></td></tr>"+
' "</table></td><td><table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "
'const indexPage2 as string[1000] =
' "<tr><th colspan=2>TIEMPO ACUMULADO</th></tr>"+
' "<tr><td><script>document.write(AN8)</script></td></tr>"+
' "<tr><td><script>document.write(AN9)</script></td></tr>"+
' "<tr><td><script>document.write(AN10)</script></td></tr>"+
' "</table></td><td><table border=1 style="+chr(34)+"font-size:20px ;font-family: terminal ;"+chr(34)+"> "
'this is a portion of the code that was moded to send my onw variables;
'if(getRequest[5] = "s") then ' if request path name starts with s, store dynamic data in transmit buffer
' the text string replied by this request can be interpreted as javascript statements
' by browsers
' result = SPI_Ethernet_putConstString(@httpHeader) ' HTTP header
' result = result + SPI_Ethernet_putConstString(@httpMimeTypeScript) ' with text MIME type
' add AN2 value to reply
' WordToStr(TIEMPO1, dyna)
' tmp = "var AN2="
' result = result + SPI_Ethernet_putString(@tmp)
' result = result + SPI_Ethernet_putString(@dyna)
' tmp = ";"
' result = result + SPI_Ethernet_putString(@tmp)
' add AN3 value to reply
' WordToStr(TIEMPO2, dyna)
' tmp = "var AN3="
' result = result + SPI_Ethernet_putString(@tmp)
' result = result + SPI_Ethernet_putString(@dyna)
' tmp = ";"
' result = result + SPI_Ethernet_putString(@tmp)
.
.
.
'else
' if(getRequest[5] = "t") then ' if request path name starts with t, toggle PORTD (LED) bit number that comes after
' bitMask = 0
' if(isdigit(getRequest[6]) <> 0) then ' if 0 <= bit number <= 9, bits 8 & 9 does not exist but does not matter
' bitMask = getRequest[6] - "0" ' convert ASCII to integer
' bitMask = 1 << bitMask ' create bit mask
' PORTD = PORTD xor bitMask ' toggle PORTD with xor operator
' end if
' end if
' end if
comnunication ethernet and PIC18F45k22 on mikroBasic
-
- Posts: 1
- Joined: 15 Dec 2010 01:02
- dejan.odabasic
- mikroElektronika team
- Posts: 2649
- Joined: 30 Apr 2012 14:20
Re: comnunication ethernet and PIC18F45k22 on mikroBasic
Hello,
this subject is out of the scope of our technical support.
I think that some of our experienced users will be able to help you.
Best regards.
this subject is out of the scope of our technical support.
I think that some of our experienced users will be able to help you.
Best regards.
-
- Posts: 156
- Joined: 15 Jun 2011 06:37
Re: comnunication ethernet and PIC18F45k22 on mikroBasic
Hi Edalfito78
You can create a form using HTML and I suppose go from there. Haven't really tried myself but W3Schools website is a good place to get ideas and reference. This URL I'm posting has a few examples.
http://www.w3schools.com/html/html_forms.asp
Another idea would be to download a text editor to experiment with. I use NotePad++ http://notepad-plus-plus.org/download/v6.3.3.html When trying out new Html code for browsers it comes in handy, and with a bit of knowledge and knowing how to translate code to work on MikroBASIC/C/Pascal you'll be good to go and can post your working project in LibStock
Cheers
Chris
You can create a form using HTML and I suppose go from there. Haven't really tried myself but W3Schools website is a good place to get ideas and reference. This URL I'm posting has a few examples.
http://www.w3schools.com/html/html_forms.asp
Another idea would be to download a text editor to experiment with. I use NotePad++ http://notepad-plus-plus.org/download/v6.3.3.html When trying out new Html code for browsers it comes in handy, and with a bit of knowledge and knowing how to translate code to work on MikroBASIC/C/Pascal you'll be good to go and can post your working project in LibStock
Cheers
Chris