08-08-2007 01:32 PM
08-08-2007 01:36 PM
08-08-2007 01:37 PM
08-08-2007 01:39 PM
08-08-2007 01:40 PM
08-08-2007 01:47 PM
Hmmmm...
4 replies in eight minutes and they all suspect the termination character.
I would try adding a term char if I were you.
Ben
08-08-2007 02:15 PM
Wow... fast responses indeed!
OK, to address the issues brought up.
1. Some commands require the \r\n appended when sent to the instrument. However, the poll query does not. As soon as i type the second char in the poll string I get a reply (in hyperterminal).
2. Termination char: The return data string has an <ETX> (ascii 3) followed by a checksum. That dinna work. I also tried \n (ascii 10) and \r (ascii 13) and those dinna work. A cut and paste from hyperterminal and conversion to hex show all strings terminated with 0A which is ascii 10.
I think there is something about the immediate response nature of this. The instrument also has a continuous mode, where upon exiting configuration mode it sends a 37 char data packet once a second. I was able to read that fine. It is when I am in polled mode that I hit this wall. Send two chars, 37 immediately back but showing as zero in LabVIEW...
I appreciate the quick replies!
08-08-2007 03:09 PM
HI Greg,
I am not sure if I follow your follow-up.
It sounds like some command work with CR.
You also mentioned ETX and a checksum.
I seem to rember instruments that would go into "spew mode" and would stop when they saw "any character". How about making sur ethe port is inititalized to NOT use the term character and you do the CR when appropriate.
Could you post screen shots of the commnads that work (in slash code format) and those that do not?
The other thought (that is way out there) is the parity. If the commands that work are all even and parity is even, then they would work while the commands with odd characters would look bad due to a lack of parity bit.
I hope some of these ideas get you closer to a solution!
Ben
08-08-2007 04:03 PM
OK. I'll explain the sequence as it goes in hyperterminal (with '\' view and line #'s added for reference):
1 D3\n
2 current\sconfiguration\s:\n
3 P1\sG1\sM3\sU1\sB5\sF1\sT1\sS7\sC1\sI1\sA2\sNS\sO1\n
4 D3\n
5 Q\n
6 Q\n
7 \s\02S,-000.07,-000.06,+000.06,M,00,\032C\n
8 \02S,-000.06,+000.01,+000.06,M,00,\032C\n
9 \02S,-000.06,+000.01,+000.02,M,00,\0328\n
1. I type D3 and hit ENTER
2, 3 and 4 get sent back.
5 I type Q and hit ENTER (exits config mode, goes to poll mode)
6 gets sent back
7 I type ?S (note these two chars are not echoed back but data string comes back immediately, no ENTER press required)
8 I type ?S (not echoed, get data string back, no ENTER pressed)
9 et cetera
If I set the device into poll mode in hypertermal then close and move to LabVIEW, I use VISA Write to send ?S but never get any bytes back on VISA Read (times out) and a check on COM1 before I do the read it says: Bytes at Port = 0.
I've also tried placing the Visa read and write in parallel. The idea being I have a loop whipping along checking the port for any data, if any bytes found do a Visa read. With that up and running I do a Visa Write of ?S. The idea was if the data was coming so fast my read was missing it, but even in that config no bytes are ever detected at the port.
Thanks for any input! I'm about ready to get the cure-all sledge hammer out.
08-08-2007 04:11 PM
Ok Greg,
How about the configuration?
Did dyou verify the com port is configured for no term character?
Parity?
NI-Spy may also help confirm you are send what you think you are sending.
Ben