Ice9 #1 you are defining a type inside a looppull these linesType PortVal Field val End Type above your Repeat