LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial read inserts carriage return

hi
i tried to read data from an eprom over the
serial port. this works fine with visa, but
for every \10 (linefeed) i read labview inserts
a \13 (carriage return). i've no idea how to
turn this "feauture" off, tried to change sth.
in the property node, but nothing worked.
can somebody help me ?

greets krzysztof


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 1 of 5
(2,654 Views)
krzysztof8048@my-deja.com writes:

> hi
> i tried to read data from an eprom over the
> serial port. this works fine with visa, but
> for every \10 (linefeed) i read labview inserts
> a \13 (carriage return). i've no idea how to
> turn this "feauture" off, tried to change sth.
> in the property node, but nothing worked.
> can somebody help me ?

It´s not a big issue with text (A-Z etc) interface languages because
both normally mean "end of message". Try some of the string functions
for replacing. I like this VISA "feature", because I don´t have to count
bytes to read. Put in a big number and you will get anything available
without a timeout.

With a binary (\0..\255) interface you are in trouble. I have to
address this issue in my own application. Thanks for remindin
g me. VISA
allows message end characters and has a different property for
switching them on or off. The property node is the right place to
start searching.

Please tell me the solution.

Johannes Niess
0 Kudos
Message 2 of 5
(2,654 Views)
moin

i have indeed to read raw binary data, up to now i have solved this
problem by simply removing the \r when a \r\n (\r is a carriage return,
\n is newline) was received with the match pattern vi and the string
subset vi.
but i've just found out that this is not a solution, the problem
is that labview not only changes a \n to \r\n but it also
changes a \r to \r\n , so i don't know if i've go a \r or an \n when
reading a \r\n, now i have really a problem.

In article ,
Johannes Niess wrote:
> krzysztof8048@my-deja.com writes:
>
> > hi
> > i tried to read data from an eprom over the
> > serial port. this works fine with visa, but
> > for every \10 (linefeed) i read labview inserts

> > a \13 (carriage return). i've no idea how to
> > turn this "feauture" off, tried to change sth.
> > in the property node, but nothing worked.
> > can somebody help me ?
>
> It´s not a big issue with text (A-Z etc) interface languages because
> both normally mean "end of message". Try some of the string functions
> for replacing. I like this VISA "feature", because I don´t have to
count
> bytes to read. Put in a big number and you will get anything
available
> without a timeout.
>
> With a binary (\0..\255) interface you are in trouble. I have to
> address this issue in my own application. Thanks for reminding me.
VISA
> allows message end characters and has a different property for
> switching them on or off. The property node is the right place to
> start searching.
>
> Please tell me the solution.
>
> Johannes Niess
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
0 Kudos
Message 3 of 5
(2,654 Views)
krzyszto@vis.ethz.ch writes:

> moin
>
> i have indeed to read raw binary data, up to now i have solved this
> problem by simply removing the \r when a \r\n (\r is a carriage return,
> \n is newline) was received with the match pattern vi and the string
> subset vi.
> but i've just found out that this is not a solution, the problem
> is that labview not only changes a \n to \r\n but it also
> changes a \r to \r\n , so i don't know if i've go a \r or an \n when
> reading a \r\n, now i have really a problem.
>

That´s a serious bug. It makes a lot of my work useless. I had a
long discussion with dan.mondrik@natinst.com about VISA (serial)
locking (on the mailing list). He promised a followup. It turned out
that locking isn´t totally based on sessions
. The same is true for
properties like baud rate etc. It looks like _all_ ways to do serial
I/O in LV have bugs.

Did you try the end char properites of VISA?

Johannes Niess
0 Kudos
Message 4 of 5
(2,654 Views)
It´s long time ago, you asked your question, but I have a similar problem, maybe the solution helps some other guys.

Solution:

I use Visa Open, Read Write Close etc...
After Opening I use a property node to:
Set FlowControl to none (maybe its not really necessary)
Set SerialEndModeForReads to none

Now it works.

Stephan
0 Kudos
Message 5 of 5
(2,654 Views)