LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bytes at serial port equal zero

i've messed with all 3 examples labview has on serial write/read. i can't seem to read anything, my bytes at port after the write give me 0. i've added a wait on next ms with no success. serial port configuration is correct. i've gone into MAX, and i can't seem to read from there either. can anyone help?

--cjm
0 Kudos
Message 1 of 7
(3,658 Views)
Did you test things with Hyperterminal? Does your serial instrument require a termination character for commands that you write and are you sending it?
0 Kudos
Message 2 of 7
(3,658 Views)
i'm simply writing a string to the port and trying to read it from the port. i don't have an instrument attached yet.
0 Kudos
Message 3 of 7
(3,658 Views)
Is your loopback cable correct? If you've got a DB9, you connect pins 2 and 3.
0 Kudos
Message 4 of 7
(3,658 Views)
Hi, CJM ..
1/ what version of Labview are you using?
2/ get the loopback working first so that you know the pc is behaving. NI has the loopback.vi in its library (may be online, don't recall.) The pc usually defaults to 9600 baud, but you really need to get this tested and working first.
3/ what vi are you using to try to read the serial port? I seem to recall that with V6 the serial read example vi seemed to need an additional delay at the end of the vi to work right.
- Good luck!
-Dave
0 Kudos
Message 5 of 7
(3,658 Views)
hi folks,

it seems its working now, i had my pins wired wrong, using hyperterminal helped.

thanks.

-cjm
0 Kudos
Message 6 of 7
(3,658 Views)
I have the same problem and I am using a simple modified sample vi from labview. My problem is that when I am starting the vi sending a string, waiting 5seconds and then checking bytes at port and reading out all bytes, the bytes at port property does not work properply. It shows 0 bytes at port. If I use the higlight function to find an error it works without problems. Therefore I increased the delay time between read and write to 12 seconds ( and many other values) and it is alltime the same. I do not know but it seems that labview is not able to check the bytes at port.
Maybe it depends on the processor power (1,8GHZ) or something else.
When I set the bytes to a constant amount everything is alright, only the function "bytes at port" make things going wrong
.

Hope I find the error soon.
0 Kudos
Message 7 of 7
(3,658 Views)