I am trying to transmit hex codes to my instrument via the serial port interface. I use the following commands to try and achieve this functionality:
s = serial('COM1');fopen(s)fprintf(s,'%X','E8')fclose(s)delete(s)clear s
I also tried using FPRINTF in the following manner:
fprintf(s,'%X',dec2hex(232)) %232 decimal = 0xE8
However, when I use a third-party software (such as Portmon) to examine the contents of the packets transmitted by the Instrument Control Toolbox, I notice that the data is in ASCII format.
Best Answer