Instrument-control Question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Instrument-control Question

Thomas D. Dean-2
instrument-control 0.3.0 /home/tomdean/octave/instrument-control-0.3.0

octave:105> s1 = serial("/dev/ttyUSB0", 19200, 10)
s1 =

   Serial Port Object
     open:     1
     port:     /dev/ttyUSB0
     baudrate: 19200
     parity:   None
     bytesize: 8
     stopbits: 1
     timeout:  10


octave:106>  n=srl_write(s1, "ID?"); disp(n); [data,count]=srl_read(s1,128)
  3
data = [](1x0)
count = 0


In gtkterm, this works.  The data is returned immediately.


id?
ID TEK/TDS 2014,CF:91.1CT,FV:v4.12 TDS2CM:CMV:v1.04


What am I doing wrong???

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

RE: Instrument-control Question

JohnD
> Message: 4
> Date: Sun, 27 Aug 2017 19:56:11 -0700
> From: "Thomas D. Dean" <[hidden email]>
> To: Octave Help <[hidden email]>
> Subject: Instrument-control Question
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=utf-8; format=flowed
>
> instrument-control 0.3.0 /home/tomdean/octave/instrument-control-0.3.0
>
> octave:105> s1 = serial("/dev/ttyUSB0", 19200, 10)
> s1 =
>
>    Serial Port Object
>      open:     1
>      port:     /dev/ttyUSB0
>      baudrate: 19200
>      parity:   None
>      bytesize: 8
>      stopbits: 1
>      timeout:  10
>
>
> octave:106>  n=srl_write(s1, "ID?"); disp(n);
[data,count]=srl_read(s1,128)

>   3
> data = [](1x0)
> count = 0
>
>
> In gtkterm, this works.  The data is returned immediately.
>
>
> id?
> ID TEK/TDS 2014,CF:91.1CT,FV:v4.12 TDS2CM:CMV:v1.04
>
>
> What am I doing wrong???
>
> Tom Dean
>

Try a bigger timeout and see if that helps.
You may need to also verify control lines that may be used in gtkterm




_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Aw: Instrument-control Question

Stefan Mahr
In reply to this post by Thomas D. Dean-2
> octave:106>  n=srl_write(s1, "ID?"); disp(n); [data,count]=srl_read(s1,128)
>   3
> data = [](1x0)
> count = 0
>
>
> In gtkterm, this works.  The data is returned immediately.
>
>
> id?
> ID TEK/TDS 2014,CF:91.1CT,FV:v4.12 TDS2CM:CMV:v1.04
>


You don't need to press <enter> in gtkterm to get the response? Most serial controlled instruments require newline to accept command:
srl_write(s1, "ID?\n")



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: Aw: Instrument-control Question

Thomas D. Dean-2
On 08/28/2017 08:46 AM, Stefan Mahr wrote:

>> octave:106>  n=srl_write(s1, "ID?"); disp(n); [data,count]=srl_read(s1,128)
>>    3
>> data = [](1x0)
>> count = 0
>>
>>
>> In gtkterm, this works.  The data is returned immediately.
>>
>>
>> id?
>> ID TEK/TDS 2014,CF:91.1CT,FV:v4.12 TDS2CM:CMV:v1.04
>>
>
>
> You don't need to press <enter> in gtkterm to get the response? Most serial controlled instruments require newline to accept command:
> srl_write(s1, "ID?\n")
>
>
>

Actually, what works best is "cmd\r\n"  The TEK TDS-2014 is set to
RS-232 EOL, not CR-EOL.  Strange

Tom Dean

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave