Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA resource name on Raspberry Pi

 

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.

image.png

when I run the following code, I received the VISA resource name "ASRL1::INSTR".

image.png

But when I run this code, the error is returned, seems like the one I am using is not /dev/ttyAMA0.

image.png

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

 

0 Kudos
Message 1 of 8
(500 Views)

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

 

 

0 Kudos
Message 2 of 8
(440 Views)

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

soe7_0-1649400016080.jpegsoe7_1-1649400016082.png

 

0 Kudos
Message 3 of 8
(388 Views)

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.

 

Message 4 of 8
(330 Views)

That is correct! I did that once to release aslr0 

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
Message 5 of 8
(321 Views)

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

 

Message 6 of 8
(253 Views)

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.

Message 7 of 8
(227 Views)

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 

 

https://youtu.be/yHBRsvxrtSo

Jorge Augusto Pessatto Mondadori, PhD
Sistema Fiep
CLAD, CLD
Message 8 of 8
(224 Views)