How Do I Send Hexadecimal Data via Serial RS-232 Using LabWindows/CVI?
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: LabWindows/CVI Development Systems>>Base Package
I want to send data in hexadecimal format to my device through an RS-232 serial interface in CVI, but the ComWrt command is sending the ASCII code rather than the raw hex data. How do I send it this information in hex?
There are multiple solutions to this problem.
The ComWrtByte function will accept integers as its data parameter as well.
The data can also be sent in octal format directly from a string:
Where \042 = 0x22. The calc program in windows can do hex to octal conversion, which may be helpful if you decide to use this solution.
Products and Services: NI LabWindows™/CVI
Developer Zone Example: Instrument Control Made Easier with NI LabWindows™/CVI Plug and Play Instrument Drivers
Report Date: 12/02/2005
Last Updated: 11/14/2012
Document ID: 3S1F23Q4