LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic serial write and read

I am using LabView 8.6 on Windows Vista and trying the Basic serial write and read VI to communicate with a Keyence sensor over RS232.  I tested this communication over hyperterminal and it worked fine.  When I use the VI it works only when Highlight Execution is turned ON.  I have a delay before read set to 500 ms (and tried other values) and it returns no values under regular execution.  I have used this VI prior with Windows XP and same version of LabView with no problems.  Any help would be appreciated.

 

 

0 Kudos
Message 1 of 12
(4,479 Views)

Can you post the VI? If you cannot post the whole thing just post the relavent parts.

=====================
LabVIEW 2012


0 Kudos
Message 2 of 12
(4,470 Views)

This is the Basic Read and Write example I am trying to use.

0 Kudos
Message 3 of 12
(4,462 Views)

Interesting. I don't see anything that jumps out. Did you try changing the 500mS wait to something crazy like 5,000mS? You might try putting a delay after the configure.

=====================
LabVIEW 2012


0 Kudos
Message 4 of 12
(4,451 Views)

In the code you posted, the Enable Termination Char is set to false. Try changing it to true.

Alejandro C. | National Instruments
0 Kudos
Message 5 of 12
(4,428 Views)

I have tried a variety of delay times, from 10ms up to 10,000ms.  It eventually timesout when the delay is too high.  I have also tried enabling and disabling the Enable Termination Char.  This example worked without any problems with the same hardware when I used it on a Windows XP computer, this problem came up when i switched to a Windows Vista computer.  Could that be affecting it somehow?  

 

 

0 Kudos
Message 6 of 12
(4,426 Views)

Is NI-VISA installed on the Vista machine? If so what version?

0 Kudos
Message 7 of 12
(4,417 Views)

How about trying a small delay between each character that is written? So if you are sending *IDN?, write *, wait, write I, wait, write D, wait, write N, wait, write ?

 

 

0 Kudos
Message 8 of 12
(4,411 Views)
Did the com port change? But you said you verified the code with hyperterm.. Are you sending a carriage return? I'm not at a computer with LabVIEW.
=====================
LabVIEW 2012


0 Kudos
Message 9 of 12
(4,403 Views)

I did not originally have NI-VISA installed, but I did install it (version 5.1.2).  I did not try sending one character at a time, however I did try sending one bit at a time.  It did not make a difference.  I am also sure I have the correct port because it works when Highlight Execution is enabled.

0 Kudos
Message 10 of 12
(4,399 Views)