port cons diagram code