Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to serial port from write visa

Hi,

     I would like write two bytes of information to write visa. Two bytes consisting with 5 bits as signed (exponent) and remaining 11 bits are mantissa. I have done some coding but i need extend that to two bytes. you can find attched vi. At last i have to add those 5 bit and 11 bit to a two byte value. example, 3.3 is written input and output should be ---------> 1100001101001101----> here first fivets represents -8(always signed) and next 11 bits represents(845).

One more doubt, Please say in one sentense. what is difference between 4.x typecast and normal type case. I read the help information and not understand any thing.

Download All
0 Kudos
Message 1 of 10
(3,994 Views)
0 Kudos
Message 2 of 10
(3,993 Views)

yes, though its out of site and i have tried some thing. No one helped there, So here i posted for help. Please excuse me if I done any mistake and help me.

0 Kudos
Message 3 of 10
(3,988 Views)

i haven't get the real binary value for 3.3v as i said before. i don't know where the error is? please some one help me.

0 Kudos
Message 4 of 10
(3,983 Views)

Hi

What instrument are you writing to that needs a binary value of this format?

greetings from the Netherlands
0 Kudos
Message 5 of 10
(3,962 Views)

Thank you for your reply.

 I am just communicating with SMPS and it understand only in that format. I am bit lag in adding those 5bits with reaming 11 bits. And also the 11 bits I got is wrong and you can see in before scraps the output binary value. I have used 4.x data conversation and still getting wrong bits.

 

I really don't know when to use 4.x data and not. Can you explain me in simple way with straight sentence. Please help me.

0 Kudos
Message 6 of 10
(3,956 Views)

4.x or other dataconversion is not giving you a two byte real format.

Do you have an extensive description of this format?

greetings from the Netherlands
0 Kudos
Message 7 of 10
(3,954 Views)

ok you can see in http://pmbus.org/docs/Using_The_PMBus_20051012.pdf exactly 77 slide. 

0 Kudos
Message 8 of 10
(3,953 Views)

Thank you , I got a solution and i will move forward with that. I will ask later for furthur doubts.

0 Kudos
Message 9 of 10
(3,946 Views)

Ok, now I understand what you mean.

So you need a 16 bit integer to be built out of 5 and 11 bits and send it over visa.

The 16 bit integer can be converted into an array of two U8 (bytes) by split number followed by built array.If necessary you can swap the byte positions in the array,

This array can be converted into a string by convert to string.

 

see the snippet

 

greetings from the Netherlands
0 Kudos
Message 10 of 10
(3,945 Views)