Take a look inside the Write to Digital Line VI. You can view this VI's front panel and diagram by just double-clicking on it. This VI calls DIO Port Config (setting up the port as an output port) and then DIO Port Write. The DIO Port Write uses a line mask to make sure that only the desired line is written to.
In order to implement this on two different ports, you would call the DIO Port Config for both ports (0&1) and then use two DIO Port Writes, masking out the unwanted lines.
The PC-DIO-24 board has the 8255 digital chip, which will clear all all ports whenever a port is configured. That makes it very important for you to configure all of your ports before you do any reading/writing. Good luck!