I am using raspi Cm4, as the documents stated out Cm4 exist 5 uart and i enable and dtoverlay uart2,uart3. however, in labview linx device not able to use them. how can i fix it?
Solved! Go to Solution.
The number of UARTs that Linx supports are hardcoded in the liblinxdevice.so library. But you are trying to use VISA instead and that should support additional serial ports IF they are properly installed in Linux. There is a potential issue with VISA recognizing those UART channels though. Traditionally Linux installs serial ports as ttyXXXYY in the /dev tree. XXX depends on the serial port driver that is used to access them and YY is an increasing number. Linux also likes to install many pseudo ttySomething devices that are not real serial ports, so VISA can't just go and try to detect every device starting with tty in its name. You would end up with several dozen VISA serial ports that can not be used for communicating with anything useful.
So you need to do some work on your Raspi.
First complication is that the environment the LabVIEW executable runs in is not directly the Raspbian host OS but a sort virtual machine running inside your host OS. This uses the Linux chroot system.
So you need to open a command line shell on your Raspi and then change into that chroot subsystem:
sudo schroot -r -c lv
This will change the prompt to indicate that you are now operating inside the LabVIEW chroot environment.
Once you are in there you need to verify a few things about VISA.
Points 1 to 3 should not be relevant. If that was not correctly setup you could not even connect to the ASRL1 port.
Did you solve it? I have same problem but I wanna use UART3 in CM4.
I read Rolfk's solution but it seems that in LINX just first serial (Serial0) is defined (Maybe because LINX is written for Raspberry 2 & 3).
I activate UART3 and use it with python so my hardware works fine but in LabVIEW(LINX) I can't make it.
(UART1 works fine & charm.)
Did you change Raspbian parameters (like config.txt or cmdline.txt or...) ? Could you send for me your steps in Raspbian & your VI?
Finally, I get my desired goal with these steps:
1- The kernel use of the serial port must be disabled in /boot/cmdline.txt file by removing this flag:
So, it should be something like this:
console=tty1 root=PARTUUID=295be2ff-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
2- Add these flags in the /boot/config.txt file (if you want to use UART3):
Or these “dtoverlay” if want to use UART4 or UART5:
3- In your VI, when configure VISA port, use this syntax:
4- Use “VISA Find Resource” before read or write on VISA.