Programming Considerations
- Updated2024-03-18
- 1 minute(s) read
Programming Considerations
The program examples for each function are written in ANSI C, using NI-VISA. Although the examples in this manual are written in C, you can program the GPIB-RS232/485/422 using any programming language with access to a GPIB port.
The following VISA function addresses the GPIB-RS232/485/422 to listen and sends it the programming message spset, followed by a carriage return:
viWrite (GPIB232, "spset\r", 6)
The code above assumes you properly initialized VISA resource and used viOpen() to obtain the GPIB232 handle. For more details, refer to GPIB Initialization Code Using VISA.
If you are not using NI-VISA, be sure your program properly addresses the GPIB-RS232/485/422 and serial device when writing to and reading from them.
In the function syntax descriptions, arguments shown in square brackets ([]) are optional. Do not enter the brackets as part of your argument.
You can use function name abbreviations, which include only as many characters as necessary to distinguish them from other functions. The abbreviated forms are indicated by bold text in the syntax description of each function.