08-26-2009 06:33 PM
I'm having a very hard time setting up a serial port connection. I'm new to both LabVIEW and serial ports, and I apologize that I don't even know what are the right questions to ask.
I want to control and read a Spex CD2. I found a VI for it here: IDN -- CD2a I'm not able to get this to work, however I suspect that I have a different version of the hardware (it says CD2 on the front and CD2a on the back). I've tried opening MAX, opening VISA session and sending and receiving commands, but nothing seems to be responding.
For now, I've given up on controlling the device through LabVIEW. I'd be happy if I can just read position data from the device (i.e. SPEX CD2). The device sends a data block (and might need an <ACK>) and ends with an <EOT>. (the data flow is described on page 12 of this PDF document).
I'd like to see what data the device is sending. I tried a serial port sniffer but that seems restricted to proper serial port devices (this device doesn't even respond to IDN). Using LabVIEW, is there a way to read/sniff data from the serial port? Also, how would I go about sending messages like <ACK><EOT><STX> etc.? I'd appreciate any help/suggestions for this.
08-27-2009 01:20 AM
My best guess is that you have the wrong serial cable. They come roughly in two versions.
One version wires straight pin 1 to pin 1 and all other pins are also directly connected.
The other version is twisted. It means that for sending and receiving the correct signals swap between the two connectors.
The famous pin 2,pin 3 swap is because both instruments otherwise would speak on the same line and listen on the same line with a net result of nobody hearing anything.
RS232 sometimes is refeered to as Regularly Soldering pin 2 to 3 and 3 to 2.
The best you can do is measure if you have a twisted or a straight cable and replace it with the other one.
Alternatively, als baudrate handshake and more can be wrong.
The only thing left is to wish you good luck.
08-27-2009 01:49 AM
08-27-2009 09:28 AM
I'd like to try my looping through all possible configurations idea. Could someone please point me to an assured method of listening to the serial port and dumping the data on the screen?
08-27-2009 09:38 AM
08-27-2009 09:43 AM
Portmon from Microsoft is a sniffer that will work.
Frankly, I don't see what good a sniffer will do. The instrument will not respond unless it gets the correct command and the driver appears to format the commands correctly. The driver will show the response when the com settings are correct and the right cable is used. Until then, the sniffer will not have anything to sniff.
p.s. the commands you asked about are explained in any ASCII Table. for example, <AC> is hex06 and one way to set that is to set the string control/constant to hex display. There have been countless discussions on sending hex over the serial port. Do a search.
08-27-2009 10:05 AM
Thank you Albert for recommending Portmon. I tried some shareware apps, but this one seems much better.
Re: Knight of NI ( I showed that to everyone), when the 'Remote' button is activated on the device, it constantly sends a stream of data. Would I not be able to sniff this stream of data if I had the right serial port settings?
I am more confident about the cabling now. The manual mentions using a null-modem, which I am doing. Also, some of the other devices from that era in our lab are connected the same way.
08-27-2009 11:41 AM