Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

12 bit D/A converter and hexadecimal numbers

Solved!
Go to solution

 

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 ?

0 Kudos
Message 1 of 5
(3,993 Views)
Solution
Accepted by topic author bmemq

bmemq,

 

Here is one way to do this.

 

Message 2 of 5
(3,976 Views)

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

0 Kudos
Message 3 of 5
(3,967 Views)

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'.

Message 4 of 5
(3,965 Views)

Thanks guys , that is relay appreciated

0 Kudos
Message 5 of 5
(3,953 Views)