03-13-2023 04:54 PM
I am reading and writing data from a device with serial communication using NI-myrio's usb port.
Reading and writing data with NI-myrio is slower than on a computer, and I guess the cause of this problem may be the delay timer. Because if I set the latency timer on the computer to 16 ms, I get the same performance as in myRIO.
So I want to change the usb com port latency timer of NI-myRIO. But I don't know how to set the latency timer for NI-myRIO, I searched but there is not much information about it. Anyone have an idea about this?
03-14-2023 02:12 AM - edited 03-14-2023 03:10 AM
03-14-2023 02:48 AM
Thank you for your concern.I have attached the image below.
03-14-2023 03:06 AM - edited 03-14-2023 03:10 AM
ahh, learned something new…
Why do you think a USB (virtual COM) port setting will be relevant for the myRIO?
It's UART lines are directly connected to the ZYNC7010 and don't run over an USB bridge…
03-14-2023 04:10 AM - edited 03-14-2023 04:15 AM
This is typically an FTDI thing (but other USB to RS-232 manufacturers probably copied, ahem I mean added that feature to their drivers too) and used to be a registry settings but it seems newer Windows driver versions allow for setting this explicitly in the driver dialog.
Linux works differently however. The official FTDI driver for Linux is part of the kernel sources and not FTDI sanctioned, since they kind of don't want to officially document all the details. They unofficially supported the kernel folks with things to get it working well, but you can not get the full specs for their chips without some NDA and that of course eliminates the possibility to use such information for an open source driver.
Not sure if the stock Linux driver for FTDI supports even the latency setting. This post seems to indicate that it does, but it requires modifications to a system setting that requires elevated privileges, so may need to be done manually as sudo command or with admin/root rights. And the system may clear this setting after a reboot!
And as Gerd says, you may be better off to forget that USB to RS-232 adapter and directly use the build in UART pins. But you will likely need to add level shifters of some sort! The UART pins are 3.3V logic level. If you connect that directly to an RS-232 interface, you for sure will destroy the UART pins and possibly also other parts of the ZINC chip and then your myRIO is simply a brick.
03-14-2023 12:29 PM - edited 03-14-2023 12:30 PM
Hi,GerdW and Rolfk
If I set the "latency timer" on the computer to 16 ms, the serial communication speed is equivalent to the performance I get in myrio.
But if I set the "latency timer" on the computer to 1 ms, since there is faster data exchange, I think that if myRIO can make such an adjustment in the usb port, I can probably achieve better performance.
The board I use for serial communication is "U2D2" dynamixel motor serial converter. I couldn't manage to run it directly with UART pins.
Another situation is that it is a bit of a problem to make manual adjustments directly on linux in the method that rolfk says.
If I use UART, I really have no idea how to connect usb connector UART.
Actually, I have an extra problem. For NI-myrio, the baud rate can be set to a maximum of 921600, but it does not correspond to the baud rate values (115200,250.000,500.000,1.000000 .etc) documented by the serial converter I am using.
For this, I need to create a data exchange with 115200 at maximum speed.
03-14-2023 12:41 PM - edited 03-14-2023 12:44 PM
Your device seems to use an FTDI chip.
The manual adjustments as I showed a link to are simply more or less the Linux way of what you would do in the registry under Windows.
Most likely there are other ways to do it such as adding some configuration settings to the udev rules that are executed when the device is plugged in. However this type of things are:
- fairly difficult to find about
- vary in true Linux manner frequently depending on your kernel version, distribution and/or the hardware involved
- and because of the previous reason there are 100ds of youtobe videos and other tutorials that will likely lead you into trouble as they don't or don't quite apply for your case
The right support channel for this would be the manufacturer of your hardware. But it is of course a big question if:
- they can be even contacted
- they have any idea how their own hardware works
- if they know anything about their hardware, how it works in Linux generally
- and more specifically in embedded Linux kernels which the NI Linux system is
03-27-2023 10:22 AM
Thanks everyone for their ideas, but I've given up on changing or messing with this right now because it will take a lot of time.