![]() How to modify the visaconf.ini file to disable the error replacement bit:įor users of Windows XP, the visaconf.ini file is located in the \All Users\Application Data\National Instruments\Nivisa folder.įor users of Windows Vista or later, the visaconf.ini file is located in the C:\ProgramData\National Instruments\NIvisa folder.Īdd the following lines to the file and save: ![]() Note that if your instrument only needs to receive the 9th data bit for addressing purposes, but never sends data on the 9th bit, you should only need to set the parity once to what your instrument is expecting. You can change this behavior by modifying the visaconf.ini file. LabVIEW 6.1 and earlier does not replace a data byte with a parity error replacement byte. One issue with this is that in LabVIEW 7.0 and later, when NI-VISA receives a data byte with incorrect parity, it completely replaces the serial data with the error character, which by default is 0. If you read in a byte and you get a parity error, you know that the 9th bit is Mark and can append the appropriate bit. If you get any parity errors, you know that the 9th bit is the opposite of what you set.įor example, let's say you set your parity as Space.Set the port up for 8 data bits with parity checking enabled, set as either Space or Mark.Note that when shown in binary the least significant bit is the leftmost bit, as the least significant bit is sent first in serial transmission. If you needed to transmit binary 000100011 instead, you would still transmit hex 0x88 but set the parity to Mark. Mark is a high parity bit (1), and Space is a low parity bit (0).įor example, if you need to transmit binary 000100010, you would transmit hex 0x88 and set the parity to Space. To add a ninth bit to your transmission, you will need to explicitly set the parity bit to Mark or Space for every byte that is transmitted.You will need to set the port up for 8 data bits.There are two different workarounds that you may be able to use to communicate with 9 bits. Since the UART does not support 9 data bits directly, there is no provision in the driver to accomplish this. However, the UART on all National Instruments serial products only supports 5 to 8 data bits, Even/Odd/Mark/Space/None parity and 1/1.5/2 stop bits. The serial protocols for certain instruments use a 9-bit date frame, rather than the more common 8 data bits and a parity bit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |