LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unable to communicate with serial device using hex

First, I really do appreciate all the feedback...  Thanks...  You asked quite a few questions...  Let me see if I can answer at least some of them..  Both of these instruments I mentioned in my opening post are made by Inficon.  They are both thin film deposition rate controllers..  The one I called #1 (the one that works serially aok and about which I have no questions) is a Model SQC310.  If you care, you can see it and download its manual at this link...

 

http://www.inficonthinfilmdeposition.com/en/sqc310.html

 

The more important one, the one I can't get to read back serially, is a Model 074-379-P1J Cygnus Thin Film Deposition Monitor.  You can see and download its manual at this link...

 

http://www.inficonthinfilmdeposition.com/en/cygnusthinfilm.html

 

I did download the Portmon application that was suggested and I let that executable run while I talked with first one and then the other (above mentioned) instruments this morning...  Both instruments have what I will call a HELLO command (to keep it simple) where you issue a HELLO request and the unit is supposed to respond with its model type, firmware version, etc...  I have attached the full Portmon log for both the SQC310 (which worked) and for the Cygnus (which does not work)...  But I have pasted below the key parts of the log where you will see that the SQC310 both WRITES a request and READS back a response while for the Cygnus, I get the WRITE but no READ... 

 

The ASCII text request that the SQC310 requires for the HELLO test is

 

!#@O7

 

See attached the Portmon log called "SQC_Hello.LOG" (simple text file) for this example of success (for the SQC310) where the both the WRITE and READ succeed..

 

See in line 53 of that attached "SQC_Hello.LOG" where the WRITE occurs and the values to the right are the five HEX values for the ASCII characters ! # @ O 7 (without the spaces).  Then see in line 56 where the Serial Read brings back 25 Bytes that, when converted from HEX into ASCII convey the message of

 

!8ASQC310D 2MB Ver 6.  (<--should be 4 more characters here but this is all the Log files shows, see below)...

 

Actually, the log only shows 21 Bytes though it claims there are 25..  Something got truncated but the bottom line is this one works, at least for the most part...

 

Next, see attached the Portmon log called "Cygnus_Hello.LOG" for the Cygnus unit and note that I WRITE my request (line 53) but I get NO READ!!!...  An applications engineer at Inficon tested these commands at his facility (NOT using LabVIEW but instead using a proprietary in-house serial command executable) and he said they worked for him...  The HELLO command he sent me (and the manual clearly talks about building and sending these commands in HEX) is

 

0200480149 (HEX)

 

and it should have given me back a response that is 23 bytes long (in Hex) (Inficon told me that) but it instead READS back NOTHING...

 

(By the way, the 0200 above is the LSB followed by the MSB of the LENGTH of the Command..  In other words, in this case the Command is going to be 2 Bytes long.  Then the next two Bytes are the command itself...  The command we want to send for HELLO is H1.  Inficon tells me that they send the ASCII HEX value for H which is 48 and then they send the HEX equivalent for 1 which is of course still just 1 (but in HEX, ie., 0x01)...  The ASCII equivalent in HEX of 1 is of course 0x31 but that is NOT what they do here...  At least so I'm told...  And then the 49 is a checksum that is just the HEX sum of the Command values with in this case is 0x48 + 0x01 = 0x49...  So that is how the message for H1 is built...)

 

See again, see the attached log files with success (SQC_Hello.LOG) and NO success (Cygnus_Hello.LOG)

Thoughts on why I get no READ???  Other than maybe I am not waiting long enough?? See more about that below...    

I did all this with the "Enable Termination Char" set to FALSE... 

I checked in both the Hardware Manager on the PC and at the LabVIEW code level that the Com port (4) was set to 19,200, 8 Data Bits, 1 Stop Bit, No parity and No Flow Control...  (Note: I have a Keyspan serial port expander on this PC that allows me to have 4 ports that Windows named ports 4, 5 6 and 7.  The other ports are already used on this computer...  I have many times switched the cable that connects to port 4 from the SQC310, over to the Cygnus and back again to the SQC310 many times just to show that the system always works on the SQC and never on the Cygnus...  So I am confident the computer port (4) is working ok... 

One of you asked about FIFO settings...  I know nothing about those and have done nothing to try to affect them in any way...

Last, but certainly not least, one of you asked if I am waiting long enough for the READ to occur...  Gosh, good question...  I came back to my office (a mile away from the setup) to eat lunch and read these replies...  In a very short time I will head back over there and certainly give that a try...  Duh...  I have been waiting 100 msec but have never increased that though it's trivial to do so...  gosh will I feel silly if that fixes the problem... I will report back on that shortly... 

 

OK, see attached the full Portmon logs called "SQC_Hello.LOG" and "Cygnus_Hello.LOG"...  I tried also to attach the Cygnus manual but the post wouldn't go through as it says the attachment is too large.  But again, you will see a link for it at the Cygnus link I pasted above... Just open that page and you can download the Cygnus manual from there as one of you said you'd like to see more info on that unit...

 

Holler back with thoughts on what you see or don't see in the Portmon logs and will I race over to try a longer delay before READ... 

 

See attachments... thanks..  bob...

 

Download All
0 Kudos
Message 11 of 14
(1,265 Views)

I looked at the manual and your code.  My money is on the timeout being too small.  Let me know what you find ;-). 

 

Thanks,
Jim

0 Kudos
Message 12 of 14
(1,244 Views)

Hi....  And the answer is...  Jim, you were in the right ballpark but not quite on the mark..  it wasn't the delay time...  I increased the default delay time I had put in from 100 msec all the way up to 5 seconds and that didn't help...  But, another colleague suggested that, in his experience, some instruments can't handle the specified baud rates...  He suggested I try to lower the baud rate...  And that did it...  On page 1-8 of the Cygnus manual it says the allowed baud rates are 2400, 4800, 9600 and 19,200...  Last Friday I had gotten one response (out of hundreds of tries) while at 19,200 and I believed at the time that was just garbage that somehow got into the port buffer...  Now I think it was a valid response but only one, again out of hundreds of attempts...  So the instrument simply could not handle 19,200...  After trying the delay time, I then switched to lowering the baud rate...  At 9600, I got very interested when I got on the order of one good response for every 10 attempts...  Then at 4800, it worked almost every time although I saw it miss a time or two...  Then at 2400 baud, it worked every time...  Amazing...   Tomorrow I will get in touch with the vendor and ask if it is this one instrument or whether all these Cygnus units might have issues baud rate.  So my focus on some format issue with inputting HEX numbers was off the mark.. Instead, once I set the baud rate lower, and currently I have it set to run at 2400 baud, all the responses I expected began flowing down the serial pipe...

 

Thanks to all for the help and input...  I have a real need to be talking to this instrument NOW and it's good to know there are folks out there ready to help in short order...  Gosh, who'd a thought it couldn't handle the baud rate??

 

thanks much...  bob...

0 Kudos
Message 13 of 14
(1,221 Views)

Jim...  Upon further review, you WERE also right..  At a wait of 100 msec, I later discovered I wasn't always getting all of the message...  Instead I was getting only part...  I had to up that delay to 500 msec to get it to send the complete message every time..  So baud rate was keeping it from reading anything at all and delay was sometimes causing me to miss part of a message...  So I am now running successfully at a baud of 2400 and a WRITE to READ delay time of 500 msec...  We only take data once every 10 seconds so these times and delays are tolerable...

 

Again, thanks all for the help...

 

bob...

0 Kudos
Message 14 of 14
(1,204 Views)