10-21-2005 03:32 AM
10-26-2005 06:24 PM
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
10-26-2005 07:38 PM
10-26-2005 08:40 PM
10-26-2005 09:16 PM
10-26-2005 10:04 PM
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)
10-26-2005 10:05 PM
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
10-27-2005 11:46 AM
10-27-2005 12:02 PM
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.
@komatireddy wrote:
.... But the program to decode seems to be complex ( I am new to labview) ...
10-27-2005 12:39 PM
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.