LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with reading a seriell port

Hello there,

my LabView programme reads data over a seriell port form a scale. One typ of
scale runs without any problems the other type does not, it only reads the
negative values, any values greater or equal zero are displayed as zero.
Confusing that both seriell port have the same configurations: both use 8
databits, 1 startbit and 1 stopbit, also they both don't use the partitybit. And this are the only paramerters (plus the port number) that have to be defined, while using the sub.vi seriell port init, seriell port read and bytes set at seriell port.
Does any have an idea what's wrong? And by the way, what exactly is described with "byte count" in the bytes set at seriell port vi?

Thanks for any help,

Ruth.
0 Kudos
Message 1 of 9
(3,098 Views)
Now this is very strange! It sounds like one of two things to me: either the scale is not working corrently or the serial port is. Try switching the scales to different ports and see if the same scale returns bad values or if the same serial port reports bad values. If it's the same serial port, try a loopback test to see if that port is broken. If not, then something in your code is treating that differently and you'll want to track down how you're treating it different from the other port.

The "byte count" returned by Bytes at Serial Port.vi is the number of bytes which have been sent to that port. They are waiting to be read. You can check that to know ho
w many bytes you should read at a time.
J.R. Allen
0 Kudos
Message 2 of 9
(3,098 Views)
I'd also suggest trying hyperterminal to talk to the second scale. If you see the same thing there, then you know the problem is with the instrument.
0 Kudos
Message 3 of 9
(3,098 Views)
1. What is the format of the data being transferred? ASCII? Binary?2. Are the scales identical? Are they running the same LV code?Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(3,098 Views)
Hello Mike,

the format of data being tranferred is 8.bit ASCII, both scales use this
format.
No the scales aren't identical, although they were developed by the same company, only the seriell port configurations are. Their menus are differently designed and they have to be diffently handeld, but in the end the only important difference between them is their weight range.
What do you mean with LV code???

Until here thanks for your intrest, Ruth.
0 Kudos
Message 5 of 9
(3,098 Views)
Hello JRA,

>Now this is very strange!
It realy is!!!

>It sounds like one of two things to me:
>either the scale is not working corrently or the serial port is.
I have testet this already, I have used several ports, several scales, even
several cabels. But it was always the same result, just as I told in my
posting...

>Try switching the scales to different ports and see if the same scale
>returns bad values or if the same serial port reports bad values. If
>it's the same serial port, try a >"http://digital.ni.com/public.nsf/websearch/E22DA85E97818DE78625678C0069BFC9?OpenDocument">loopback
...
to see if that port is broken. If not, then something in
>your code is treating that differently and you'll want to track down
>how you're treating it
different from the other port.
>
>The "byte count" returned by Bytes at Serial Port.vi is the number of
>bytes which have been sent to that port. They are waiting to be read.
>You can check that to know how many bytes you should read at a time.
Thank you, Isuggested this, but I wasen't sure.

Greetings, Ruth.
0 Kudos
Message 6 of 9
(3,098 Views)
Hello Dennis,

>I'd also suggest trying hyperterminal to talk to the second scale. If
>you see the same thing there, then you know the problem is with the
>instrument.
Thanks first for your interest, but I
didn't catch what you meant, because in particular my technical terms aren't
that good and I didn't found especially the word "hyperterminal" in my dictonary. So would yoe explain to me in other words your suggesttion.

Thanks, Ruth.
0 Kudos
Message 7 of 9
(3,098 Views)
Hyperterminal is a terminal emulation program that is part of Windows. You should be able to find it in Start>Programs>>Accessories>Communication. It's a great tool to see if your cable, device, settings, etc., are all correct before trying to write a program.
0 Kudos
Message 8 of 9
(3,098 Views)
What I mean is, are you using the exact same VIs for talking to both scales? The point is that there is something strange going here, and a good place to start looking for this sort of problem is to identify exactly what is different between the two scales.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 9
(3,098 Views)