12-16-2011 03:18 PM
I have an external device that I need to write and read simple ascii commands to through a serial port. For some unknown reason I can not get Labview or for that matter M&A to com to it. I can com to it through a terminal (putty) with no problems. I have tried through M&A and also several labview basic read & Write Serial example VIs. No luck. All I need to send is $1RD This tells the external device to send a measurement back. Its basic ascii. The device coms on 19200 baud 8 bit words no party or flow control and 1 stop bit. Anyone have any ideas?
12-16-2011 03:37 PM
You can get it to work with putty?
Do you have to hit the enter key in putty after you type in $1RD to get a reply?
If so are you sending the enter key (CR) in LabVIEW?
12-16-2011 03:42 PM
12-16-2011 04:26 PM
@Bkasper wrote:
It works fine in putty. Yes I have to press the enter key to send the $1RD. I have tried adding \r and \s to the end of the command in labview, but no luck.
Try adding a \r\n or just a \n to the end of the line. A carriage return by itself is not a normal line termination.
12-16-2011 04:27 PM
The "enter" key sends a New Line \n
In LabVIEW in the string constant that you are sending, type $1RD and just hit the enter key and not try to enter \r or \n.
12-16-2011 05:11 PM
10-27-2016 05:16 PM
There is an easier way to read/write ASCII on the serial port. We have developed a package on the LabVIEW Tools Network to automate serial port interactions. You can use it to replicate what you manually do using Putty in LabVIEW for serial devices such as responding to login prompts, entering commands, waiting for a response and returning it. You can find out more about it and download a 30-day free trial at: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214248
10-27-2016 06:04 PM
Bumping every thread you can find to sell your product is pretty much the definition of spam.
How about you calm down JUST a tad and limit yourself to posts that have had activity in the past couple years, at least?
10-28-2016 09:44 AM
@ALAB wrote:There is an easier way to read/write ASCII on the serial port. We have developed a package on the LabVIEW Tools Network to automate serial port interactions. You can use it to replicate what you manually do using Putty in LabVIEW for serial devices such as responding to login prompts, entering commands, waiting for a response and returning it. You can find out more about it and download a 30-day free trial at: http://sine.ni.com/nips/cds/view/p/lang/en/nid/214248
Your enthusiasm for your product had temporarily blinded you to basic forum etiquette. Glad you regained your sight. 🙂
10-28-2016 12:36 PM
You shouldn't have to use a wait to get all the bytes that you need. I am assuming you are using serial communications.
If I do not know what the termination charaecter is, or just need to verify what the documentation is telling me, I like to first just do a basic write/read communication with some high millisecond wait. I usually set it up to something like 500ms, then read what the string output is on the VISA Read function and turn on CODES DISPLAY and look at the last charaecter that was recieved. When I know that, I just set the termination charaecter to the right code, enable the termination character to true, take out the wait, set the bytes to read to something higher than you would ever expect, and it works much faster and is usually more efficient.
Just my two cents...