02-07-2012 04:42 PM
Hi
I would like to send a hexadecimal number to a 12 bit D/A converter , I figured how to send hexadecimal numbers but the problem I want the user to interact by changing a decimal number .
what I mean the user sees a range of integers 0-4095 then what I need is to convert to hexadecimal to send to the converters .
the way I will send this is 0x07 0x00 B1 B2 , where the first two hexadecimal numbers are to open the port and notify the converter , and B1 , B2 are the result of user input , B1 is least significant byte and B2 is most significant byte , since it is a 12 bit, I should add zero to the left of the most significant byte . for example if the user input a decimal number that convert to 21C , B1 = 1C , B2 = 02 .
my question is how to do that , do I need to use array to read the conversion and somehow stack the bytes in a buffer that can serve as a control for the sending function , how I can build such an array of bytes or use other VI if needed .
my experience with lab view isn't very much , can some body help me with this ?
Solved! Go to Solution.
02-08-2012 07:09 AM - edited 02-08-2012 07:09 AM
bmemq,
Here is one way to do this.
02-08-2012 12:47 PM
Hi Wayne
thanks for the reply , can you send me the vi that you created in the picture . it is unclear to me how to make some of the vi's , i mean what is the formats included .
also on the user input side , at the vi that says user input , should i change to control so that the user can interact, and how I can configure the user input to coerce to range 0-4095 ??
Thanks
02-08-2012 01:03 PM
A snippet is a VI. Save the file and drag it to your block diagram. Even without doing that, you just have to use the search button to find the functions.
The 'user input' is a control that the user can interact with.
Right click on the control and select 'Data Entry'.
02-08-2012 02:53 PM
Thanks guys , that is relay appreciated