A system and method for creating a program for controlling an instrument independent of the interface type of the instrument, in a graphical programming environment. The system comprises a computer system including a display screen and input device, an instrument coupled to the computer system, and a graphical programming environment for creating and executing programs to control the instrument. The programming environment comprises a session control, function nodes and attribute nodes, an object manager and block diagram and front panel editors used to create a virtual instrument. The method for controlling the instrument comprises displaying on the screen session icons, function nodes, and attributes nodes and wiring them together to create the virtual instrument. Virtual instruments, or graphical programs, may be created which are portable across different possible I/O interface types, such as GPIB, VXI, and asynchronous serial interfaces, for coupling the instrument to the computer system. The object manager parses a class definition file to determine possible classes associated with the instrument and the attributes and functions which are valid for a each class. The environment performs type propagation checking to insure that program elements are not wired together in an invalid manner by the user in order to avoid program errors. In particular, the environment checks to see that attributes to be set on and functions to be performed with the instrument are valid for the class of the session associated with the instrument. The environment further performs class propagation between objects in the program to avoid programming errors.