I use 4 comports in my program, 2 from computer mainboard and the other 2 from PCI com port card.
I got error from pci comport card whe visa flush/set buffer size. The error code is -1073807299. There is no such error report on comport from computer mainboard.
Is there anyone has such experience?
What could be potential root cause and how can I fix it?
Thank you in advance.
That error states "Invalid buffer mask specified." Please share your code so we can examine it and help find your issue.
I'm left to assume there is something wrong with your serial port card and/or its drivers. Your flush VI worked just fine in my system. But you have something from Comtrol, which I had a bear of a time getting one of their devices to work (Ethernet-Serial port hub). And the tool you are using has a copyright of 2014, so you should see if there is an updated driver.
I'm left to assume there is something wrong with your serial port card and/or its drivers.
That`s the point. An updated driver may solve this isse.
I also think, that VISA is doing some magic staff before or after calling the windows API function PurgeComm inside "VISA Flush I/O Buffer". Have you tried the other options ("Flush Receive Buffer (No I/O)" instead of "Flush Receive Buffer").
For "VISA Set I/O Buffer Size" try "I/O Receive and Transmit Buffer" instead of "I/O Transmit Buffer" because the windows API function SetupComm always needs both buffer sizes (receive and transmit buffer). Try much smaller buffer sizes.