Phase 2 - Resolve Compilation Errors
Today's Tasks
- Compilations Errors.
- Compilation Warnings.
Compilation Errors
PIC420
Method
Since updating "IBD PIC420" with technology block "instPIC420", to resolve this error replaced the use of "IDB PIC420" with "instPIC420"
MAX_INT
Method
- Replace usage of MAX_INT with the built-in "MAX" function.
- Deleted MAX_INT function from project
ALS Compare2RealArea
Method
L #OffsetCmp2
SLW 3
L #A2_AREA
*I
ITD
L #A2_StartAdr
+D
LAR2 // Load Address register 2 from ACCU 1
SET //<-- Added SET here to resolve TIA Migration Compilation error. AFL 101025
R #OUT // reset the result of the previous check
SEL_3_REAL_ENABLE
Method
- Network 1
SET // <-- Added to resolve compilation error. AFL 101025
R #ENO_1
R #ENO_2
R #ENO_3
L 0.0
T #VALUE
SEL_6_REAL_ENABLE
Method
- Network 1
SET //<--Added to resolve compilation error. AFL 101025
R #ENO_1
R #ENO_2
R #ENO_3
R #ENO_4
R #ENO_5
R #ENO_6
L 0.0
T #VALUE
SEL_16_REAL_ENABLE
Method
- Network 1
SET //<--Added to resolve compilation error. AFL 101025
R #ENO_1
R #ENO_2
R #ENO_3
R #ENO_4
R #ENO_5
R #ENO_6
R #ENO_7
R #ENO_8
R #ENO_9
R #ENO_10
R #ENO_11
R #ENO_12
R #ENO_13
R #ENO_14
R #ENO_15
R #ENO_16
L 0.0
T #VALUE
SimulationBlock
Method
- Network 61
- Deleted network 61 as LT525 does not exist.
_STD_LogCopyToBuffer
Method
Commented out sections in network 2 and 6 as shown below.
Network 2
// Commented out to resolve compilation error. afl 101025
// L DINO //Get Instance-DB-number
// T #TMP_DIMemory //Save Instance-DB-number
// TAR2 #TMP_AR2Memory //Save Content of AR2
//------------------------
Network 6
//------------------------
// Commented out to resolve compilation error. afl 101025
// SET
// OPN DI [ #TMP_DIMemory] //Restore Instance-DB-number
// LAR2 #TMP_AR2Memory //Restore content of AR2.
//-----------------------
Testing
Need to test this block in testing phase of this project
RampPIC430
Method
- Deleted network 14 as RLO of block is not passed on.
Compilation Warnings
_STD_CMD_Phase
The value of an output parameter is written to the actual parameter after the block code has been executed. Therefore, the rule is that output parameters should not be read within the block. When reading, the value of the formal parameter that is valid during processing is read instead of the value of the connected actual parameter. If you nevertheless read an output parameter, note that it can be undefined or the initial value of the data type of the formal parameter.
The value of an input parameter is written to the formal parameter before the block code is executed. Therefore, the rule is that input parameters should not be written within a block. When writing, the value of the format parameter would be written and not the value of the interconnected actual parameter.
The value of an in/out parameter with a simple data type is read before the block call and written after the block call. If you read or write the parameter within the block, you only access the formal parameter.
An exception is in/out parameters with a structured data type. Structured data types are data types that consist of several data elements, for example ARRAY or STRUCT. These are transferred to the called block by a POINTER. You therefore always access the actual parameter when you read or write a structured in/out parameter within a block.
Method
After reading the lase paragraph of above F1 Help article;
- Created a
command Structin theInOutinterface of_STD_CMD_Phase.
As follows;
| Name | Data type |
|---|---|
| command | Struct |
| - Start | Bool |
| - Reset | Bool |
| - Hold | Bool |
| - Restart | Bool |
| - Abort | Bool |
| - Finalize | Bool |
| - Stop | Bool |
| - Acquire | Bool |
| - GoStep | Bool |
- In a calling block, inserted the
command Structin theTemp - Updated this block call
- Deleted original TMP_CMD_xxx variables
- Employed the
command Structat thecommandInOutparameter. - Re-compiled software (Rebuild All).
_STD_PhaseID
Method
- Created new function
_StdPhaseIdand replaced usage of_STD_PhaseIDwith it. - Deleted
_STD_PhaseID - Compiled software (Rebuild All)
_STD_PhaseID_Transfer
Method
- Created new function
_StdPhaseIdTransferand replaced usage of_STD_PhaseID_Transferwith it. - Deleted
_STD_PhaseID_Transfer - Compiled software (Rebuild All)
_STD_PhaseID_CipCurcuit
Method
- Created new function
_StdPhaseIdCipCircuitand replaced usage of_STD_PhaseID_CipCurcuitwith it. - Deleted
_STD_PhaseID_CipCircuit - Compiled software (Rebuild All)
What's Next
More Compilation Warnings