MCT-MC
4.3
Appendix
- 167 -
FDC MCT-MC
A.2.10 Database Transfer Service Configuration (DataWeb)
The database service will store uploaded data logs into a database table. There are some required settings in
web.config to point the service to the correct data table and map file column names to database fields. The
connection string to the database was setup in the previous section. Note that the name of the connection
string is “FDMySqlConnection”. In the databaseMapSection, the databaseMap element has an attribute called
connectionName. Set this to the name of the connection string as shown below. Also in the databaseMap
element, set the tableName attribute to the name of the database table that you want the data logs to be stored
in. In the example below, the table is named datatable. (note: MySql uses all lower case for table names).
<databaseMapSection>
<databaseMap mapName="FDData" tableName="datatable" connectionName="FDMySqlConnection">
<fields>
</fields>
</databaseMap>
</databaseMapSection>
The SQL statement below creates our sample data table. Your table scheme and field names may vary.
CREATE TABLE `datatable` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`CustomerID` varchar(45) NOT NULL DEFAULT '0',
`Date` varchar(15) DEFAULT NULL,
`Time` varchar(15) DEFAULT NULL,
`ID1` varchar(45) DEFAULT NULL,
`ID2` varchar(45) DEFAULT NULL,
`UserName` varchar(45) DEFAULT NULL,
`Loop1PV` double DEFAULT NULL,
`Loop1SP` double DEFAULT NULL,
`Loop1Out` double DEFAULT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
A.2.11 Database Field Map
The data_maps table maps the log file column names to database fields. This map must be setup correctly or
there will be errors and potentially lost data. There are 4 fields in data_maps:
•
DataMapID – An auto increment primary key
•
CustomerID – The ID of the customer. This is the RemoteUserID
•
FileColumn – The name of the column in the file
•
FieldName – The name of the database field it maps to.
A sample map for the data table scheme we just setup is shown below.
DataMapID
CustomerID
FileColumn
FieldName
1
SvpTest
Date
Date
2
SvpTest
Time
Time
3
SvpTest
ID1
ID1
4
SvpTest
ID2
ID2
5
SvpTest
UserName
UserName
6
SvpTest
Loop1 PV
Loop1PV
7
SvpTest
Loop1 SP
Loop1SP
8
SvpTest
Loop1 Out
Loop1Out
Summary of Contents for MCT-MC 4.3
Page 1: ...MCT MC 4 3 User Manual MCT MC 4 3 User Manual Rev A February 2018...
Page 176: ...MCT MC4 3 FDC MCT MC 176 Appendix...
Page 177: ...MCT MC4 3 Appendix 177 FDC MCT MC Open Frame Power Supply Specifications...
Page 178: ...MCT MC4 3 FDC MCT MC 178 Appendix...
Page 179: ...MCT MC4 3 Appendix 179 FDC MCT MC A 6 Power On Delay Relay Specifications GE1A C10HA110...
Page 180: ...MCT MC4 3 FDC MCT MC 180 Appendix...