Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

using serial port of a desktop PC to control an external device connected to it using LabVIEW

Hi all
I am controling an extrenal device connected to the serial port of a desktop PC using LabVIEW , the theroy of  my work is  that when that the extrenal device will perform an action , then it will send "A " ASCII character to the serial port of the Pc to acknowldege that it has finshed its action , when the PC recives an " A" ASCII character  from the serial port using the LabVIEW program atttached with my post , it will perfom the additon of two numbers , if not it will subtract the two numbers , if the "A" character recived  and after performing the additon process it must send a " B" ASCII character ( write )  to the serial port and when the external device recives the  " B "  ASCII character it will  resume doing its action again, it seems that  ( writing ) to the serial port is not done and I dont know why , and also when I check about the " A" ASCII character , there is an error message
attached is my LabVIEW porgram and what shows as an error , could any one help me with this problem
thnaks alot
 
0 Kudos
Message 1 of 4
(3,521 Views)
sorry forget to attach the LV program and the error picture
0 Kudos
Message 2 of 4
(3,516 Views)
and  the LV program also is here
0 Kudos
Message 3 of 4
(3,514 Views)
a short look at your code:
1- serial init should be done once at the beginning, before you enter the loop
2- you want to read one character, but you configured the visa read to wait for 7 bytes -> timeout error, so even when your 'A' is received the 'B' will not be send
 
3- where is your VISA close? (once when program finish)
 
 

Message Edited by Henrik Volkers on 07-31-2006 02:11 PM

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(3,483 Views)