Frequency locking of edge localized modes (ELMs) to the vertical plasma movements induced by magnetic perturbations first demonstrated in TCV was successfully repeated in ASDEX Upgrade. However, the ELMs were triggered in ASDEX Upgrade when the plasma was moving down towards the X-point with a consequent decrease in the plasma current density in the edge region, in contrast to the previous observation on TCV in which ELMs were triggered when the edge current was increased by an upward plasma movement. This opposite behaviour observed in the magnetic triggering of ELMs has been investigated by using a free-boundary tokamak simulator, DINA-CH. The passive stabilization loops (PSLs) located inside the vacuum vessel of ASDEX Upgrade produce similar external linking flux changes to those generated by the G-coil sets in TCV for opposite vertical plasma movements. Therefore, both plasmas experience similar local flux surface expansions near the upper G-coil set and PSL when the ELMs are triggered. In ASDEX Upgrade, however, the localized expansion of the plasma flux surfaces near the upper PSL is observed with the global shrinkage of the plasma column accompanied by the downward plasma movement.