03-31-2022 06:17 AM
Hello,
I am using LabVIEW on Raspberry Pi to retrieve data from Modbus enabled devices.
The devices that we need to communicate are TCP and RTU based devices.
By using Modbus pallet from LabVIEW I managed to get data from TCP devices.
However, when I try to interface on RTU device, I am running to errors. I have installed physical RS-485 converter on Raspberry Pi.
And the device is working as I have verified using python script. The detail of the device is as follow.
when I run the following code, I received the VISA resource name "ASRL1::INSTR".
But when I run this code, the error is returned, seems like the one I am using is not /dev/ttyAMA0.
Can someone help me on this, how can I bind this device path /dev/ttyAMA0 to LabVEIW VISA resource name?
Thank you and have a good day.
Soe
04-05-2022 02:58 PM
The Pi has a UART coming out of GPIO14 and GPIO15. You need an RS485 converter which uses this UART (not a HAT which relies on I2C) and this will then map to VISA [ASRL1::INSTR]
I've used this HAT and it works just fine :
https://thepihut.com/products/rs422-rs485-serial-hat?variant=40202822254787
04-08-2022 01:41 AM
Hello Tark,
Thank you for your suggestion. In fact, I am using this device https://www.abelectronics.co.uk/p/77/rs485-pi and according to their doc, they are also using UART. Please, see here https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3-serial-port-usage . But I am still facing the same issue.
with regards,
Soe
NI Certified LabVIEW Architect
AWS Certified Solutions Architect-Associate
04-13-2022 09:45 AM
I think this may be the problem. The serial console is probably grabbing the resource........what you actually need to do is DISABLE the serial console so that your LabVIEW application can get the UART resource.
04-13-2022 06:17 PM
That is correct! I did that once to release aslr0
04-19-2022 05:10 AM
Hi Tark and Jorge,
Thank you for your suggestion. I have tested and can confirm both of your statements that enabling the serial console won't work when you are using UART.
The issue we had was slightly different, one of our engineers read the information from the supplier website (https://www.abelectronics.co.uk/kb/article/1035/raspberry-pi-3-serial-port-usage) and he was confused between mini UART and PL011 UART. Thus, he basically followed the steps to disable the PL011 UART.
Then, this issue arose and when we checked with supplier, they recommended to install additional software called minicom to set the configuration. All these combinations might caused us not being able to retrieve data using LabVIEW.
Now, we managed to solve the issue by simply reinstalling OS and started from the scratch.
with regards,
Soe Pyae
NI Certified LabVIEW Architect
AWS Certified Solutions Architect-Associate
04-20-2022 04:57 AM
Glad to hear you were able to resolve the issue.
For future reference, most USB-Serial converter modules seem to work with Rpi.......you just have to run the VISA search to find the new reference.
04-20-2022 05:07 AM
Just as curiosity, i made a vídeo on that, using an arduino (with linx firmware) to read digital and analog pins on the rpi through USB