Serial Read locks up program 
Author Message
 Serial Read locks up program

I'm using the Serial Port to write strings to a control
board. When I use Serial Port Read, it works, but the program from
that point on will not Write to the port again. I am initializing at
startup, and I am using the Bytes At Serial with a scaler of 5
wired to it because that's how many bytes I want to read. Any help? I
prefer not to use Visa, unless i can be persuaded otherwise.

Fri, 20 Aug 2004 02:32:20 GMT  
 Serial Read locks up program
It sounds like a race condition (the attempt to read is happening
before writing the command or too fast after it). Try to use a
sequence, having Write in frame 0, a Delay in frame 1 and Read in
frame 2.
Regarding the Bytes At Serial Port I am not sure I understood how you
are using it. Usually, have a loop ending when you have enough bytes
to serial port or a timeout occurs (and after that read if not
It may be easier for us if you can post that VI.

Hope this helps

Fri, 20 Aug 2004 10:20:44 GMT  
 Serial Read locks up program
Just out of curiosity, why do you not want to use VISA?

Fri, 20 Aug 2004 23:08:34 GMT  
 Serial Read locks up program
There is confusion regarding how you are using Bytes at Serial Are you using this to find the number of bytes waiting in the
buffer and then feeding that into the Serial Port It sounds
like you have wired a 5 into the Bytes at Serial which would
mean that you're reading from COM6. Please clarify or send your VI so
we can have a look at it.

And, one of my usual addins: No, don't use VISA. Your serial VIs will
work on a much wider range of machines if you don't use VISA for the
serial port.


Sat, 21 Aug 2004 00:06:18 GMT  
 Serial Read locks up program
I've thought about the race condition... I'll look into it, especialy
since I'm using a few local variables in the program.
As for the Bytes At Serial Port, by trail & error, I found I had to
put that vi before the Read Serial Port vi or the Read vi would not
work. Without using the Bytes At Serial Port vi, the readout would
look like pure ASCII and did not make any sense. Assuming it *was*
ascii, I converted several data points to decimal and it made no
sense. By using Bytes At Serial Port, the gibberish ascii looking
stuff became decimal and the data was correct. I grab 5 bytes because
that gives me 3 digits right of the decimal point.

Sat, 21 Aug 2004 06:17:38 GMT  
 Serial Read locks up program
After reading the comment by Rob, I looked at the code again, and the
5 is wired to "requested byte count" of the Serial Port Read vi. The 5
is NOT wired to the Bytes At Serial Port. My mistake!

Sat, 21 Aug 2004 06:23:46 GMT  
 Serial Read locks up program
See my comment above... I made a mistake in describing where I had the
5 wired. I edited my code, deleted what I thought was a race
condition, and now there's NO Bytes At Serial Port vi, and it works
fine, but I still have the problem with the machine not writing to
com1 after it has read from com1. I have to reboot!

As for Visa: I don't want to use Visa because I don't want to worry
about other machines that use my code (and exe's) having Visa

Sat, 21 Aug 2004 06:31:20 GMT  
 [ 7 post ] 

 Relevant Pages 

1. Lock-ups on Network

2. Lock-ups in 4.0

3. Lock ups under '98

4. Lock-ups using

5. MF Cobol 3.2.50 for DOS lock ups

6. sample program to read from serial

7. a traffic light program with lock's (num loack Caps loack and scroll lock)

8. UPS that will save/restore my DVF programs

9. num lock, caps lock, scroll lock lights

10. serial port key-lock

11. Feature request: VISA serial locking

12. Index lock error & Read Error


Powered by phpBB® Forum Software