private static Device getDevice (String portId)
    throws IOException
    {
	try {
	    Device dev = HostFactory.getHost ().getDevice (portId);
	    if (isFX2 (dev))
		return dev;
	} catch (IllegalArgumentException e) {
	}
	System.err.println ("no such FX2 device: " + portId);
	return null;
    }