09-27-2006 10:51 AM
Hello All,
I am trying to setup a serial connection in Labview. Having little experience with Labview (I just installed version 6.1), my first instinct was to try out one of the examples. I am using “LabVIEW <-> Serial.vi”, which some of you may already have. Upon request, I can post this VI if necessary. The VI is simple; it configures the serial port, transmits a string specified by the user, receives a specified number of bytes and closes the connection.
I was able to get the transmit part working without any problem. Since I can already communicate with the instrument with HyperTerminal, this was easy to verify. I can write to a register on the instrument using Labview and read it back using HyperTerminal to verify that the data was written correctly. At this point I am assuming that I have the serial connection configured correctly in Labview.
After transmitting the string, the program enters a while loop that checks how many received bytes are available at the port. For some reason, the received bytes never appear (i.e. the output from “Instr – Bytes at Port” is always zero). I have tried playing with the configuration (and even eliminating this loop from the program), but can’t seem to get this to work. The next step in the program is to actually read the bytes from the port, but of course I never get that far because it gets stuck in the loop.
Does anyone have an idea why I can transmit bytes but not receive them? It is probably something really simple that I am missing. I am certain that there should be data received because the device responds to any command that you send to it, even if the command is invalid. I’ve verified this with HyperTerminal; there is always a response.
09-27-2006 11:07 AM
09-27-2006 12:13 PM