05-03-2017 10:42 AM
Hey Guys! I've got a program that is supposed to send a *IDN?\n to a com port to get a response. I know that the hardware is working because it responds in NI max
However, When I do the same in LabVIEW I get a timeout error:
My code is here and everything is zipped below:
My question is, the message I'm sending to the board seems identical, however my read is not getting any response in LabVIEW while it's working just fine in Ni Max.
Any suggestions would be appreciated.
05-03-2017 11:01 AM
1. For your string constants, go to Visible->Display Style. Make sure that is turned on. It makes things easier to debug. My first thought was that you had it in normal display, which means you would not be sending the same thing. But you actually do have the \ Codes turned on.
2. Try removing the VISA Open. It might be resetting some of your settings that you just configured.
3. Another experiment to try if (2) does not work is set the number of bytes to read to 1. This will just verify that you can read something.
05-03-2017 11:19 AM
@crossrulz wrote:
1. For your string constants, go to Visible->Display Style. Make sure that is turned on. It makes things easier to debug. My first thought was that you had it in normal display, which means you would not be sending the same thing. But you actually do have the \ Codes turned on.
Done! Believe me, I've wished that was the problem for a few hours now.
2. Try removing the VISA Open. It might be resetting some of your settings that you just configured.
Ok, This seems to have worked, but now it seems I have to run the vi once to open the com port and once to get a response. Which is better . My only question would be: Why?
05-03-2017 12:06 PM
The only other item I see that is different is the Flush Buffer, which you really do not need.
The other comment I have is to make sure that serial port is being closed.
05-03-2017 12:46 PM
Lets take a closer look at your port settings.It looks like you have a conflict with flow control