Supported ports

From SweepMe! Wiki
Jump to navigation Jump to search

@Users: If you have problems to connect or to find the right port, please read the Troubleshooting section of your port type. Feel free to contact us if you do not get a connection (support@sweep-me.net).

@Developers: There are several types of ports that are directly supported by SweepMe! which means that a valid port object is created by the PortManager of SweepMe! that can be used in a Device Class. Still, you can always create your own port objects and communicate via any other port type or interface by making use of the corresponding python libraries.

COM

A standard PC serial port based on RS-232 protocol or RS-485 protocol typically connected via a 9-pin or a 25-pin D-SUB adapter (https://en.wikipedia.org/wiki/COM_(hardware_interface). COM ports have many parameters that have to be adjusted to connect to a device. The default port properties used by SweepMe! are LineFeed = LF ('\n') as terminator and '9600' as baudrate. These properties can be changed in a Device Class. Please check the default values given in the Device Class.

Troubleshooting

Problem: Port cannot be found

  • Can you see the COM port in the Windows device manager?
  • Are you sure it is the right COM port? Plug in and out your device to see which COM port disappears and appears again.
  • Do you use a USB-to-COM adapter and might have to install a driver first?

Problem: Device does not respond

  • The default parameters are given in the Device Class, use the button 'Open/Modify' to see the default values and whether your device uses the same parameters?
  • Does your device need a crossover cable, also called null-modem cable? https://en.wikipedia.org/wiki/Null_modem
  • Does your device go into a timeout?
  • Have you maybe used the Port Manager ('Ports' -> 'PortManager') and overwritten some port specifications.

Problem: Cannot find COM port using USB as virtual COM port

  • Does your COM port number always change? Use the Windows device manager to define a fixed port number for each USB port. Try to use always the same physical USB port.
  • Have you installed the correct driver to use the USB interface of your device as virtual COM port?

Problem: Device Class programming

  • Is your baudrate and terminator correct?
  • Can you switch the device into remote mode by any command?
  • Can you use any command to query a value from the device?
  • Even though you might not able to read data from your device, can you set a value and prove a change at the display?
  • Can you reproduce your problem by creating a minimal working example using python and pyserial?
  • Do you need to add a 'delay' to port_properties to let the device process the previous command?

GPIB

The general purpose interface bus (GPIB) is an IEEE-488-Bus that is often used to connect measurement equipment. In the field 'Port' of a Device module, a GPIB port is shown as 'GPIB0::xx::INSTR' where xx is a number between 01 and 30. If one GPIB interface is installed, you have to use GPIB0 which is the default suggested port. In case you have multiple GPIB interface, e.g. a GPIB card and a GPIB-to-USB adapter, you can select the correct interface by using GPIB0 and GPIB1 (example 'GPIB1::xx::INSTR') and you might have to change the interface number manually. Please note that the button 'Find Ports' does not really search for ports. At the moment, it displays all possible addresses. Searching for GPIB ports typically takes some time which is why we decided to skip it. In future, we might add such a feature again.

Hardware

GPIB interfaces such as PCI cards or USB-to-GPIB adapter are sold by different companies. For each vendor exist different drivers and runtimes that should not be mixed up.

We know the following GPIB products:

Driver

Every GPIP adapter or GPIB card needs a driver that must be installed. Often the drivers are already installed with the runtime.

Runtime

see visa runtime

Additionally it might be needed to install NI-488.2 runtime: http://www.ni.com/de-de/support/downloads/drivers/download.ni-488-2.html

Prologix controller

Beginning with SweepMe! 1.5.5, we support the GPIB-USB controllers from Prologix [1]. Commands are sent via COM port to the controller. To configure it, go to menu 'File' -> 'Options' -> 'Ports' and select "Add port". Type in the COM port at which the Prologix controller appears. Check the device manager to find the correct port, e.g "COM7". This port will be added permanently for all users. Thus, make sure that the COM port does not change by giving it a fixed port number. You can remove a port using "Remove port". Once you added a COM port, you can find new GPIB resources in the port manager or when you press 'Find ports' button of a module that loads a device class that support GPIB. The new resources looks like "GPIB::20::Prologix@COM7" if you added COM7 as a Prologix controller port. You can add multiple COM ports if you have multiple Prologix adapters.

There is no need to modify instrument drivers as long as they use the port manager and "GPIB" is added as port type. The port manager will automatically redirect all commands over the Prologix GPIB controller if the corresponding port is selected.

Prologix GPIB-ETHERNET adapters are not yet supported but it can be done on request.

The FTDI driver for the Prologix controller can be found here: https://ftdichip.com/drivers/vcp-drivers/

To test whether the Prologix controller is correctly installed, your can use the tool Prologix GPIB Configurator: http://prologix.biz/resources.html

Limitations

  • If a large amount of data is transferred, it might be that the buffer of the FTDI USB driver is filled which has a size of about 4KB.
  • If multiple instruments are connected to one adapter, every time the instrument talked to changes, SweepMe! needs to send the new GPIB address. This can slow down the communication if many instruments are connected.
  • There is no support yet for service requests (SRQ) or status byte (STB) polls.

Troubleshooting

Problem: Error message "pyvisa.errors.VisaIOError: VI_ERROR_INTF_NUM_NCONFIG (-1073807195): The interface type is valid but the specified interface number is not configured"

For the given GPIB address number, no instrument can be found:

  • Check whether the instruement is correctly connected.
  • Check whether the entered GPIB address is the same as used by the instrument.
  • Check whether your computer might have multiple GPIB interfaces, e.g. a GPIB card and a GPIB adapter. It might be that you selected the wrong GPIB interface for which the given GPIB address is not known as well. For example, try "GPIB1::24::INSTR" instead of "GPIB0::24::INSTR" to select the second GPIB interface instead of the first. Use software tools like NI MAX to see which GPIB interfaces are currently installed.

Problem: Port cannot be found

  • Do you have installed the ni-visa runtime?
  • Do you have installed the driver for your GPIB card or your GPIB-to-USB adapter?
  • Is the installed driver the correct one and up to date?
  • Do you maybe use a newer driver that does not support your older hardware?
  • Can you see your GPIB interface in the Windows device manager?
  • After installing the ni-visa runtime, a program called NI-MAX is available. Can you use it to detect all available GPIB ports?
  • NI-MAX also shows you the GPIB interface number.
  • Do you have multiple GPIB interfaces installed?
  • Have you checked the cables, are they still properly connected?

Problem: Device does not respond

  • Have you selected the correct GPIB port of the equipment?
  • Check the communication properties of the device.
  • Some device support different GPIB protocols, e.g. '488.1' and 'SCPI' in case of a Keithley2400. Please test whether you have selected the correct protocol.
  • Switch the device off and on again. Often the GPIB address is shown during the startup of the device.
  • Some device support multiple communication ports. You might have to change to GPIB/IEEE-488/HP-IB.
  • Multiple devices can be connected via GPIB to a one interface card. Device, that are currently not needed and thatare switched off, can interfer. Try to remove them from the GPIB connection.
  • Try to restart your instruments, sometimes it helps.
  • If two computers are connected to one device, make sure that only one computer is running at the time.
  • Try to restart SweepMe!

Problem: Device Class programming

  • Is your device already older or somehow special and you need to use a different terminator character?
  • Send "*IDN`?" and check the answer. Do you get an identification string?
  • Can you switch the device into remote mode by any command?
  • Even though you might not be able to read data from the device, can you set a value and prove it via the display?
  • Can you reproduce your problem by creating a minimal working example using python and pyvisa?

USBTMC

A connection to a USB Test and Measurement Class (USBTMC) port, realized via pyvisa and ni-visa runtime.

Troubleshooting

Problem: Port cannot be found

  • Is the device connected and switched on?
  • Do you use the correct USB port of the equipment?
  • Do you have installed a visa runtime?
  • Do you see your device as USBTMC device in the Windows device manager?
  • Are you sure it is a device creating a USBTMC port? Many devices have a physical USB port which creates a COM port.

TCPIP

A TCPIP connection via pyvisa, e.g. to connect measurement instruments via ethernet.

To find a port, you need to register it with your visa runtime. For example, if you use the NI visa runtime, you can use the tool "NI MAX" to add TCPIP resources that afterwards will be also listed by the port manager of SweepMe!.

A TCPIP instrument resource has the format: "TCPIP[board]::host address[::LAN device name][::INSTR]", e.g. "TCPIP0::192.168.0.10::INSTR"

Troubleshooting

not available

VB

A National Instruments VirtualBench device.


MIDI

Under consideration. In future, MIDI ports could automatically be found. Please contact us if this would be interesting to you.

CAN bus

CAN bus is not yet implemented. Further information can be found here: https://en.wikipedia.org/wiki/CAN_bus

If you like to communicate via CAN bus, we recommed to create a Device Class by implementing your own port object using the library python-can (https://python-can.readthedocs.io/en/master/).