Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

CP210x UART Bridge and VISA

Сonnect the adapter USB - RS232 to the USB port computer.

Bus 004 Device 008: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x UART Bridge / myAVR mySmartUSB light

Tuned port /dev/ttyUSB0

stty -F /dev/ttyUSB0 raw speed 9600 -ixon cs8 -parenb -cstopb

Data transmission works fine in terminal or PuTYY but VISA Interactive Control gives an error message:

Error opening resource:
ASRL5::INSTR
VISA:  (Hex 0xBFFF0000) Unknown system error (miscellaneous error).

Find links: http://forums.ni.com/t5/NI-Linux-Real-Time-Discussions/FTDI-USB-Serial-Adapter/td-p/3375153

and

http://forums.ni.com/t5/NI-myRIO/Using-USB-RS485-or-other-USB-to-COM-devices-on-myRIO/ta-p/3491726

[root@localhost dev]# chmod 666 ttyUSB0
crw-rw-rw-.  1 root dialout 188,   0 Nov 19 03:39 ttyUSB0
[root@localhost dev]# ln -s /dev/ttyUSB0 /dev/ttyS4
lrwxrwxrwx.  1 root root          12 Nov 19 02:15 ttyS4 -> /dev/ttyUSB0

In visaconf.ini 

Name10="ASRL11::INSTR"
Enabled10=1
Static10=1
SystemName10="/dev/ttyS4"
BaudRate10=9600
DataBits10=8
Parity10=0
StopBits10=10
FlowCtrl10=0
Name4="ASRL5::INSTR"
Enabled4=1
Static4=1
SystemName4="/dev/ttyUSB0"
BaudRate4=9600
DataBits4=8
Parity4=0
StopBits4=10
FlowCtrl4=0

The problem (Unknown system error (miscellaneous error)) persists.

What to do next?

 

0 Kudos
Message 1 of 23
(6,533 Views)

add

 dmesg | grep UART
[  777.457132] usb 4-2: Product: CP2102 USB to UART Bridge Controller
0 Kudos
Message 2 of 23
(6,493 Views)

Hi nisun07,

 

What is the command you are sending through the VISA Interactive Control? You could try a couple of basic SCPI commands to ensure that the two are able communicate properly.

 

Eric Wang

Applications Engineering

0 Kudos
Message 3 of 23
(6,473 Views)

When you connect the device USB-RS232 to the port.  Appears /dev/ttyUSB0. (fig1.png)

Then

[root@localhost dev]# chmod 667 ttyUSB0
[root@localhost dev]# ln -s ttyUSB0 ttyS4
[root@localhost dev]# ls -la
lrwxrwxrwx.  1 root root           7 Nov 27 06:13 ttyS4 -> ttyUSB0
crw-rw-rwx.  1 root dialout 188,   0 Nov 27 05:55 ttyUSB0

Refresh Visa Interactive Control (fig2.png)

Error opening resource: 
ASRL5::INSTR
VISA:  (Hex 0xBFFF0000) Unknown system error (miscellaneous error).
Download All
0 Kudos
Message 4 of 23
(6,452 Views)

NI-VISA Configuration:

Resource Name: ASRL5::INSTR

Binding: /dev/ttyS4

Baud Rate: 9600

Data Bits: 8

Stop Bits: 1

Parity: None

Flow Control: None

State of the Device:

Enable, Uncertain, Staticslly Added

0 Kudos
Message 5 of 23
(6,447 Views)

Have you tried an I/O Trace?

 

http://digital.ni.com/public.nsf/allkb/282C5D41E2BA04F2862574BA007803B9

 

Eric Wang

Applications Engineering

0 Kudos
Message 6 of 23
(6,416 Views)

I have found only NI-VISA (fig3.png)

NI-trace log shows (fig4.png)

Download All
0 Kudos
Message 7 of 23
(6,411 Views)

When connected PL2303

Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port

I get this ni-trace log (fig5.png)

But when connected

Bus 003 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC

get ni-trace log (fig6.png)

No connection errors.

 

[root@localhost dev]# lsmod 
Module                  Size  Used by
ftdi_sio               39275  0 
pl2303                 18570  0 
cp210x                 21551  0 
Download All
0 Kudos
Message 8 of 23
(6,405 Views)

Install PyVisa

>>> rm.list_resources()
(u'ASRL1::INSTR', u'ASRL5::INSTR')
>>> rm.list_resources()
(u'ASRL1::INSTR', u'ASRL5::INSTR')
>>> inst=rm.open_resource('ASRL5::INSTR')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1644, in open_resource
    res.open(access_mode, open_timeout)
  File "/usr/lib/python2.7/site-packages/pyvisa/resources/resource.py", line 203, in open
    self.session, status = self._resource_manager.open_bare_resource(self._resource_name, access_mode, open_timeout)
  File "/usr/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1601, in open_bare_resource
    return self.visalib.open(self.session, resource_name, access_mode, open_timeout)
  File "/usr/lib/python2.7/site-packages/pyvisa/ctwrapper/functions.py", line 1211, in open
    ret = library.viOpen(session, resource_name, access_mode, open_timeout, byref(out_session))
  File "/usr/lib/python2.7/site-packages/pyvisa/ctwrapper/highlevel.py", line 188, in _return_handler
    raise errors.VisaIOError(ret_value)
pyvisa.errors.VisaIOError: VI_ERROR_SYSTEM_ERROR (-1073807360): Unknown system error (miscellaneous error).
>>> 
0 Kudos
Message 9 of 23
(6,373 Views)

compile driver cp210x.ko from the source code

-rw-r--r--. 1 root root 226K Dec  1 02:50 cp210x.ko
-rw-r--r--. 1 root root  32K Dec  1 02:48 cp210x.ko.old

error "Unknown system error (miscellaneous error)" is present

0 Kudos
Message 10 of 23
(6,363 Views)