Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
FC7 - <offline>
"String Parsing" Name: STRNG_P Author: CJG Parse Incoming Strings Family: CP_BSP Version: 1.0 Block version: 2 3/1/2006 9:17:48 AMAM Time stamp Code: 2/24/2006 2:49:20 PMPM Interface: Lengths (block/logic/data): 04042 03690 00030
Name IN OUT IN_OUT TEMP Length MovErr Count Over RETURN RET_VA Data Typ Address 0.0 0.0 0.0 0.0 0.0 2.0 4.0 6.0 0.0 0.0 Comment
Done Parsi
Block: FC7
Network: 1
Go to the Command to be Parsed SET A JC SET A JC SET A JC JU Network: 2 "GID_Done" GID "GLE_Done" GLE "GSV_Done" GSV END Start Parsing the GID Command
Network: 3
Bring in the Received GID String, starting at 4 to ignore the command and first comma "BLKMOV" EN P#DB20. DBX4.0 BYTE 74 SRCBLK ENO
Page 1 of 17
Siemens S7
Network: 4
Set the Original length for Strings.Working to 74. SET OPN L T L L T T "Strings" 74 DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Start at 0
Network: 5
Find Comma in Received String and Subtract 1 from length to account for comma. "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 6
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 16 IN2 SUB_I ENO OUT #Over
Network: 7
Set Max and Actual lengths for UNIT_ID SET OPN L T L L >I JC L T T JU OVR7: L T T JU DON7: L NOP "Strings" 16 DB4.DBB #Over 0 OVR7 #Length DB4.DBB #Over DON7 16 DB4.DBB #Over DON7 DB4.DBD 0 1 // Length of UNIT_ID // Put in UNIT String // For Copy Length to String // Length of 16 // Put in UNIT String // For Copy Length to String
Page 2 of 17
Siemens S7
Network: 8
Copy out the UNIT_ID "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL Unit
Network: 9
Add 1 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Network: 10
Delete the UNIT_ID Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Network: 11
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L L T T "Strings" #Count DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Reset to 0
Page 3 of 17
Siemens S7
Network: 12
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 13
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 14
Set Max and Actual lengths for FIRM_REV SET OPN L T L L >I JC L T T JU OVR8: L T T JU DON8: L NOP Network: 15 "Strings" 10 DB4.DBB 18 #Over 0 OVR8 #Length DB4.DBB #Over DON8 8 DB4.DBB #Over DON8 DB4.DBD 0 19 // Length of FIRM_REV // Put in FIRMREV String // For Copy Length to String // Length of 8 // Put in FIRMREV String // For Copy Length to String
19
18
Copy out the FIRM_REV "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL FirmRev
Page 4 of 17
Siemens S7
Network: 16
Network: 17
Network: 18
Bring in the Received GLE String, starting at 204 to ignore the command and first comma "BLKMOV" EN P#DB20. DBX204.0 BYTE 74 SRCBLK ENO
Network: 19
Set the Original length for Strings.Working to 74. SET OPN L T L L T T "Strings" 74 DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Start at 0
Network: 20
Find Comma in Received String and Subtract 1 from length to account for comma. "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Page 5 of 17
Siemens S7
Network: 21
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 22
Set Max and Actual lengths for CNTL_ERR SET OPN L T L L >I JC L T T JU OVR9: L T T JU DON9: L NOP Network: 23 "Strings" 20 DB4.DBB 30 #Over 0 OVR9 #Length DB4.DBB #Over DON9 8 DB4.DBB #Over DON9 DB4.DBD 0 31 // Length of CNTL_ERR // Put in ERR String // For Copy Length to String // Length of 8 // Put in ERR String // For Copy Length to String
31
30
Copy out the CNTL_ERR "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL Err
Network: 24
Page 6 of 17
Siemens S7
Network: 25
Network: 26
Bring in the Received GSV String, starting at 604 to ignore the command and first comma "BLKMOV" EN P#DB20. DBX604.0 BYTE 74 SRCBLK ENO
Network: 27
Set the Original length for Strings.Working to 74. SET OPN L T L L T T "Strings" 74 DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Start at 0
Network: 28
Find Comma in Received String and Subtract 1 from length to account for comma. "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 29
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Page 7 of 17
Siemens S7
Network: 30
Set Max and Actual lengths for SPEED SET OPN L T L L >I JC L T T JU OVR1: L T T JU DON1: L NOP Network: 31 "Strings" 10 DB4.DBB 52 #Over 0 OVR1 #Length DB4.DBB #Over DON1 8 DB4.DBB #Over DON1 DB4.DBD 0 53 // Length of SPEED // Put in SPD String // For Copy Length to String // Length of 8 // Put in SPD String // For Copy Length to String
53
52
Copy out the SPEED "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL Spd
Network: 32
Add 1 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Network: 33
Delete the SPEED Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Page 8 of 17
Siemens S7
Network: 34
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L L T T Network: 35 "Strings" #Count DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Reset to 0
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 36
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 37
Set Max and Actual lengths for TORQUE SET OPN L T L L >I JC L T T JU OVR2: L T T JU DON2: L NOP "Strings" 10 DB4.DBB 64 #Over 0 OVR2 #Length DB4.DBB #Over DON2 8 DB4.DBB #Over DON2 DB4.DBD 0 65 // Length of TORQUE // Put in TRQ String // For Copy Length to String // Length of 8 // Put in TRQ String // For Copy Length to String
65
64
Page 9 of 17
Siemens S7
Network: 38
Copy out the TORQUE "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL Trq
Network: 39
Add 2 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Network: 40
Delete the TORQUE Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Network: 41
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L L T T "Strings" #Count DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Reset Length to 0
Page 10 of 17
Siemens S7
Network: 42
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 43
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 44
Set Max and Actual lengths for MOTOR ERROR SET OPN L T L L >I JC L T T JU OVR3: L T T JU DON3: L NOP Network: 45 "Strings" 10 DB4.DBB 76 #Over 0 OVR3 #Length DB4.DBB #Over DON3 8 DB4.DBB #Over DON3 DB4.DBD 0 77 // Length of MOTOR ERROR // Put in MTRERR String // For Copy Length to String // Length of 8 // Put in MTRERR String // For Copy Length to String
77
76
Copy out the MOTOR ERROR "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL MtrErr
Page 11 of 17
Siemens S7
Network: 46
Add 1 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Network: 47
Delete the MOTOR ERROR Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Network: 48
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L L T T Network: 49 "Strings" #Count DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Reset Length to 0
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Page 12 of 17
Siemens S7
Network: 50
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 51
Set Max and Actual lengths for SHEAR RATE SET OPN L T L L >I JC L T T JU OVR4: L T T JU DON4: L NOP Network: 52 "Strings" 10 DB4.DBB 88 #Over 0 OVR4 #Length DB4.DBB #Over DON4 8 DB4.DBB #Over DON4 DB4.DBD 0 89 // Length of SHEAR RATE // Put in SRATE String // For Copy Length to String // Length of 8 // Put in SRATE String // For Copy Length to String
89
88
Copy out the SHEAR RATE "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL SRate
Network: 53
Add 2 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Page 13 of 17
Siemens S7
Network: 54
Delete the SHEAR RATE Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Network: 55
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L L T T Network: 56 "Strings" #Count DB4.DBB 125 DB4.DBD 0 #Length #Over 124 // Reset Length to 0
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 57
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 58
Set Max and Actual lengths for SHEAR STRESS SET OPN L T L "Strings" 10 DB4.DBB 100 #Over
Page 14 of 17
Siemens S7
0 OVR5 #Length DB4.DBB #Over DON5 8 DB4.DBB #Over DON5 DB4.DBD 0 101 // Length of SHEAR STRESS // Put in SSTRS String // For Copy Length to String // Length of 8 // Put in SSTRS String // For Copy Length to String
101
100
Copy out the SHEAR STRESS "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL SStrs
Network: 60
Add 2 to Length to Delete Comma, and subtract length from original ADD_I ENO OUT #Length SUB_I ENO OUT #Count
EN
EN
Network: 61
Delete the SHEAR STRESS Length from Strings.Working left side, starting at 1st character. "DELETE" EN "Strings". Working IN #Length L 1 P ENO "Strings". RET_VAL Working
Network: 62
Set the New Actual Length of Strings.Working and Reset Length to 0. SET OPN L T L "Strings" #Count DB4.DBB 125 DB4.DBD 124
Page 15 of 17
Siemens S7
L T T Network: 63
0 #Length #Over
Find Comma in Received String and Subtract 1 from length to account for comma "FIND" EN "Strings". Working IN1 "Strings". Comma IN2 ENO RET_VAL #Length 1 IN2 EN SUB_I ENO OUT #Length
#Length IN1
Network: 64
Set Max String Length to 8 for Displaying on HMI CMP >I EN #Length IN1 8 IN2 SUB_I ENO OUT #Over
Network: 65
Set Max and Actual lengths for VISCOSITY SET OPN L T L L >I JC L T T JU OVR6: L T T JU DON6: L NOP Network: 66 "Strings" 10 DB4.DBB 112 #Over 0 OVR6 #Length DB4.DBB #Over DON6 8 DB4.DBB #Over DON6 DB4.DBD 0 113 // Length of VISCOSITY // Put in VISC String // For Copy Length to String // Length of 8 // Put in VISC String // For Copy Length to String
113
112
Copy out the VISCOSITY "LEFT" EN "Strings". Working IN #Over L ENO "Strings". RET_VAL Visc
Page 16 of 17
Siemens S7
Network: 67
Network: 68
Set the Return Value to show String Parsing was Completed. END: S BE #RET_VAL
Page 17 of 17