0

community,

I'm using a Win 7 system with a Matlab R2015 with Instrument Control installed. And, a Tektronix TDS1012 oscilloscope connected to my computer via a USB-to-SERIAL connector. The device is connected and recognized by the PC and the Instrument Control.

If I send a program message, the instrument accepts it. On the other hand, when doing query requests, it reads the previous program message sent as the response messages. Example:

fprintf(deviceObj, '*IDN?')
fscanf(deviceObj)
ans = 
*IDN?

Moreover, if I sent a program message as *RST by doing, the instrument would reset, but also it outputs the same program message

fprintf(deviceObj, '*RST') #This Line
fscanf(deviceObj)
ans =
*RST

QUESTION: What do I am missing here? Could be my Usb-to-Serial Cable?

PS: here is the Oscilloscope Configuration (it matchs with the instrument configuration)

default_val = 

              BaudRate: 9600
     BreakInterruptFcn: ''
             ByteOrder: 'littleEndian'
        BytesAvailable: 0
     BytesAvailableFcn: ''
BytesAvailableFcnCount: 48
 BytesAvailableFcnMode: 'terminator'
         BytesToOutput: 0
              DataBits: 8
     DataTerminalReady: 'on'
              ErrorFcn: ''
           FlowControl: 'none'
       InputBufferSize: 512
                  Name: 'Serial-COM5'
      ObjectVisibility: 'on'
      OutputBufferSize: 512
        OutputEmptyFcn: ''
                Parity: 'none'
             PinStatus: [1x1 struct]
          PinStatusFcn: ''
                  Port: 'COM5'
         ReadAsyncMode: 'continuous'
          RecordDetail: 'compact'
            RecordMode: 'overwrite'
            RecordName: 'record.txt'
          RecordStatus: 'off'
         RequestToSend: 'on'
                Status: 'closed'
              StopBits: 1
                   Tag: ''
            Terminator: 'LF'
               Timeout: 10
              TimerFcn: ''
           TimerPeriod: 1
        TransferStatus: 'idle'
                  Type: 'serial'
              UserData: []
        ValuesReceived: 0
            ValuesSent: 0
>> default_val.PinStatus = 

CarrierDetect: 'off'
  ClearToSend: 'on'
 DataSetReady: 'on'
RingIndicator: 'off'
ilCris
  • 1
  • First narrow down whether you are dealing with local echo or remote echo. For example, by sending commands with the RS-232 end of the USB/serial cable unplugged from the 'scope. – Ben Voigt Mar 17 '21 at 21:51
  • Do you get any data coming from the 'scope intermixed with the echoed commands? If you hear both parties, that's "echo" (local or remote). If you only hear yourself, it is probably "loopback". – Ben Voigt Mar 17 '21 at 21:52
  • Whenever I try to get any data or querying, I hear only myself. During the time of the post, I was checking the adapter and it was already in a loopback configuration. Then, I disable the "local echo" using Termite, and still remains the "echo". I would check about the remote echo! But, that's for sure the path to follow thanks to your comment. – ilCris Mar 17 '21 at 22:24
  • "it was already in a loopback configuration" You don't want that. Disable loopback and see if it helps. – Ben Voigt Mar 18 '21 at 14:56

1 Answers1

0

Some serial interfaces do this on intention in case you want to daisy chain several devices. Repeating the command you can shift through the first device and address the next one by simply doubling the frame length. (Each device acts like a shift register).