LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial read, and data import into spreadsheet

Are you sure your parity and stop bits and all of the serial settings are defined correctly?  Because your raw data looks nothing like what the manual says it should.

 

How does it look if you try the command in hyperterminal?  Do they provide any software for communicating with the device?  If so, run Portmon and see what the communication stream looks like.

0 Kudos
Message 61 of 86
(460 Views)

I have the tool set for: 5.1.7 (9600 baud); 5.2.5 (no parity); 5.3.1 (1 stop bit); 5.4.3 (no handshake); and 6.1.4 (automatic printing at stability).  I set up my hyperterminal accordingly - to mimic these settings (using COM4), and I get no response (i.e. - doesn't display anything in HyperTerminal window, and doesn't recognize any keyboard keystrokes).  Continuing to troubleshoot...

 

 

0 Kudos
Message 62 of 86
(453 Views)

Not communicating through hyperterminal.  I spoke with the company rep - they are sending us a new rs-232 adapter board.  More to follow (in a couple days).

0 Kudos
Message 63 of 86
(451 Views)

Installed new comm board.  It now works using hyperterminal.  Still gives this output with LabVIEW.  I'm writing an esc-P (2780) to request data - that's the Bytes Written = 2 component.  For some reason I'm reading around 400 bytes (it changes at each read).  I'm still not convinced, that it's not a scale problem.  If the LabVIEW code looks good, then how would this be troubleshot?  Here are the current front panel and block diagram (the scale contains an object weighing 6.310g)... 

 

Noname.jpg

 

 

Noname2.jpg

 

0 Kudos
Message 64 of 86
(433 Views)

You are sending the wrong data in the VISA write command.

 

Escape is Decimal value 27.  But it is 1B in hex.  And P is decimal value 80.  But it is 50 in hex.

 

If your string constant is in hex display, then it should show 1B50.  Not 2780.  2780 means you are sending it apostrophe and whatever decimal 128 is in the ASCII table.  (I don't have an extended ascii table in front of me right now.)

0 Kudos
Message 65 of 86
(430 Views)

Duh!...thanks (about the ASCII).  However, it is still sending 400 bytes of data at each 5 second interval (after I made the change to the write buffer). 

 

Noname.jpg

0 Kudos
Message 66 of 86
(426 Views)

Are you sure you are supposed to be getting back some ASCII formatted data like the manual says?  Is there any parameter setting in the device that controls this?  It sure looks like you are getting back binary data.

 

If you expand your Raw data indicator to see more characters at once, does it seem like there is any pattern to what you are receiving among those 400+ bytes?

 

Post a screenshot of how it looks when you do this in Hyperterminal, then post a screenshot of your LV front panel, but with the Raw data string enlarged to show the 400+ bytes.

0 Kudos
Message 67 of 86
(423 Views)

Here's the hyperterminal output

 

Noname4.jpg

0 Kudos
Message 68 of 86
(418 Views)

Here's the front panel...

 

Noname5.jpg

0 Kudos
Message 69 of 86
(416 Views)

Check the parity and data bits of your serial port again in Hyperterminal vs. LabVIEW.  I can't think if any other logical reason why Hyperterminal should look so much different than the data you have in the raw string indicator in LabVIEW.

 

I see what looks like data repeating every 15 bytes in LabVIEW.  Put an indicator on your error wire to see if there are any errors coming out of the VISA read.

 

If you run your VI again, stop it.  Save the front panel controls as default, then post your VI.  Maybe looking at the hex values of the bytes you are getting will shed some logic on why the bytes look like they do.

 

Other things to troubleshoot.  Try running portmon and capture a log of what is being sent when you use hyperterminal.  Compare that to what is being sent using LabVIEW.

 

(By the way, for anyone familiar with Portmon who is following this thread, has anyone been able to use it with a 64bit OS such as Vista 64 bit?)

 

Try going back to the Basic Serial Read Write example or even teh Advanced Read Write serial port examples in LabVIEW.  Either of those should get back to the basics and give results that should be similar to using Hyperterminal, not that I can see why your program shouldn't be working now.)

 

 

0 Kudos
Message 70 of 86
(408 Views)