Академический Документы
Профессиональный Документы
Культура Документы
DaNang_PLC06_10072012\SIMATIC
300(1)\CPU 319-3 PN/DP\...\FC124 - <offline>
01/28/2015 11:14:16 AM
FC124 - <offline>
"FC_Search_TrackData"
Name: srchtrck
Author: HvdWe
GEN:
Family: General
Version: 0.0
Block version: 2
11/10/2012 02:15:32 AM
Time stamp Code:
11/10/2012 02:15:32 AM
Interface:
Lengths (block/logic/data): 00410 00264 00006
Name
Data Type
IN
Address
Comment
0.0
i_DB_Track
Int
0.0
Tracking DataBlock
i_Position
Int
2.0
i_Open_Window_Offset
Int
4.0
i_Close_Window_Offset
Int
6.0
i_Data
Int
8.0
OUT
0.0
o_Position
Int
10.0
o_Entry
Int
12.0
o_Data_Found
Bool
14.0
IN_OUT
0.0
TEMP
0.0
t_Track_DB_Nr
Int
0.0
Copy of i_Track_DB_Nr
t_Search_Start_Position
Int
2.0
t_Search_End_Position
Int
4.0
RETURN
0.0
RET_VAL
Block: FC124
0.0
Function:
Search in a domain of the sorted tracking list for specific data.
Description:
This function searches for data in a specific search window of the tracking.
This search window is represented by a window that is referenced with an open
window offset and an close window offset regard to the position.
Open Window Close Window
Offset
Offset
|<---a---->|<---b---->|
____________________________________
===flow-direction===>
____________________________________
^
^
^
|
|
|
|
i_Position
|
Search-End
Search-Start
|
Position
t_Search_Start_Position = i_Position + i_Close_Window_Offset
t_Search_End_Position = i_Position - i_Open_Window_Offset
If the open offset = -1 than the tracking is searched until the first entry in
the tracking DB.
If the close offset = -1 than the search starts from the last used entry in the
tracking DB.
using -1 as open and close offset will perform a search through the complete
Page 1 of 4
SIMATIC
DaNang_PLC06_10072012\SIMATIC
300(1)\CPU 319-3 PN/DP\...\FC124 - <offline>
01/28/2015 11:14:16 AM
tracking DB
History:
This version
%created_by: %
%date_created: %
Modification History:
---------------------------------------------------Change-over from RCS to Synergy/CM;
Replaced RCS keywords for Synergy keywords.
By:
------nlHdL
Date:
-------28-01-08
Rev:
----1.5
nlsve
Network: 1
L
T
OPN
Network: 2
0
#o_Position
#o_Entry
CLR
=
#o_Data_Found
Network: 3
Network: 4
L
SLW
L
+D
LAR1
// Open tracking DB
#i_DB_Track
#t_Track_DB_Nr
#t_Track_DB_Nr
-- Tracking DataBlock
-- Copy of i_Track_DB_Nr
-- Copy of i_Track_DB_Nr
L
T
L
L
<=I
BEC
nlgm
DBW
0
DBW
5
P#2.0
//
//
//
//
//
Page 2 of 4
SIMATIC
DaNang_PLC06_10072012\SIMATIC
300(1)\CPU 319-3 PN/DP\...\FC124 - <offline>
Network: 5
L
L
-1
#i_Open_Window_Offset
==I
JCN
L
T
GA01
DBW
6
#t_Search_End_Position
JU
GA02
GA01: L
-I
T
#t_Search_End_Position
JU
GA03: L
L
+I
L
+I
T
GA99: NOP
L
<=I
JC
L
L
#t_Search_End_Position -- t_Search_End_P
osition = i_Position - i_Open_Window_Off
set
#i_Position
-- SETT: [cm] Positio
n in tracking
#i_Open_Window_Offset -- SETT: [cm] Offs
et before position pec to open update wi
ndow
-1
#i_Close_Window_Offset
#t_Search_End_Position -- t_Search_End_P
osition = i_Position - i_Open_Window_Off
set
GA03
DBW [AR1,P#0.0]
1
#t_Search_Start_Position
#t_Search_Start_Position -- t_Search_Sta
rt_Position = i_Position + i_Close_Windo
w_Offset
GA99
#i_Position
#i_Position
-- SETT: [cm] Positio
n in tracking
#i_Close_Window_Offset -- SETT: [cm] Off
set after position pec to close update w
indow
#i_Close_Window_Offset
DBW
#t_Search_Start_Position
Network: 6
HA01: L
#i_Position
#i_Open_Window_Offset
==I
JCN
L
L
+I
T
GA02: L
L
01/28/2015 11:14:16 AM
#t_Search_Start_Position
// START OF SEARCH-LOOP
DBW [AR1,P#0.0]
//
//
//
//
#t_Search_Start_Position -- t_Search_Sta
rt_Position = i_Position + i_Close_Windo
w_Offset
>=I
JC
HA02
JU
HA99
DBW [AR1,P#2.0]
#i_Data
// Track-data
HA02: L
L
==I
JCN
HA03
DBW [AR1,P#0.0]
#t_Search_End_Position
HA03
#i_Data
in tracking
Page 3 of 4
SIMATIC
DaNang_PLC06_10072012\SIMATIC
300(1)\CPU 319-3 PN/DP\...\FC124 - <offline>
L
T
DBW [AR1,P#0.0]
#o_Position
// Store position
SET
=
#o_Data_Found
TAR1
L
-D
SRW
T
JU
HA03: TAR1
L
-D
JMZ
L
+D
LAR1
JU
HA99: NOP
01/28/2015 11:14:16 AM
#o_Position
-- [cm] Tracking posi
tion where data is found
#o_Data_Found
king
// Store Entry-number
#o_Entry
-- Record-number in s
orted tracking-list
HA99
HA99
//
//
//
//
P#2.0
P#6.0
Page 4 of 4