1/12/2017 2:31 AM | |
Joined: 10/7/2005 Last visit: 12/20/2024 Posts: 3029 Rating: (1058)
|
Hello AutoGen_965963 Firstly, I suggest you download the manual for the S5 CPU in use which will contains detals about the instructions. Secondly, I added some comments to your S5 logic (based on the values that are supplied to the call of FB80) which will hopefully answer your questions and help you to rewrite the logic in S7. Put simple though, FB80 checks if DW28 up to including DW40 contains a value ><0. If so, F 205.3 will be 1, if not, it will be 0. JC FB 80 NAME: ABC AKTI: F 0.1 DB : DB 20 DWAN: DW 28 = 990 DWEN: DW 40 = 1 Q : F 205.3 NAME: ABC DECL: AKTI IBI DECL: DB B DECL: DWAN IW DECL: DWEN IW DECL: Q QBI AN =AKTI ---always 1 JC =M001 DO =DB // Open DB 20 LW =DWAN // Load the bitpattern value of DWAN. The Low Byte of Accu1 will now contain a value of 28 (as DW 28 is the Parameter) T FW 248 LW =DWEN // Load the bitpattern value of DWEN. The Low Byte of Accu1 will now contain a value of 40 (as DW 40 is the Parameter) T FW 250 L KH 0000 T FW 252 // Loop processing starts here. Contents of DW28 up to including DW40 are OR'ed together M002: DO FW 248 L DW 0 ----which DW call? --> DW 28 in the first loop execution L FW 252 OW T FW 252 L FW 248 I 1 T FW 248 L FW 248 L FW 250 // DW40 is the last DW <=F JC =M002 L KH 0000 L FW 252 ><F = =Q // Q will be 1 if any DW from DW28 up to DW40 has a value in it M001: BE
|
Cheers |
|
This contribution was helpful to1 thankful Users |
1/12/2017 7:09 AM | |
Joined: 2/6/2015 Last visit: 12/18/2024 Posts: 19 Rating: (0) |
The information is quite useful. Thank you |
Follow us on