![]() |
|
|
Introduction
When communicating with instruments through VISA commands, the instrument may respond to ASCII commands, or HEX commands. Since VISA only uses the string datatype, we often change the string display to be the "HEX Display" in order to pass in specific HEX codes to an instrument. If you need to store these HEX commands inside of a text file to automate the commands, it can be difficult to translate the strings of HEX description into a string that has the binary value defined by the HEX. The process is often more difficult then expected. This example code provides a somewhat elegant method to generate the string which is the hex value in binary.
Steps to Complete
You will need to integrate this code into your application with file IO and VISA commands to make a meaningful application.
Additional Notes
Note that this example will only convert an ASCII HEX description that translates into a 32 bit binary representation. In order to convert larger or smaller data sizes, change the numeric constant's representation on the block diagram to another appropriate unsigned integer size. For a more flexible implementation, look at the following example.
There are no comments on this document