On the Dialog and User Interface Palette, there is the "Error Cluster from Error Code" function. If you wire a number other than 0 (= No Error) in to the (required) Error Code terminal, you will generate an Error with that number. Note that many numbers already have LabVIEW errors associated with them. Errors in the range 5000-9999 (and a few other ranges) are "User-defined Error Codes", meaning they are whatever you say they are.
BS