Hi buruwa,
This error is usually given when you are trying to do switching. Are you trying to do any switching in your application?
An example that performs analog input and output for the 6221 is Mult-Function-Sync AI-AO.vi. Look for it in the NI Example Finder by going to help->find examples in labview.
Brian