MUSA Posted December 23, 2009 Report Share Posted December 23, 2009 Hello every one. I want to do the following procedure in LabView, and I shall be thanks full if some one can help me to do that . I am new user of LabView. Steps: I am receiving a two byte data in LabView from the hardware I am using (the data is the input voltage to the board). I want to 1. Switch the positions of the data bytes and then convert the decimal value in these two bytes in to hexadecimal value individually. 2. Then add these two hexadecimal values and convert it in to decimal again as shown in example below. 3. The decimal value I will get i will want to divide that value with the number "8241.5" and after that the answer I will get I want to plot that floating number into the graph.<br style=""> <br style=""> <b style="">I want to do the following steps in the LabView<br style=""> <br style=""> </b> Example: Step 1: (The actual data i received). byte [0] = 251 byte [1] = 202 Step 2: I want to switch these two bytes as byte [0] = 202 byte [1] = 251 Step 3: then convert each byte into the hexadecimal individually. byte [0] = 202 = 0xCA byte [1] = 251 = 0XFB Step 4: Combine these two hexadecimal values and convert it into the decimal again CAFB = 51963 Step 5: Divide this value from the decimal number "8241.5" 51963/8241.5 = 6.3 Step 6: in the last step plot this number “6.3” in to the graph as a voltage. I mean how can I draw this voltage of 6.3 in a graph. I shall be very thanks full if some one can make this VI for me or guide me how to make this in LabView. Best Regards. Quote Link to comment
jgcode Posted December 24, 2009 Report Share Posted December 24, 2009 HI want to do the following procedure in LabView, Hi MUSA Have a go at searching the palettes for the following functions in order to solve your problem. Cheers -JG Quote Link to comment
Mark Yedinak Posted December 24, 2009 Report Share Posted December 24, 2009 Hi MUSA Have a go at searching the palettes for the following functions in order to solve your problem. Cheers -JG There is a much more straight forward method if he is only interested in the numeric aspect of the conversions. The whole thing can be done numerically without the need to convert the numbers to strings. Quote Link to comment
jgcode Posted December 24, 2009 Report Share Posted December 24, 2009 There is a much more straight forward method if he is only interested in the numeric aspect of the conversions. The whole thing can be done numerically without the need to convert the numbers to strings. Very nice, but not what he asked for Maybe he has to log the hex string??? Quote Link to comment
Shaun Hayward Posted December 24, 2009 Report Share Posted December 24, 2009 (edited) Very nice, but not what he asked for Maybe he has to log the hex string??? ...well... in that case: Edited December 24, 2009 by Shaun Hayward Quote Link to comment
Mark Yedinak Posted December 24, 2009 Report Share Posted December 24, 2009 ...well... in that case: My first though was to use the join numbers but for some reason I had a mental block when I actually whipped up the example and used the shift and the add VIs. However the main reason I posted the alternative solution was that the OP may not have been aware it could be done without all the string conversions. Unless required for something specific his procedure required lots of extra work to accomplish a very simple task. Quote Link to comment
jgcode Posted December 25, 2009 Report Share Posted December 25, 2009 However the main reason I posted the alternative solution was that the OP may not have been aware it could be done without all the string conversions. Unless required for something specific his procedure required lots of extra work to accomplish a very simple task. Yes, yours was a much better solution - mine officially sucks I didn't even think down that path - just followed the steps!! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.