Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with binary data from serial device

I'm connecting to a UART via the Silicon Labs CP210x device driver, Mac_OSX_VCP_Driver.zip and trying to read binary data.

 

On intel macs prior to Monterey, the driver is a KEXT, and everything works. On Monterey and later by default you get a DEXT, and it mostly works, but some of the binary data seems to be garbled. On intel macs you can force install the KEXT, even on Monterey and later, and it works.

 

After a lot of debugging, I found that everything seems to be passed through correctly, except the sequence 0xdd 0x00, which gets translated to 0xff, and the sequence 0xdd 0xdd, which gets translated to a single 0xdd. By setting a breakpoint on "read" I was able to verify that the correct data is coming from the device, but that the visa library is doing some special handling when it sees an 0xdd - but only if a particular flag is set; and the flag is set when I use the DEXT, but clear when I use the KEXT.

 

After a lot more debugging I found that during viOpen, with the KEXT, the internal VISA function

SerialPassport`nSerialPassport::CSerialOS::IsNISpecialEncodingSupported returns false, but with the DEXT it returns true. If I break in the debugger, and change the result to false, everything works as expected.

 

So what exactly is NISpecialEncoding, and why does ni-visa think that the SiLabs driver supports it? Because it certainly looks like it doesn't. Is there some config I can set to override the NISpecialEncoding flag?

 

0 Kudos
Message 1 of 1
(369 Views)