08-28-2014 06:51 PM
Hello,
I want to input 22 byte array string to VISA write to control one instrument. I want every byte in not more than 8 bits and some of the bytes in array are the binary 8 bits of some decimal to binary conversion. eg. Machining time is 180,000 milliseconds which converts to Binary in 3 sets of 8 bytes. I want to make 3 seperate bits (high, middle and low) out of it. Maximum value conversion I am getting is 8 bit which is 255. How to divide numbers greater than 255 to seperate 8 bit bytes for one single decimal value?
Thank you.
Solved! Go to Solution.
08-28-2014 07:56 PM
First of all, you seem really confused about some basic terminology. A bit is a binary value (0 or 1). 8 bits make up a byte.
So what exactly is the protocol you are trying to implement? What are the 22 bytes that you have to send?
08-28-2014 07:58 PM
08-28-2014 07:59 PM
08-29-2014 07:08 AM
@crossrulz wrote:
First of all, you seem really confused about some basic terminology. A bit is a binary value (0 or 1). 8 bits make up a byte.
So what exactly is the protocol you are trying to implement? What are the 22 bytes that you have to send?
Hello,
Sorry for the confusion.
I have one power supply which has to supplied by 22 byte array as an input. Those 22 bytes have their own significance. eg. Frequency, pulse on time, temperature limit. etc. Some of the bytes are high, medium and low bytes of a single 24 bit binary value. Now suppose I have a decimal number to convert into binary, I know that logic. But if I get a binary value which is say 24 bits, how can I seperate that into 3 individual sets of 8 bits?
Thank you.
08-29-2014 07:09 AM
Hello,
Those decimal numbers are user inputs. Voltage, Temperature Limit, Pulse frequency etc.
Thank you.
08-29-2014 07:10 AM
Hello,
Sorry for the wrong board.
I have asked the moderator to take me to appropriate location.
Thank you.
08-29-2014 07:16 AM
Well, if you have 24 bits, you have to go up to the next largest data type. In this case, that would be an U32. You can use the Slit Number and then Build Array to make sure the bytes go where you want them to. This is assuming you are using LabVIEW.
08-29-2014 07:33 AM
Hello,
Yes I am using LabVIEW. I will try this.
Thank you.
08-29-2014 09:15 AM
Hello,
Thank you. That works. I have one more question.
Is there a way in LabVIEW to read the value from Indicator and use it as an input for other functions or controls?
Thank you.