11-02-2021 08:00 PM
I've used VISA several times before, but never with an application like this one. I'm using a basic VISA Open command to talk to a RPLIDAR USB device. All I've been able to discover so far is that as soon as I open the VISA port, the RPLIDAR device stops rotating. The USB connection is providing power to the device, and it's like when I open the VISA connection it cuts the power.
Yes, I did search, and I've found several older posts related to this particular device, and the issues people had trying to talk to it in LabVIEW, but none that got as far as this, and no one that solved it. It seems everyone else gave up, or found the solution and didn't post it.
Anyone have a guess why just opening the port (even if I stop it there and do nothing else) is stopping the motor? I do zero commands, and close the VISA port, and the motor immediately resumes turning. It seems very strange to me.
Solved! Go to Solution.
11-02-2021 09:56 PM
Does the device support some kind of USB-UART converter or it is a native USB implementation and VISA open establishing the connection is not handled and causes the device to crash?
11-03-2021 04:35 AM - edited 11-03-2021 04:57 AM
Yes it's important to know what type of USB device it is. If it is a USB-CDC device, meaning it appears to the OS as a RS-232 port, there are many things that might be causing this. That the power is cut on opening the port sounds rather unlikely or the USB interface and/or device driver for that device is truly borked.
But RS-232 also has additional handshake lines like RTS, CTS, RTR, DTR, DCD and it is very possible that the device uses one of them as inhibit signal (or sometimes even as power source but that would be also a borked implementation).
Do you use the VISA Open function to open the port or rather the VISA Configure Serial Port? What do you use to close the port again, which according to you makes the device work again? What is the make and model number of the device?
Looking through the sources of the LPLIDAR SDK, which supposedly is for your device, I do see that they explicitly enable the DTR line when opening the port and then clear the DTR state (setting it to RS-232 state space, which is the positive/high voltage +5-15V).
Try to add a property node to set the VISA->Serial Settings->Modem Line Settings->Line DTR state to most likely logic FALSE after you open the port. You will also need to make sure to use the right baudrate.
But things will get hairy after that. The SDK is not just a trivial driver sending some text commands to the sender. It transfers commands and data as binary and most of that logic can be found in here and while it is totally possible to do this in LabVIEW, it is going to be a lot of work and the binary nature of the data stream will make you learn a few more things about bits and bytes than you probably have cared to learn so far.
11-04-2021 10:18 AM
Thanks everyone for the quick responses. That pointed me in the right direction. Turns out that it's not actually all that complicated, all that is needed is to set the DTR state to on/off to control the motor. I've never used those lines before and would not have though of that on my own. The rest of the API is fairly straight forward just writing on binary byte packets and reading back the response as per the manual. Here is an image of my new open command that works:
For anyone else facing the same issue, the DTR line can be used again to turn off the motor. It's basically an on/off switch (or that's what it looks like to me anyway.)
01-03-2025 08:01 PM
Hello, I want to ask some questions
I currently have a school project
Need to use rplidar
But I don't know how to start
This is my first time using VISA
>I would like to ask how to send commands to rplidar?
This problem has troubled me for a long time:<
I have found the program for URG 04LX UG01 but it seems to be incompatible.
Thank you very much if you have any reply
01-04-2025 01:42 PM
Hello Xiao,
do you really have to send "0XA5" and "0X20" as ASCII- Characters? Prehaps you have to set the string constant to Hex-Format and type in "A5 20". Check that.
Btw. did you read this post? It might help.