What is the error code that you are receiving? In other words, is there a number associated with the error?
The PXI-6704 can output from 0 to 20 mA. So, make sure you are within this range. Also, the PXI-6704 outputs current on channels 16 through 31 and so make sure you are not trying to use this example with channels 0 through 15 of the device. I hope this helps.
Regards,
Todd D.