Users must correctly set the switch according to the actual hardware configuration and modify the I/O address accordingly in the PG5 project.

Processing of serial communication
The serial port on the original PCD4 CPU needs to be replaced by a new communication port after the upgrade. If only the onboard serial port is used and no PCD2/3 I/O modules are added, the PCD4 I/O address range remains at 0. Once the PCD3. Fxxx or PCD2. Fxxxx communication module is used, the I/O address range will change from 256 onwards, and the user program must adjust all address references related to serial communication accordingly.
Differences from the old version of the PCD4 system
5.1 Functional changes of PCD4. N210
Some of the original special features of PCD4.N210 are no longer supported on the new platform. Please refer to the diagram in the documentation for specific details (omitted here), but be aware that these features may need to be re implemented or removed in the user program during migration.
5.2 XOB 5 is no longer valid
In the old system, XOB 5 was used to respond to/IOQUIT signals (I/O bus exit). The new CPU has cancelled the signal, therefore the XOB 5 exception handling block should be commented out or deleted.
5.3 Differences in XOB 1 power monitoring
PCD4. N200: Only monitors+5V and input voltage, ± 15V faults will not be detected.
PCD4. N210: Monitor+5V, ± 15V, and input voltage.
New platform: XOB 1 can still be used to detect power failures on the PCD4 I/O bus or power failures on the PCD3.C200 expansion, with a CPU detection time of approximately 500 ms.

User program adaptation
The user program needs to be modified in the PG5 environment. According to different programming languages, there are two methods: Fupla (FBox) and IL (Instruction List).
6.1 Fupla Programming Adaptation
When using PG5 2.0.150 SP1 or 1.4.300+Patch 15 and above versions, the standard FBox libraries "Analogue Module" and "HVC-Analogue" already support PCD4 I/O modules. But it is necessary to ensure the use of the updated FBox version:
Analogue Module SP2.6.150 or higher
HVC Analog SP2.5.316 (1.4) or SP2.6.150 (2.0) or higher
In PG5 2.0, it is also necessary to run an activation tool to enable PCD4 I/O FBox or FB.
6.2 IL Programming Adaptation
6.2.1 Using the updated FB
After installing the above PG5 version, the original PCD4 function block in the project will be automatically updated. No manual modification is required.
6.2.2 When FB is not updated: a 2-second startup delay must be added
Due to the significantly higher speed of the new CPU compared to the old PCD4, the PCD4 I/O module requires a longer initialization time. If no delay is added, it may cause the I/O module to fail to start correctly. The solution is to insert a 2-second delay program during system startup (cold start).
Specific method:
Create a new file named Wait_2s.src with the following content:
text
SINIT
ACC H
LD T 0
T#2s ; Note: T # 2s represents 2 seconds, not 20 time units
LOOP: STH T 0
JR H LOOP
ACC H
SENDINIT
Place the file at the beginning of the link order (adjusted through the Link Order menu in PG5).
This way, a 2-second wait will be executed every time the system starts or cold starts to ensure that the PCD4 I/O module is properly initialized.
This 2-second delay is absolutely necessary, otherwise I/O communication abnormalities may occur.
6.2.3 IL adjustment for PCD4.W100 module
Due to the faster speed of the new CPU, the existing read/write timing may be insufficient. NOP instructions need to be inserted at critical positions to ensure correct timing. For example:
assembly
(ACC H) ; The accumulator must be 1
SET 0 2 ; Select input channel I2
NOP
RES 0 8 ; Start A/D conversion
RES 0 8
STH I 15 ; High level indicates that the conversion is in progress (approximately 30 µ s)
JR H -1 ; Waiting for conversion to complete
BITI 12 ; Read 12 bit A/D values
I 0 ; From Address 0 (LSB)
R 102
NOP
NOP
NOP
NOP
BITO 12 ; Output 12 bits
R 113
0 0
... (Similar to processing D/A conversion)
All operands must include the base address of the module.
6.2.4 PCD4. W400/W400 modules
The code for these two modules does not require any adjustments and can be used directly.
6.2.5 PCD4.W500 module
The control function block needs to be called in XOB 16 (cold start initialization) for restart and configuration. Example
text
XOB 16
CFB Control BAW500_0 ; Module base address
7 ; Restart (hot start)
CFB config BAW500_0 ; configuration
W5Conf_0 ; Configure data blocks
EXOB
6.2.6 PCD4.W600 module
Similar to W500, the control function block needs to be called in XOB 16:
text
XOB 16
CFB Control BAW600_0
seven
CFB config BAW600_0
W6Conf_0
EXOB
6.2.7 Simultaneous use of multiple W500 and/or W600 modules
To control the initialization time to no more than 3 seconds (compared to the old system), it is recommended to handle it in the following order: