Trying to get a 4x40 LCD working

That datasheet link doesn't seem to work.

I have driven an HD44780 compatible 40x4 display before. Just requires 2 enable lines - the liquidcrystal440 library can cope with it (possible the IDE bundled liquidcrystal library now - not sure).

Mowcius