Supported ports: Difference between revisions

From SweepMe! Wiki
Jump to navigation Jump to search
No edit summary
Line 89: Line 89:
* Switch the device off and on again. Often the GPIB address is shown during the startup of the device.
* 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.
* 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.
* 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'''
'''Problem: Device Class programming'''

Revision as of 20:01, 23 October 2019

@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 objectes and communicate via any other port type or interface by making use of the corresponding pytho libraries.

COM

A standard PC serial port based on RS-232 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

In order to use GPIB, you need to install a 488.2 runtime. This runtime will handle the correct handling of the communication. To check whether SweepMe! was able to find a runtime, go to the menu 'Ports' -> 'Port manager' and check whether there is an error message.

There exist different vendors that have their own runtimes, e.g.


Troubleshooting

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?
  • 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.
  • 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 the ni-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.

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/).