You need to cast the argument to the expected type in your call to PolygonRGBA. Try something like "PSInt16(@XData[0])".