04-22-2008 02:53 PM
04-22-2008 03:07 PM
Hi Zhao.lin,
I just confirmed this with a VISA person and VISA Read does not do any conversion. It simply fetches the data and assumes that it is a string type. If you are fetching the data properly, you would only have to cast the string data type into the desired data type. You can use the "typecast" block for that.
I am not sure if you are talking about high and low bits or if you mean high and low bytes. They would mean different things depending on the platform you are developing in.
I will look at the manual and let you know if you need to do anything special on top of typecasting the data you fetch.
04-22-2008 03:37 PM
Hi again Zhao.lin,
The manual refers to high and low bytes, not bits. A Byte consists of 8 bits. For communication purposes the instrument will send out the data in frames (fancy word for packaging the data so that the computer would know where one package finishes and the other starts).
Now each data piece is packaged into 10 bit frames, 1 bit to indicate new data chunk has started, following 1 bit to indicate if it is a high byte or if it is a low byte (more on these later), 7 bits that contain the data you will be working on and one last bit to indicate the end of that specific package.
The manual tells you to convert 2 packages at a time to create one 16 bit word (first 2 bits being 0 and the rest varying according to what the data is).
First of all, to be able to properly read data from the instrument (package by package) you would have to properly adjust your VISA settings. More specifically enter the parameters that your instrument works on such as the number of stop bits, data bits etc. so that VISA will know when a new package starts or stops.
Now when you put 2 packages together (after conversion, or getting rid of the start and stop bits) you get a 16 bit number with the first 2 bits from the left are 0s. If you look at the converted data diagram on page 31 of the manual, the data identified as the high byte is the data in bits D13 through D7. The data identified as the low byte is the data in bits D6 - D0.
I hope it helps.
For more information on how serial interface works you can refer to this source.
Good luck with the project!
04-22-2008 07:00 PM
Thanks, I will work on it and see how it is going. Thanks again.
04-22-2008 07:57 PM
04-22-2008 09:50 PM - edited 04-22-2008 09:51 PM
04-24-2008 10:10 AM