Hi.. I am a beginner to LAbView. I am trying to communicate with an AC power Source. for which My command will be in the format of 4 to five bytes; e.g. for setting a voltage of 220VAC, it is 1509 0898 in Hex, in which 15 is fix for all commands for hand shaking, 09 is for different operations like setting Volatge or Freq. and last four digits 0898 is an Hex code of 2200 (for 220.0VAC).
While sending the full command 1509 0898 in Hex to Serail port my source is communicating, even by giving the them using concatenation of strings like 1509 is first string and 0898 in second, it is working fine.
But these last two bytes would be user defined and hence can vary in numeric, so I have put a Number to Hex code conversion there before concatenation. which is not sending the Hex code 0898 as reqd. but sending this garbage value...3038 3938
Please Help.. Thanks in advance....
Solved! Go to Solution.
here's the step-by-step long way:
Hi.. GredW.. Thanks.. But can u please give the name and properties of 3th and 5th Function?? I could not find the same.
Starting from left to right
2. Round to nearest
3. Convert to U16
4. Split number
5. Build array
All of them can be found in Numeric pallet.
It is working..
But it wud be better if you can let me know about the same that what is going on behind the code..
Ideally CTRL + H should work for you, it will open help menu and explain each function for you.
For this time let me give you details.......
1. You are multiplying 220.0 and 10.0 which results in 2200.0 (fraction)
2. If it is not round number then you are rounding it to nearest (In this case it is already rounded value)
3. Then you are converting it to U16, that means you are converting value to be represented using 16 bits(2 bytes)
4. Then split number is spliting upper 8(1 byte) and lower 8(1 byte) bits for you
5. These upper and lower bytesyou are then adding to array using build array function
The final function Byte array to string converter.