09-26-2011 03:02 PM
Hi, there
First of all, I would like to apologize if this question has already been answered in the forums, but I haven't been able to find any solution for this situation.
I have a Lakeshore 321 temperature controller hooked up to serial port using RJ-11 cable and DE-9 serial interface connector configured as DTE. Since there is no NI certified driver in the NI website, I tried to write my own based on 332 driver. I was able to read data (current temperature) from LS321 for some time last week. But then everytime I tried to read data, it kept giving me error as shown in the attachment.
Any help with this issue would be most appreciated!
Solved! Go to Solution.
09-26-2011 03:12 PM
Can you put an indicator on the string wire running from the VISA read to the Scan from String? What data does that show you are receiving?
I suspect that the string you are receiving is not in a format that the Scan from String is able to interpret according to the format string.
09-26-2011 03:27 PM
@Ravens Fan wrote:
Can you put an indicator on the string wire running from the VISA read to the Scan from String? What data does that show you are receiving?
I suspect that the string you are receiving is not in a format that the Scan from String is able to interpret according to the format string.
Hi, Ranvens
Thank you for your response. I put an indicator and it shows as in the attached picture. Actually the error generates in the "Read" function and the indicator shows empty.
09-26-2011 03:39 PM
That's a timeout error. Meaning data did not come in during the timeout period.
Are you sure your command CTDAT? :<CR><LF> is correct? How about your baud rate, stop bits and parity? Does your communication protocol put a termination character like a line feed at the end of the data it is sending to the PC?
The reason you get the pop up error on the scan from string is that the error output is unwired, and it doesn't know how to interpret an empty string. You should feed the error wire through the scan from string function as well.
09-26-2011 04:25 PM - edited 09-26-2011 04:28 PM
@Ravens Fan wrote:
That's a timeout error. Meaning data did not come in during the timeout period.
Are you sure your command CTDAT? :<CR><LF> is correct? How about your baud rate, stop bits and parity? Does your communication protocol put a termination character like a line feed at the end of the data it is sending to the PC?
The reason you get the pop up error on the scan from string is that the error output is unwired, and it doesn't know how to interpret an empty string. You should feed the error wire through the scan from string function as well.
Ravens,
I checked the manual and "CDAT?" is the current temperature query. And the Terminators for Serial Interface are CR(0DH)LF(0AH). So I guess the problem is baud rate, stop bits and parity?
In the manual it is written that:
Connector Type: RJ-11 Connector
Connector Wiring: DTE
Voltage Levels: EIA RS-232C Specified
Timing Format: Asynchronous
Transmission Mode: Half Duplex
Baud Rate: 300, 1200
Hankshake: Software timing
Character Bits: 1 Start, 7 Data, 1 Parity, 1 Stop
Parity: Odd
Terminators: CR(0DH)LF(0AH)
Command Rate: 20 commands per second maximum
How should I deal with these baud rate, stop bit and parity? Sorry I'm new to Labview and have no idea about these communication problems. Am I doing right in the attached vi file? But it still gave me error when I tried to read.
09-26-2011 08:11 PM - edited 09-26-2011 08:11 PM
You'd be better off using the Serial Configure VI. It will also enable the termination character and set it for you.
09-27-2011 09:33 AM
@Ravens Fan wrote:
You'd be better off using the Serial Configure VI. It will also enable the termination character and set it for you.
Finally get it work! Haha.
Thank you for your help and patience, Ravens.
10-06-2011 02:28 PM
everything worked but i had a broken wire on the parity part. i chose the function "Enum Constant" and used the text changer to change it to "Odd". I re-wired it a couple times to see if it work to no luck. Please let me know what i am doing wrong.
10-06-2011 03:45 PM - edited 10-06-2011 03:47 PM
Are you saying you tried to build the enum constant from scratch?
Delete your constant. Right click on the input of the subVI and choose Create Constant. Now you will have a constant that is the correct enum datatype and is unbroken. Change the value to Odd.
You may also want to do this with some of your other constants. You have a lot of coercion dots that mean the datatype of the constant you wired in doesn't match the datatype that the subVI is expecting.
Also, clean up your wires so that they don't overlap and the purple VISA resource wire doesn't wrap itself all round the subVI.
03-03-2013 01:57 PM
Hi,
I am trying to control Lake Shore 321 from LabVIEW as well. I wonder if you can send me some example VIs? I am a beginner.
Thanks.
Ronghui