Default vs. Configured Communication Settings

When you open a Serial port, the VISA specification defines the default communication settings to be 9600 baud, 8 data bits, 1 stop bit, no parity, and no flow control. If you have configured the settings to a different value in the NI-VISA configuration utility (MAX on Windows, visaconf on UNIX), then you must pass the value VI_LOAD_CONFIG (4) as the AccessMode parameter to viOpen(). This parameter will cause the configured settings to be used; otherwise, if the AccessMode is 0 or VI_NULL, the default settings will be used.

Most Serial devices allow you to set the communication settings parameters via either DIP switches or via front panel selectors. If you are not using the NI-VISA configuration as discussed above, be sure to use viSetAttribute() to make these attribute values consistent with your device settings:

Other common (but not all) ASRL INSTR attributes are as follows:

For lower-level functionality, you can also query the state of each modem line via viGetAttribute(). VISA will return whether the given line state is asserted (1), unasserted (0), or unknown (–1).