LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How get screen of tds3012b by rs232

I am using a TDS3012B to get screen by HARDCopy STARt command.

 

In GPIB, it is ok. But in rs232, i cannnot get enough data before vi exit.

 

I don't know how to resolve it. After reading many threads in this forum,

 

but don't know  its reasong yet. It is an old device, but please help me.

 

thanks very much.

 

my enviroment:

labview 8.5.

Tds3012b dirver: get from ni network:Driver Revision: 2.

serial port setting: rate:19200/flow control: RTS/CTS/databit:8 (driver provide only this three setting)

 

attach my vi, please help me abou tit.

 

thanks.

 

Download All
0 Kudos
Message 1 of 18
(5,156 Views)

add more information for my problem:

 

i want to get a png data from tds3012b. its lenght is not fixed. So i have to define 20000 bytes to read.

 

But every time,  i only can get about 100 bytes or less  and vi exit. So if anyone can tell me how to read

 

vaibale data by rs232, it is very helpful for me.

 

Thanks.

0 Kudos
Message 2 of 18
(5,143 Views)

You probably need to disable the termination character detection because you are reading binary. I would also recomend you use the VISA Bytes at Serial Port instead of a fixed count and relying on a warning to stop your loop.

0 Kudos
Message 3 of 18
(5,132 Views)

hI, Dennis,

 

thank your answer.

 

But can you tell me how to do it more detaily?

 

about visa Bytes at Serial Port, Do you mean that i should call it in a loop? I had tested it before, its return is not the value that i wanted.

 

By now, I creae a loop and read visa in it. i have to wait for timeout so that i can exit from loop.  it is not a good solution.

 

Is there any other solution?

 

thanks.

 

br.

0 Kudos
Message 4 of 18
(5,126 Views)

Below is the VISA property node. It's also in the initialize function. You would need to set the value to false.

 

Yes, you can place the VISA Bytes in a loop - actually 2. The first loop you exit when the byte count is greater than 0. The second loop also has a VISA Read, This loop you exit when the number of bytes is equal to 0. A shift register and a concantanate string is used to hold all of the data.

 

Looking at how a waveform is being fetched, the read loop you have now in is the same. Not sure why yours would not work.

 

0 Kudos
Message 5 of 18
(5,119 Views)

HI, Dennis

 

thank you.

 

I had tested according to your advice.

 

Just like you side, my dirver set TermCharEn is true.

 

i add two loop in my vi, it can work now. I attached below.

 

my question is:

 

(1) should i use bytes at port again in second loop?  If i use it, it always return 0, so second loop exit before getting all data.

 

    So i have to set 20000 again. Please correct it. 

 

(2) I try to set "TermChar En" to true again, my vi can work too. So should i only do one thing, changing "Term char EN" or use two loop, right?

 

thanks your help very much. It is a great progress for me.

 

mwt.

0 Kudos
Message 6 of 18
(5,111 Views)

First, set enable term char to false, then run your first loop without a VISA Read, then in the second loop, wire result from the VISA Bytes to the VISA Read byte count. Also use this value to terminate the loop - not the result from the VISA Read

0 Kudos
Message 7 of 18
(5,104 Views)

hi, Dennis

 

just try it according to your answer,

 

But it seem that it cannot work normally.

 

VISA Bytes often return 0 byte and the second loop will exit, so the png data don't finish at all.

 

attach my implementation.

 

0 Kudos
Message 8 of 18
(5,058 Views)

Try putting a longer delay in your second loop.  And also, try using the Wait Function instead of the wait until next msec function.

 

It's theoretically possible that if that loop runs too fast, you get bytes, it iterates, and the next bytes coming to the port haven't arrived yet.  And the wait until next msec function means the wait could be up to 5 msec, but often could be less.

 

Try using a regular wait, and make it 100 msec.

0 Kudos
Message 9 of 18
(5,049 Views)

hi, Ravens Fan,

 

I had set 200 ms in loop,the second loop always exit becasue bytes at port return 0,

 

information just like below:

 

VISA:  (Hex 0x3FFF0006) The number of bytes transferred is equal to the requested input count. More data might be available.

 

So problem still exist.

 

thanks.

0 Kudos
Message 10 of 18
(5,038 Views)