├── README ├── box_insert.odt ├── basic_commands.odt ├── box_insert.txt └── basic_commands.txt /README: -------------------------------------------------------------------------------- 1 | Documentation associated with Galvant Industries' GPIBUSB project. 2 | -------------------------------------------------------------------------------- /box_insert.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Galvant/gpibusb-documentation/HEAD/box_insert.odt -------------------------------------------------------------------------------- /basic_commands.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Galvant/gpibusb-documentation/HEAD/basic_commands.odt -------------------------------------------------------------------------------- /box_insert.txt: -------------------------------------------------------------------------------- 1 | Galvant Industries GPIBUSB rev4 2 | 3 | 4 | Thanks for purchasing our USB-to-GPIB adapter! This hardware is released as open source hardware. This means you can find all the source files online at github.com/Galvant where you are free to download them to share, use, change, or anything else you like! 5 | 6 | By purchasing this adapter, you are supporting open source hardware and the development of future OSHW products. And with that, we thank you. 7 | 8 | The specific licence that all the source is released under is the Creative Commons 3.0 Attribution ShareAlike licence. More details can be found accompanying the source files on Github. 9 | 10 | 11 | Warning! 12 | This device contains lead-free (Pb-free) in all solder joints but was not assembled in a lead-free environment. Be sure to wash your hands after handling so you do not ingest any residue on your hands. 13 | This adapter has only been tested at room temperatures, at standard humidity levels. As such, there is no guaranteed operation outside of these conditions. 14 | This product contains ESD sensitive devices. Refrain from touching any of the surface mount components soldered to the board, unless you are taking proper ESD safety precautions. 15 | 16 | 17 | Additional Resources 18 | 19 | You can find lots of instrument communication Python code at github.com/Galvant/InstrumentKit where a consistent API is provided across several specific and generic instruments. This library is not specific to this GPIBUSB adapter and works with a variety of connections including serial, tcpip, through VISA, unix filelikes (eg /dev/usbtmc0), and of course, this adapter. 20 | 21 | Some additional documentation, including the full set of internal adapter commands, can be found at github.com/Galvant/gpibusb-documentation. 22 | 23 | 24 | 25 | Contact Information 26 | 27 | If you have any questions, comments, or concerns please send an email to contact@galvant.ca 28 | 29 | Visit our website at galvant.ca, follow us on twitter @Galvant_Ind, and watch Steven's YouTube channel for development of new products! youtube.com/user/stevencasagrande 30 | 31 | If you find any bugs, develop any firmware changes, or have any suggestions, be sure to send us an email! We'll see about including your suggestions in the github repositories for everyone else to use! 32 | Quickstart – Windows 33 | 1. Plug adapter into free USB port. Windows 7 should automatically download the required drivers. If your version of Windows does not automatically download the drivers, visit ftdichip.com/FTDrivers.htm and download and install the “Virtual COM Port” driver. 34 | 2. Find which COM port your adapter is. You can find this information in the Windows device manager (right click Computer -> Properties -> Device Manager). Look for the entry with FTDI in the name. 35 | 3. Download a serial terminal client such as Termite (compuphase.com/software_termite.htm) 36 | 4. Follow communication steps below. 37 | 38 | Quickstart – Linux 39 | 1. Make sure you are running a version 3.0.0-19 or greater Linux kernel. To check this type uname -a into the terminal. Most modern Linux distributions will already be using this. It is highly recommended that you upgrade to the latest distribution version (and thus kernel) to ensure operation. 40 | 2. Add your user to the dialout usergroup. Type usermod -a -G dialout name where you replace name with your username. Restart computer to make sure this takes effect. This ensures that your account can read and write to serial ports. 41 | 3. Plug adapter into a free USB port, and find what the port name is. Most of the time it will be /dev/ttyUSB0. To find this, type ls /dev | grep ttyUSB into the terminal. 42 | 4. Use a serial terminal program to connect to the adapter. One example is CuteCom. 43 | 5. Follow communication steps below. 44 | 45 | Communication 46 | 1. Set your program to 460800 baud, termination to CR or LF, standard 8N1 serial settings, and no flow control. If you are not able to set the termination character, be sure to add a CR (carriage return, \r) or LF (linefeed, \n) to all communications. This baud rate is not an option in the Terminite dropdown list and you must manually type it in the field. 47 | 2. Connect GPIBUSB to instrument(s). Ensure that the red LED is off. This ensures that the adapter has correctly taken control of the attached instrument(s). 48 | 3. Use the command +test (with a CR at the end) to check that everything is working. If the adapter responds with testing\n\r then everything has been setup. 49 | 4. Set your target instrument by sending +addr 1 where 1 is replaced with the GPIB address of your target instrument. If automating communication in a script, it is recommended that you include a slight delay (0.02sec) between successive commands. 50 | 5. Send your command of interest. A good test on most instruments is *idn? . If your query ends in a question mark, the adapter will automatically get the instrument response and write it to the computer. Consult your instrument manual to see if it supports this command. 51 | 6. For older instruments, your query might not end with a question mark. In this case send the command ++read to force the adapter to read the instrument response by putting the instrument into talk mode. 52 | -------------------------------------------------------------------------------- /basic_commands.txt: -------------------------------------------------------------------------------- 1 | Galvant Industries GPIBUSB Command List – Firmware v5 2 | 3 | ** Baudrate: 460800, standard 8N1 serial settings, no flow control ** 4 | ** Note: All writes to the controller must end with a carriage return ('\r' or dec:13) or newline ('\n' or dec:10)** 5 | ** All responses from the adapter will have a CR added by default. ** 6 | 7 | All of this information can be found, along with additional information, can be found in the readme.md file for the firmware located at github.com/Galvant/gpibusb-firmware 8 | 9 | ++addr 1 10 | Sets the GPIB address of the device you wish to communicate with. Here the target address is 1. GPIB address range from 1 to 31. Check the device to find what its address is. When in device mode this will set the address of the device. 11 | 12 | ++auto 1 13 | Used to toggle automatic response reading on (1) and off (0). If set to on (default) the adapter will automatically start reading the response from the device if your data contained a question mark (?). 14 | When set to off, the response will not be read and you will need to send the ``++read`` command to 15 | do so. If set to on, reading will terminate on EOI if ``++eoi 1`` is set, or will terminate on EOS charactrs if ``++eoi 0`` is set. 16 | 17 | ++clr 18 | Sends the "Selected Device Clear" (SDC) to the currently specified GPIB address as per ``++addr``. 19 | 20 | ++debug 0 21 | Used to toggle simple debug messages on (1) and off (0). When set to on, communicaiton timeout error messages are sent to the host PC containing basic details as to when and what timed-out. This includes which data line timed-out (DAV, NDAC, NRFD), if you were waiting for it to go high or low, as well as if the adapter was reading or writing. Default is off. 22 | 23 | ++eoi 1 24 | Used to toggle EOI assertion when writing on (1) and off (0). If set to on, the adapter will assert EOI on the last byte sent over the GPIB bus. Default is on (1). Most devices will use EOI, some will give you the option, and some will not. For those that give you the option, it is highly recommended that you use EOI to signal end of data. 25 | 26 | ++eos [0|1|2|3] 27 | Set the character that the adapter uses to signal end of data. EOS characters are appended to the end of data being sent to GPIB devices and removed from the data received from GPIB devices. When using ```++read``` reading will terminate when EOS characters are detected. There are four options for this command: ```++eos 0``` appends CR+LF, ```++eos 1``` appends CR, ```++eos 2``` appends LF, and ```+eos 3``` does not append anything. Default is 3. 28 | 29 | +++eot_enable 1 30 | Used to toggle end-of-transmission (EOT) characters on (1) and off (0). When set to on, data received 31 | from your GPIB devices will have the EOT character appended to the end when forwarded to the attached PC. This character is specified with the ```++eot_char``` command. Default is on. 32 | 33 | ++eot_char 13 34 | Specifies the character that will be appended to all transmissions sent from the adapter to the attached PC. The value is a number in the set [0,255] which is the decimal version of the desired ASCII character. Default is 13 (CR). 35 | 36 | ++ifc 37 | Asserts the GPIB IFC line for 150us. 38 | 39 | ++llo 40 | Disable front panel operation of the currently addressed instrument by sending the GPIB command byte LLO. 41 | 42 | ++loc 43 | Enables front panel operation of the currently addressed instrument by sending the GPIB command byte GTL. 44 | 45 | ++mode 1 46 | Used to switch the adapter between controller mode (1) and device mode (0). Default is controller mode. 47 | 48 | ++read [eoi] 49 | Sets the currently addressed GPIB device to talk. This is useful when ``++auto 0`` is set or if you have an instrument that does no rely on the question mark query syntax. There are two ways to use this command: ``++read`` will read until the EOS characters set by ``++eos`` is found, or ``++read eoi`` will read until the EOI line is asserted. 50 | 51 | ++read_tmo_ms 1000 52 | Set the GPIB read/write timeout period in milliseconds. 53 | 54 | ++rst 55 | Resets the GPIBUSB adapter. Any unsaved settings will be restored to the previously saved values. 56 | Make sure to wait a few seoncds after sending this command for the adapter to fully restart. 57 | 58 | ++savecfg 1 59 | Saves current settings to EEPROM so that they can be preserved through restarts and power cycles. 60 | Although you can query the savecfg value with ``++savecfg``, this is only done for compatibility reasons. The only way to save your settings to EEPROM is to send ``++savecfg 1``. The following 61 | variables are saved: ``++mode``, ``++addr``, ``++eot_char``, ``++eot_enable``, ``++eos``, ``++eoi``, 62 | and ``++auto``. 63 | 64 | ++spoll 65 | Perform a GPIB serial poll on the currently specified GPIB address. In addition, you can inline specify a different address with the syntax ``++spoll 16`` where 16 is the target GPIB address for your serial poll. 66 | 67 | ++srq 68 | Returns that status of the GPIB SRQ line. Returns `1` if the line is asserted or `0` if not. If this returns `1` then that means a device on your GPIB bus is requesting service. You should then perform serial polls via ``++spoll`` to find which device needs service. 69 | 70 | ++status 0 71 | Sets the status byte of the adapter when in device mode. This byte is transmitted over the GPIB 72 | bus when addressed with a serial poll. Currently, device mode will not assert SRQ no matter 73 | what you set the status byte to. This will be implemented in a future firmware update. Valid 74 | values are `[0,255]`. 75 | 76 | ++trg 77 | Perform a GPIB bus trigger on the currently specified GPIB address by sending the GPIB command 78 | byte `GET`. 79 | 80 | ++ver 81 | Returns the string ``Version 5.0``. 82 | --------------------------------------------------------------------------------