LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

aquiring data from serial port

Hi,
 
You can use the utility portmon to find out the serial port activity. Go to the below link to download and run it before you run the data logging application. This will help you find out the serial port settigns used by the application as well as expected data samples.
 
Hope it helps!
Message 11 of 21
(1,338 Views)

I got the documentation file from the manufacturer I am still not getting the correct values.please kindly check the program and tell me where I am doing wrong I am attaching the program and protocol file.

Thanks in advance

Reddy

Download All
0 Kudos
Message 12 of 21
(1,314 Views)
That is the most pitiful excuse for documentation that I have ever seen, well almost.  I can't make heads or tails of what the command should look like.  It seems like the response is 9 nibbles (4.5 bytes?, what is the last 0.5 byte), and each nibble means what is listed in the documentation.  I don't know if the command you are sending is correct because the documentation is so bad.  Upon receiving the response, you would have to split the bytes into nibbles to get the value of each nibble, then build the final value according to the nibble definitions.   If you post the actual string you are receiving, maybe someone here can decode it.  Good luck.
- tbob

Inventor of the WORM Global
0 Kudos
Message 13 of 21
(1,308 Views)
I am getting the following codes (in "\" codes display)
 
 
for 145.6 to 9 pf (fluctuating)
 
\s\00\0F'&$!\s\s\s
\s\00\0F(&$!\s\s\s
\s\00\0F&&$!\s\s\s
 
 
and for 90.5 tp 7 pf
 
\s\00\0F&\s)\s\s\s\s
\s\00\0F$\s)\s\s\s\s
\s\00\0F"\s)\s\s\s\s
 
and for 1188 nf  (1.188 uf)
 
\s\00\0F((!!\s$\s
 
Could anybody kindly decode this for me..
 
Thanks in advance
 
Reddy
0 Kudos
Message 14 of 21
(1,304 Views)
I am getting the following codes (in "\" codes display)
 
 
for 145.6 to 9 pf (fluctuating)
 
\0F'&$!\s\s\s\s\00
\0F(&$!\s\s\s\s\00
\0F&&$!\s\s\s\s\00
 
 
and for 90.5 tp 7 pf
 
\0F&\s)\s\s\s\s\s\00
\0F$\s)\s\s\s\s\s\00
\0F"\s)\s\s\s\s\s\00
 
and for 1188 nf  (1.188 uf)
 
\0F((!!\s$\s\s\00
 
Could anybody kindly decode this for me..
 
Thanks in advance
 
Reddy
0 Kudos
Message 15 of 21
(1,299 Views)

I decoded the string I am getting from the meter.  For 1183 nf  I got the following code  \0F#(!!\s$\s\s\00

Item 1  à   \0F = 001111  (Start code ) 

      2   # =100011 = 3(  value Digital 1)

     3   ( =101000 = 8 (digital 2)

   4   != 100001 = (digital 1)

    5  ! = 100001 =1(digital 0)

   6  \s 100000 = 0( plus)

   7  $ 100100 = 4 ( nf)

  8   \s 100000 = 0 ( right)

 9   \00 000000 = 0 (stop code)

 
0 Kudos
Message 16 of 21
(1,297 Views)

I tested this for different values of capacitance and  I am getting the correct values. But the program to decode seems to be complex ( I am new to labview) could anybody help me in writing the program to decode code ( like above )   Thanks in advance

Reddy

0 Kudos
Message 17 of 21
(1,298 Views)
could anybody help me in writing the above program
Thanks.,
Reddy
0 Kudos
Message 18 of 21
(1,278 Views)


@komatireddy wrote:

.... But the program to decode seems to be complex ( I am new to labview) ...


One way:  Convert string to array of U8 and parse out the info. The attached is a quick demo which could have errors/bugs and the output is always in nF.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
Message 19 of 21
(1,271 Views)

Follow the same logic that you used to manually decode the string.  In Labview, first you have to break the string into individual bytes.  The LV function for this is String To Byte Array (look in String - String/Array/Path Conversion palette).  Next you have to obtain the lower nibble.  To do this, use the And function (Boolean palette).  "And" works with numerics also.  Wire the byte array into one input, create a U8 array constant with each element being 15 (or 0x0F in hex), and wire into And function.  The resulting output will be an array of lower nibbles.  Now you can extract each individual element from the array and manipulate it according to the protocol.  What I would do is to first form a number with array elements 4,3,2,1 (array element numbers start with 0, which is the start byte, just ignore this element).  Use Index Array (Array palette) to extract these 4 elements.  The 4th element is the thousand place, so multiply by 1000, 3rd element by 100, and so on.  Add all the numbers and you get the capacitor raw value before adding the decimal point.  Now index element 6 to get the range number.  You will have to use a case statement.  If the number is 0, you divide by 10 and units are in pF.  Inside the case statement, put a numeric 10 and a string "pF".  Same for other cases, with case 1 being divide by 1000, and units in nF, and so on.  Now you can divide the raw value by the numeric that comes out of the case statement.  Use the Number To Fractional String Conversion function to convert to a string.  Element 5 dictates the sign.  You can use a case statement or the Select function (Comparison palette) to select a "+" or a "-" string.  Concatenate the sign string, the numeric string, and the unit string together into one string indicator.  There is your capacitor value.

Try coding on your own to learn LV.  If you need help, post the code and I will look at it.

- tbob

Inventor of the WORM Global
Message 20 of 21
(1,268 Views)