LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Volume Info does not error when USB missing on sbRIO-9651

Hello-


We're working with a USB drive on a 9606 (VxWorks) and a 9651 (Linux RT). I'm using a LabVIEW primitive "Get Volume Info" to determine if the drive is present. Of course I've done the needed path changes for Linux RT, etc. I'm looking for the drive at /u and /media/sda1 for VxWorks and Linux RT, respectively, using a conditional disable with OS condition. Everything works fine on both targets if the USB drive is actually connected; however, when a drive is NOT connected the 9606 will return an error (as expected) but the there is no error on the SOM. I can ftp/webDAV and verify the path does not even exist, but LabVIEW seems to think this is ok. The attached picture says it all. I am assuming the path is cached somewhere? I don't know. No idea where to look or how to fix. Any ideas? Anyone else seen this? Thanks for reading, any input/ideas greatly appreciated. Thanks.


J.Harv

 

 

0 Kudos
Message 1 of 12
(3,140 Views)
I had a strange thought. If you test for a drive that has never existed, does it return the correct error?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(3,112 Views)

Hi Mike-

 

That's not a strange thought at all.  That will tell us whether it's something that happens as a result of having the USB PHY connected or if it is somehow "remembering" the USB drive that was plugged in.

 

So, I used "format disk" from MAX, reinstalled RIO driver software and ran the same code from the picture. First, check the disk, no /media/sda1.....and.... still no error.  So is it something in the OS reserving that path, maybe? because the USB is simply connected?  I dunno.

 

Other ideas?  That was helpful to gain knowledge about the problem. Thanks!

 

-J.Harv

 

*Edited for formatting.

0 Kudos
Message 3 of 12
(3,098 Views)

A bit more info from troubleshooting this morning.  I spoke to the engineer that designed the daughter card, we're using the same layout as the reference design, so should be ok.  Remember, the USB drive works when plugged in.  We shorted the Vbus line, which should look to the RIO like there isn't even a USB PHY connected, or so I'm told.  Still no error looking at media/sda1. 

0 Kudos
Message 4 of 12
(3,084 Views)

Hi John,

 

I have a feeling this is going to be a LabVIEW (RT) issue, but I have another ask just to rule out hardware design.  Is the behavior common when the SOM is used on the Reference Carrier board? Or with a Linux RT CompactRIO (cRIO-9068)?

 

If the issue does replicate on the reference board, it may be helpful to post to the Linux RT software user group I see you have already posted to the Linux RT software user group.  

 

 

Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 5 of 12
(3,063 Views)

Hey J.Harv,


I double checked with my system here and I get error 7 when I call get vol info against /u or /media/sda1 if the flash drive has been removed after verifying the drive works.

 

I probably have a slightly tweaked build from you but everything worked as described for the 9606, referring to the 9651.

I remember that you can cause the umount clean up scripts to fail if you are exploring the folders in the flash drive through ssh, basically it'll keep the folders there after you've removed the drive. 

 

I had created a car 460049 a while back to document this. Make sure the symlink for the drive and the mount point no longer exist in the respective directories. You can run the commands below to clean up the links where necessary. 

umount /media/sda1
rm u
rm U
rmdir /media/sda1

 

 

Kyle Hartley
Software Engineer
NovaCentrix
0 Kudos
Message 6 of 12
(3,048 Views)

Kyle-

 

Not sure if I understood you correctly, which systems did you test?  You do not see the problem there when using a 9651?  If that's the case I'll go down the hardware path and look deeper at the daughtercard.  If I misunderstood and you haven't tested a SOM, it could be beneficial to check the 9068 as Spex suggested.

 

I did a quick google site search for that CAR but didn't find anything, is it listed in the known issues?  That's good info though, I'll watch out for that. 

 

Thanks for posing those commands too, that'll definitely help.  One problem... I'm not really sure how to use those, can you explain?  I haven't gotten a chance to use Linux RT much.  Maybe some way to call them from my VI, clean things up before checking the path; or a startup script; or just manual commands? I'm just not as sure how to interact with the OS on this target. I'm used to VxWorks and console out. If you could point me in the right direction I'm sure I can figure it out.  Thanks.

 

Thanks everyone.

 

-J.Harv

 

 

0 Kudos
Message 7 of 12
(3,027 Views)

Hi John,

 

When I talked to Kyle, he had tested with the sbRIO-9651, and did see an error message (7) when the USB drive was removed (expected behavior.)  

 

His point was specifically focused on the WebDAV/SSH connection to your target.  His experience (and CAR) states that if you have remotely browsed to the folder where the USB drive is mounted, then when you disconnect the USB drive, the OS cannot unmount the drive properly, and therefore the path is still considered valid.  

 

Can you retest your this behaviour by rebooting the SOM, and then running your test code without connecting over SSH or WebDAV, both before, during, and after connecting/disconnecting the USB drive?

 

 

 

Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 8 of 12
(3,015 Views)

Hi Spex, Kyle-

 

That was exactly the problem.  Get Volume Info works exactly as expected after the system is power cycled.  As suggested I checked before, during, and after the USB drive was inserted and repeated.  Sure enough, browse files and it doesn't properly unmount.  Very glad to get that figured out.  Thank you for such a quick response!

 

So, to finish up here, how are those manual unmount commands used?  Is there a way to programmatically make sure the unmount happens?  I'm not too worried about now, while in development, but little bits of info like this don't always make it to the field and I don't want a tech in the field to accedentally run into this.  Thanks again.

 

-John 

0 Kudos
Message 9 of 12
(3,003 Views)

Hey John,

 

I've pursued methods on trying to get umount exposed via LabVIEW but unfortunately I haven't found a solid way yet. I'd hit the linux real-time guys with that question. Supposedly there is a way to share the permission of umount with the LabVIEW user. Brad is one of the gurus over there and he may have some ideas. 

 

I haven't gotten it to work yet, I was trying to get an example working for the user 1 button to demonstrate ejecting but its been a on/off project to get working.

 

Otherwise to use the umount command you can log in through ssh via admin and change to the root directory, If I remember its two levels up from home. If you ls from there you should see the /u and /U drive. If I remember right you can run the commands from this level to clean up the levels. It shouldn't come up with a deployed system because no one ssh in and sitting on the flash drive. 

Kyle Hartley
Software Engineer
NovaCentrix
0 Kudos
Message 10 of 12
(2,970 Views)