
B-75074EN/04 USER CUSTOMIZE 4.REFERENCING THE DATABASE
- 449 -
4.3.2.1 Database operation procedure
GetRunTimeAData :: RuntimeA
This procedure acquires data from the machining result data table.
Data is acquired in a dynamic array of the structure
(typRunTimeAData).
The following SQL statement is created:
tSQL = "SELECT o.FirstClock, o.LastClock," & _
"o.FirstPOn, o.FirstOp1, o.FirstOp2, o.FirstCut1,
o.FirstCut2, " & _
"o.LastPOn, o.LastOp1, o.LastOp2, o.LastCut1,
o.LastCut2, " & _
"o.FirstCnt1, o.FirstCnt2, " & _
"o.LastCnt1, o.LastCnt2 " & _
"FROM RunTimeAData o " & _
"WHERE (o.McnId=" & iMchNo & _
" AND ((o.FirstClock) Between #" & iStDate & "# And #"
& iEdDate & "#)) " & _
"ORDER BY o.FirstClock"
From the machining result data table, this SQL statement acquires data
with McnId and iMchNo matching each other and FirstClock between
iStDate and iEdDate in ascending order of FirstClock.
4.3.2.2 Data display processing procedures
GetDispData :: RuntimeA
Based on data acquired from the database, this procedure collects data
in the list format and graph format.
Collected data is set in an array of the structure (typDispData).
The method of collecting each type of data is as follows:
[Power-on time (seconds)] = ( [LastPOn] - [FirstPOn] ) × 60
[Operation time (seconds)] = ( [LastOp1] - [FirstOp1] ) / 1000
+ ( [LastOp2] - [FirstOp2] ) × 60
[Cutting time (seconds)] = ( [LastCut1] - [FirstCut1] ) / 1000
+ ( [LastCut2] - [FirstCut2] ) × 60
[Machined parts count] = [LastCnt1] - [FirstCnt1]
[Total machined parts count] = [LastCnt2] - [FirstCnt2]
For power-on time, operation time, and cutting time, the GetDispTime
procedure is called to acquire data for display in the list format and
graph format.
Based on the collected cutting time and power-on time data, an
operation rate calculation is made with the GetOpeRate procedure.
[Operation rate (%)] = ( [Total cutting time] / [Total power-on
time] ) × 100