Example of use myEthernet: Shared RAM
With help of the command you can save a byte kann in the shared RAM. This is appended to the end of the address in the address line. The command can also be triggered by a pointer.
The pin number of the first Byte of the shared RAM is 1000. The value which should be saved in the shared RAM must be transfered as hexadecimal value, e.g. ?myChangeCmd=°o1000°0x57°
If you want to insert a html reference then you have to pay attention to replace the characters ~ and ° by character codes
(~ = %7E, ° = %B0) because the myEthernet web server interprates all text between the degree characters as replacement. A link must be look like this:
To read out the current values you have to write in the HTML-source code. The value is formatted with °v1000~%c°. In this example as ASCII-character. n bytes are displayed with from the first byte separated with one comma. If you use pin numbers from 2000 then always the value from 2 consecutive bytes is displayed.
The following graphic should clarify it:
So there are the following areas for the pin numbers:
16bit values: Pin 2000-2063
32bit values Pin 3000-3031
Create a HTM-file with the name shram.htm.
Write the following source code in it.
Copy the file on the microSD-card.
Insert the microSD-card in the myEthernet, connect the power supply on the myEthernet and connect it via the network cable with a PC.
Open a page in a web browser. Write in the address line the IP address and the name of the htm-file e.g. http://192.168.178.96/temp.htm
At the beginning there are random values in the shared RAM. Click on the 4 links. Because of that the 4 letters
'e' (2. Byte),
'l' (3. Byte),
't' (4. Byte)
On the bottom there are screenshots of the website.
The shared EEPROM
If you use the EEPROM then you have to pay attention that you can perform on it for only a limited number of writes. Thats why you shouldnt write measured data in the EEPROM every minute.
The EEPROM is shared with the exception of the pin numbers as well read out and described as the Shared RAM. Instead of the ports 1000, 2000 and 3000 the EEPROM uses the ports 5000, 6000 and 7000.
|««« Back to the picture gallery|