I'm not sure if this goes in the VISA group or this one, but I've discovered something interesting when setting baud rates on a cRIO-9603 vs Windows. The VISA Configure Serial Instrument VI will accept any value for the baud rate input, but the system driver will return an error if it is not supported. In my case, I was using the UART to sniff LIN bus traffic through a LIN transceiver and FTDI TTL-RS232 cable. My first prototype was on Windows and I didn't have any problems setting the baud to 10,417 (which is a standard LIN baud rate). Once I moved the project to a cRIO platform, trying to set the VISA baud to that value would throw this error:
VISA: (Hex 0xBFFF001E) The specified state of the attribute is not valid, or
is not supported as defined by the resource.
A quick trip to the google came up with this info about supported baud rates on Linux:
So it looks like the libusb library on Linux does not support custom baud rates and will throw the above error if you try and set it to something not on that list. You can verify if a baud rate is supported on your Linux platform by following the instructions in the post above. Here's what I got on my cRIO:
admin@NI-cRIO-9063-01bff9da:~# stty -F /dev/ttyUSB0 10417
stty: invalid argument '10417'
admin@NI-cRIO-9063-01bff9da:~# stty -F /dev/ttyUSB0 19200
If you don't get a response, that should mean that the baud rate is valid.
You are correct, the Linux operating system limits baud rates to standard values. The article below includes most of the standard baud rates accepted.
"If you use NI-VISA in Linux or Mac OS, you usually are limited to the standard baud rates specified in this document. The standard driver on these operating systems does not support arbitrary baud rates. To check whether a baud rate is supported with NI-VISA, open a session to the port using VISA Interactive Control and attempt to change the baud rate in the Serial Settings tab."
Let me know if you have any questions about the above KB!
Chris D. | Applications Engineer | National Instruments