LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial read, and data import into spreadsheet

You are using the string subset function.  Good.  Except your values should be 8 and 8 because the index is zero based (so #9 in your image is actually byte #8).

 

Then you are using Decimal string to number.  Perhaps you want to use Fractional string.  But you shouldn't be coercing it into a U8 indicator  because that is not big enough to hold whey might be 8 decimal digits.  And for your waveform chart, you want to wire that from the value coming from the Decimal string conversion, not before that.  And you do not want the string array to U8 function.

0 Kudos
Message 51 of 86
(657 Views)

You are doing most things incorrectly. First, you are not writing the hex commands correctly. You are sending the characters '0', 'x', '2, and '7'. Right click on the constant and select 'Hex Display'. Second, you are not converting correctly. The function you want is probably a typecast.

0 Kudos
Message 52 of 86
(658 Views)

Here's what I have now.  Not sure what you mean about the typecast - I'm attaching the vi.  Thanks again.

 

Noname.jpg

 

 

 

 

0 Kudos
Message 53 of 86
(653 Views)

Your VI doesn't match your latest screenshot.

0 Kudos
Message 54 of 86
(651 Views)

Sorry - too many balls in the air.

 

 

0 Kudos
Message 55 of 86
(645 Views)

So how is it working now?

 

Why are you taking the 10th, 11th, 12th, byte of your raw string (string subset 9 3) and sending that to the Write to Spreadsheet file?

0 Kudos
Message 56 of 86
(641 Views)

There is a 3-byte string that represents the units (e.g. - lbs) - currently just a placeholder, until I find out how to utilize the string.  I'm still wrestling with the data piece - currently displaying a value of 0 (meanwhile, the scale is reading 45.785g on the scale's display).

0 Kudos
Message 57 of 86
(636 Views)

First, attach the manual for the instrument. There is just guessing going on about how to convert your data. Second, run the VI until you see something in the raw data indicator. Select Edit>Make Current Values Default. Save the VI. Attach the saved VI along with the reading of the instrument. Need that to test the conversion of the VISA Read string.

 

An frankly, I don't see how you could ever have 405 bytes actually read. You have the termination character enabled and according to that small section of the manual, the instrument is appending a CR/LF as a term character. Aside from the very first read, you should always have 22 bytes - no more and no less.

0 Kudos
Message 58 of 86
(632 Views)

Thanks Dennis,

 

The value read on the instrument is 45.770g.  I've attached the saved vi (following the Edit\Make Current Values Default selection),  and instrument manual.

Download All
0 Kudos
Message 59 of 86
(627 Views)

Ignore. Was a bit late posting it.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 60 of 86
(626 Views)