Data Sheet
Ether I/O 24R Users Manual V1.1
Elexol Pty Ltd Version 1.1 Page 38 http://www.elexol.com
ELEXOL
ELECTRONIC SOL UT IONS
Advanced Programming (continued)
Programming the module’s ports default power up state
By referring to the EEPROM memory use, Table 2 on Page 31, we can see that the Address we need to set
up for the Port A direction register is the MSB of Address 8. Being that we don’t care about the LSB of
Address 8 and we want the MSB to be all ones we can program address 8 with the values MSB = 255 and
LSB = 255.
For Port B the direction register is in the LSB of address 11 and the Port Value is in the MSB of Address
10.
As LSB of Address 10 is the Port A Schmitt Trigger value and as we want these turned off we can program
this with 255, the Value for Port B is binary 11110000, which translates to 240 decimal.
The MSB of address 11 is the Port B Pull-Up register and as we don’t care about this value if the port is set
as outputs we can just write 255 to the MSB and 0 to the LSB to make Port B all outputs.
The last step is to program bit1 of address 5 as a low, to do this we read the existing value of address 5 use
the And and Not functions to affect just the one bit, then write this new value back to address 5.
Programming the AutoScan Mode
The AutoScan mode will allow the module to originate communication with a remote device or another
Ether I/O 24 module. This mode is very useful as it allows your software the freedom not to have to poll
the module to check the state of the inputs.
To allow the module to communicate through a router the Gateway address, Subnet mask, IP address and
Port Number needs to be programmed into the module. When autoscan is enabled the address of the target
device will be compared to the subnet mask to see if the address falls within the Local network. If the
address is within the local network the packet will be automatically sent to the address of the target device
on the programmed port number. If the address is outside the local network the gateway will be arped to
get the MAC address and then the packet will be sent to the Gateway with the IP Address of the target
device.
Mask bits are used to allow some of the input pins of the module to toggle without generating messages
from the module. Any input whose corresponding mask bit is low, is ignored by the AutoScan function.
The Scan Rate is a 16-bit value which is used to divide the scan rate of the AutoScan mode from it’s base
rate of 1,000 scans per second down to a user programmed rate from 500 scans per second to one scan per
65.5 seconds. When set at 1 the scan rate is 1,000 scans per second, it is 500 scans per second when the
value is 2 and so on. You simply divide the 1,000 per second rate by your desired scan rate to find the value
for address 18. The filter value which is in the MSB of Address 17 is used to count the number of identical
reads that are required before a port value is considered valid and sent to the target device. When set at 0
the filter is turned off, when set at 1 the port must read the same for two scans to be considered valid and
sent to the target. Higher numbers simply increase the number of identical reads required before the value
is considered valid.
Care should be taken when using high filter values with slow scan rates, as the reporting time for a change
under these conditions can be over 4 hours.
Resetting the Module
To activate the new settings that have been programmed into the EEPROM memory you must reset the
module. This is accomplished using the Reset Module Command. The command must have that data as
shown in the programming example.
Winsock1.SendData "'@" + Chr$(0) + Chr$(&HAA) + Chr$(&H55)
All of these settings can be programmed using the Ether I/O 24 Test Programming Utility available for
download from the Elexol website.