Hello.
Thank you for posting to the NI Discussion Forums.
In regards to your first question, what is the error code that is associated with this error message (is it 50405)? Also, what is the program doing or attempting to accomplish that is responsible for this error? What version of LabVIEW and DAQmx are you using? Also, have you tried using the 6211 on another computer? Sometimes, the 50405 error indicates a problem with a USB port on the PC. This information will allow me to research this error more.
In terms of a specific example that will allow you to toggle a port, I invite you to check out our NI Example Finder. This can be launched from the Front Panel or Block Diagram by clicking on Help>>Find Examples. Once inside, you will have tons of examples at your fingertips. For examples on toggling a digital line on your USB-6211, please go to Hardware Input and Output>>DAQmx>>Digital Generation>>Write Dig Chan.vi. This VI will do exactly what you are looking for. If you wish to get into more complicated examples, feel free to explore the other examples in this directory.
Have a great day!
Brian F
Applications Engineer
National Instruments