LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have to REBOOT my computer very thime I use this simple VI

Hi all,
The attached vi is called by another vi when the user wants to know if the [black box] has power. It simply send a command to the [generic a/d..d/a board] which asks the voltage at a certain pin. It works fine! HOWEVER, after I use it, the computer has to be rebooted. I loose communications with the [generic a/d..d/a board]. The only thing I'm doing differently with this vi than the other 20 I have written is Reading the serial port. All of my other programs just write to the port.
Any ideas?

Thanks in advance, this forum is great!
Richard






0 Kudos
Message 1 of 5
(2,656 Views)
It wasn't something to reboot my computer. Anyway, you do have a race condition ... somehow. Find attached VI (your VI modified) and try it. If you still have problems, may be the communication in this one interfering with others or the way COM port identifiers are set on your computer.

I assume that you are trying to use COM1. Is it possible to have another VI trying to write to the same port in the same time with this one ?

Hope this helps
Message 2 of 5
(2,656 Views)
Thanks! A race condition makes sense, because I have had some intermittent behavior.

Now if i can only learn to spell check my questions... very thime... argh.
Richard






0 Kudos
Message 4 of 5
(2,656 Views)
Arrow;

Looking at your vi, I have some comments:

- There is no data dependency between the Serial Port Write and Serial Port Read functions. Although you place the VIs one next to the other, that does not guarantee the order of execution, so you may have a race condition in which the read from serial is happening before sending the command with Serial Port Write function.

- I think this command need to be executed only once. If need to confirm, you can place a button to resend the command and then read the serial port. The way is working now is repeating the read/write every 1/10 of a second or so!!

I took the risk to modify your vi to resolve this issues, and the resulting vi is attached. This is only a recommendation.


I hope this is of help

Best regards;
Enrique Vargas
www.vartortech.com
Message 3 of 5
(2,656 Views)
Thanks Enrique... I'm thinking now that it was a race condition. I'm learning to appreciate program flow now. You also got me thinking about the fact that I'm continuously polling the instrument. Your example is much appreciated.
Richard






0 Kudos
Message 5 of 5
(2,656 Views)