Controlling the type of device (master module)
Article content:
Determine the type of device by boardstamp
The device type is determined automatically by the boardstamp.
The product code is set by resistors on the motherboard. The product code and type are defined at system startup and are available in the file system:
- /sys/board/board_code - the code;
- /sys/board/board_type - type;
- /sys/board/stamp_down and /sys/board/stamp_up - definition of the connected periphery;
Vutlan | Product code | Type | Subtype | Name field | Analog ports | Dry contact ports | Relay | Signal relay | Outlets | 12V outputs | Reader iButton | CAN ports |
---|---|---|---|---|---|---|---|---|---|---|---|---|
VT8101 | 0 | 0 | 8 | - | 3 | 1 | - | - | 1 | 2 | ||
VT2100 | 1 | 1 | 1 | - | - | - | - | - | - | 2 | ||
VT800 | 0 | 2 | 8 | - | - | - | - | - | 1 | 2 | ||
VT8110 | 0 | 3 | 8 | - | - | - | 4 | - | 1 | 2 | ||
VT8101T | 0 | 4 | 8 | - | 3 | 1 | - | - | 1 | 2 | ||
VT11xx | 1 | 5 | 1 | - | - | - | xx | - | - | 2 | ||
VT18xx | 1 | 6 | 1 | - | - | - | xx | - | - | 2 | ||
VT19xx | 1 | 7 | 1 | - | - | - | xx | - | - | 2 | ||
VT200 | 2 | 8 | 4 | 4 | - | - | - | 2 | - | - |
Programming the type of device
The auto-determination according to the boardstamp has limitations: it is impossible to accurately determine the type and performance of the device.
In connection with this, the function of saving a device type to non-volatile memory is added. The entry is made by the command in the address bar of the browser:
http://192.168.1.193/devtype.htm?name=1
where the IP address of the device is specified, and the type (name) of the device in accordance with the table above.
In case of successful recording, a message like this will be displayed:
New name: VT2100 (1).
System will be restarted.
After that the system will be automatically rebooted and the changes will take effect.
In case of error:
Error writing new name!
If the record does not match the table, then an algorithm is used to determine the type of device using boardstamp.
Commands for working with EEPROM memory (since version 2.5.2)
To facilitate the work with EEPROM memory, several commands are available. The type of the command is specified in the tag mode. There can be commands read, write, binary, erase. The address is specified in the offset tag, a decimal integer, indicating the byte from which the operation will start. The length of the data is specified in the length tag, if this tag is not specified, then the length will be considered 8. When writing and erasing it is better not to omit this tag. The data for writing goes in the data tag, and represents a string in ASCII or BCD format. When writing a string, the length is determined by the line, when writing binary data, you must explicitly specify the length.
Reading is done with the read command. If you do not specify the length of the data, then 8 bytes will be read.
Example, reading 32 bytes at address 0:
192.168.0.199/eeprom.htm?mode=read&offset=0&length=32
DATA EEPROM READ:
offset = 0 (0x00)
length = 32
data =
0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF
0x14 0x02 0x00 0x00 0xFF 0xFF 0xFF 0xFF
0xFF 0xFF 0xB2 0xB2 0x03 0x00 0xFF 0xFF
A string entry in ASCII format is made using write command. The number of bytes written is determined by the length of the string. A null character is not recorded.
Example, writing a line at 64:
192.168.0.199/eeprom.htm?mode=write&offset=64&data=something_strange
Writing 17 byte OK
The binary data is recorded using binary command. The length must be specified correctly, otherwise incorrect data can be written.
Example, writing 4 bytes of binary data 0x01 0x23 0x45 0x67 at address 64:
192.168.0.199/eeprom.htm?mode=binary&offset=64&length=4&data=01234567
Writing 4 byte OK
Erasing is done using erase command.
Example, erasing 10 bytes at 64:
192.168.0.199/eeprom.htm?mode=erase&offset=64&length=10
Erasing OK
List of boards used in the master modules SC81XX / VT81XX / VT800:
Board | Configuration | Code, Subcode | Relay, location | Used in the master module |
---|---|---|---|---|
F2_V-5 | none | 0xff - | GRT508E on board | preserial |
F2_V-8 | none | 0xff | GRT508E | SC8100 SC8110 first batch |
F2_V-10-KLEM | none | 0xff | HFE-20-2-C on board | SC8100 |
F2_V-10-LAM | none | 0xff | HFE-20-2-B on board | SC8110 |
F2_V-11 | none | 0xff - | extension module | SC8110 |
F2_V-11T | none | 0xff | extension module | ???? |
F2_V-12-KLEM | none | 0xff - | HFE-20-2-C | SC8100 |
F2_V-14-KLEM | D7, D6 | 0xff | HFE-20-2-C | SC8100 |
F2_V-15 | none | 0xff - | extension module | SC8110 |
F2_V-16-KLEM | D7, D6 | 0xff 0xbf, 0x3f | HFE-20-2-C | SC8101 VT8101 VT8101T |
F2_V-17 | D7, D6 | 0xff | extension module | SC8110 VT8110 VT800 |
Using the board sky25_mini_xxxx
Board | Configuration | Code, Subcode | Power connector | Used in the master module |
---|---|---|---|---|
sky25_mini | D7 D7 always = 0 - sign of series SC2100 | 0x7f - | internal | SC1108 SC18XX SC19XX |
internal | SC2100 SC2110 |
List of boards used in the master module VT200
Board | Configuration | Code, Subcode | Used in the master module |
---|---|---|---|
CPU_CARRIER_V3 | D7, D6, D5 D5 always = 0 - series attribute VT200 | 0xdf 0x9f, 0x5f, 0x1f | preserial |
CPU_CARRIER_V31 | VT200 |