11-27-2009 08:46 AM
Hi!
I have to send control commands to the IR light source evaluation kit of ICx Photonics via Labview 9.0. So I tried the example VI 'Basic Serial Write and Read.vi'. To send a command I've to write a capital letter then its value and finally a carriage return. For example P102[cr]. Because of the carriage return I set the termination char to '13' (dezimal) or 'D' (hexadezimal). Now Labview and the evaluation kit know when a command ends. The problem is, that I only get back strange letters and '?' as answers. What means one part either Labview or the evalution kit doesn't understand the commands. Since all other settings are right I guess that Labview doesn't send with the emulation ANSI?
But when the problem is ANSI then I don't understand why I get the right answer when I send a single 'I' for the firmware version. Is it possible, that only the first letter is interpreted right?
Is there another termination char that I may try? Til now I've tried [cr], [CR], [lf], [LF], \r, \n, combinations of them, none of them,...
The hardware is ok. I could get the desired results with the HyperTerminal.
Solved! Go to Solution.
11-27-2009 09:32 AM
Are you putting the termination character in the string control after your command? Setting the term character for the VISA Configure Serial Port does not set the termination character for the write. In the string control of the example you mention, you have to use '\' codes. If \r or \n does not work, try both.
p.s. You mean ASCII instead of ANSI.
11-27-2009 10:18 AM
You mean I've to put a '[cr]' after each command and after the whole string a '\r' or '\n'? Well I didn't try it that way, I'll do it on Monday.
But I do mean the emulation ANSI. In the HyperTerminal you can set the emulation and my instructions say, that I have to set the emulation to ANSI. So I thought that I have to set it in Labview, too?
11-27-2009 10:53 AM
A [cr] is not correct. It represents a carriage return character in your manual probably and you do not use that text. You have to use \r for carriage return. The string control is set for '\' Codes Display and that is why the default text has '*IDN?\r\n'. The \r and \r are a carriage return/line feed.
Okay, I understand the ANSI reference now. That just means a type of terminal emulation. The simplest kind with no special control codes, display features, etc. There is no setting for terminal emulation in LabVIEW because it is not a terminal emulation program. It's a programming language and if you needed to emulate a different type of terminal, you would have to write a program to do that. You don't have to worry about that in this case.
11-30-2009 05:27 AM - edited 11-30-2009 05:29 AM
11-30-2009 09:33 AM
Try sending only one command at a time.
Do you have an electronic copy of the manual that you could attach?
11-30-2009 10:00 AM
It doesn't work with only one command, too.
Here is the manual: Evaluation Kit
Look at page 9 of the pdf - there're the relevant instructions.
11-30-2009 10:13 AM
According to the manual, you should only be sending a carriage return. Have you tried that? You also have to send one command at a time.
11-30-2009 11:18 AM
11-30-2009 12:27 PM - edited 11-30-2009 12:27 PM
I'm running out of ideas. Hyperterminal allows you to set a delay between characters. Maybe that's what you need? The code to do that is shown below.