Discussion:
cRIO 9012 USB fix drive letter
(too old to reply)
Manigreatus
2008-07-30 14:10:08 UTC
Permalink
Hello All!I am using cRIO 9012 controller with 9102 chasis along with NI 9802 and IO modules in a system. I am logging data on SD cards and on USB drive connected with controller via USB port. I am using cRIO 2.4. Is there any possibility so that whenever I connect a USB
drive
to the controller and controller will assign a fix Drive  Letter say
U without  taking into account that the NI 9802 SD cards are mounted
or not. The problem is when I start the application.Regards Mani
Bassett Hound
2008-07-30 21:40:09 UTC
Permalink
Manigreatus wrote:Is there any possibility so that whenever I connect a USB drive to the controller and controller will assign a fix Drive  Letter say U without  taking into account that the NI 9802 SD cards are mounted or not. .



In the current implemenation for Mounting SD Cards and the USB port there is not a way to force the USB port to use Driver U if the application has already Mounted SD Cards from Real-Time.
 
However, assuming the USB is plugged in all the time you should always get the U drive as mountings happens on boot as well as insertion.  As you noticed, the only case where you wouldn't get U for the USB drive is if you called RT Mount on an SD card before you plugged in the USB. If always having the USB stick present before mounting SD Cards is not possible, then the only workaround that comes to mind is if you always reboot after you change the USB then the USB should always get U.
 
In the meantime, I've filed Corrective Action Request for this behavior with ID #121831 for a solution to be investigated for future releases.
 
If you can help explain how your using both the USB and SD cards from RT we might be able to determine other software work arounds for you.
 
Thanks,
 
Basset Hound
Manigreatus
2008-07-31 08:10:10 UTC
Permalink
HiThanx Mr. Basset HoundBut it was already cleared to me that rebooting is a remedy after each connection.My system will work as a stand alone and acpuire n log data for months then after this it will be connected to xp machine so that the files can be accessed i am using FTP. But  I think rebooting is alright.RegardsMani
Manigreatus
2008-07-31 15:10:08 UTC
Permalink
Dear Mr. Hound I have encountered a new problem. When I stop the vi delibrately(without unmouting SD cards) while the SD cards are mounted, and then run again the same vi, then the mount cards gives an error to  run chkdsk.  For removing  this error I need to  put out the  SD  cards from the module and then format them and then run chkdsk and put in the cards again then the mount cards work. It works properly if unmount is done after each mount. When I target this vi on cRIO for running as startup then this works only for the first boot of cRIO but not afterwords. Please help me resolve this problem. when I stop the vi from the control I put it unmount the cards properly then stops but how can I do this thing with embedded vi because it can be unplugged any time.Best RegardsMani
Bassett Hound
2008-07-31 22:10:09 UTC
Permalink
Is the System powered off during any time?  Any chance you can provide a small RT VI that can reproduce this behavior?
 
Thanks,
 
Bassett Hound
Manigreatus
2008-08-01 08:10:09 UTC
Permalink
Of course it could be stopped any time since there is also a USB connection that can be unplugged. Is there any possibility so that this error(that comes out while mounting SD cards that were not unmounted) can be removed programatically. Plz give me that small RT vi details. RegardsMani
Bassett Hound
2008-08-01 18:10:09 UTC
Permalink
Manigreatus wrote:Of course it could be stopped any time since there is also a USB connection that can be unplugged. Is there any possibility so that this error(that comes out while mounting SD cards that were not unmounted) can be removed programatically. Plz give me that small RT vi details.


I'm sorry, I was asking if you could provide the RT VI so that I could see if I could reproduce the same behavior your seeing.  There is not a way to programatically change the Method so it does not error out in this case if it believes the error is needed without modification to the internal code.
 
Basset Hound
Manigreatus
2008-08-05 10:40:06 UTC
Permalink
Hi Here is the sample vi attached, I have solved the problem by using the user 1 switch on the controller. But the problem happens again if a power failure occurs which is likely to happen.RegardsMani


ExampleSD.vi:
http://forums.ni.com/attachments/ni/170/346628/1/ExampleSD.vi
Bassett Hound
2008-08-08 18:10:05 UTC
Permalink
Thanks for the VI Mangus,
 
From investigating the behavior, I'll help describe what is happening with your system to give a better understanding.  When power is cut at some future time, anything thats using a FAT file system can and does become corrupt if its not properly shut down.  So, as you have seen, when your application loses power, if the SD cards have not been un-mounted properly, then when we attempt to mount the Card, the software sees that the FAT file system has become corrupt and requires a run of chkdsk to recover it before we can mount again.
 
Now, this is different than some other OS versions, as&nbsp;others&nbsp;(Windows, etc.) are more lenient on the mount side.&nbsp; There are lots of minor corruptions that they are lenient enough to mount anyway.&nbsp;&nbsp;NI&nbsp;had an explicit desire to be strict and not lenient in these cases as&nbsp;if we mount filesystems that are corrupt in this way we might be overwriting any data that your application may have generated.&nbsp; So, currently, a proper system should have a way to provide a safe shut down procedure so that File IO can have time to close and un-mount the SD card.&nbsp; This could be done with an external battery on the input and monitoring on the RT controller on which Power Suppy Input is being used.&nbsp; See the Tutorial <a href="http://zone.ni.com/devzone/cda/tut/p/id/6546" target="_blank">Designing High Availability Systems with CompactRIO and Compact FieldPoint</a>&nbsp;for some more information on this subject.
&nbsp;
We have considered providing a method to explicitly Mount and SD card even though its a little bit corrupt so please file a product suggestion if you would like to see this feature.
&nbsp;
Let me know if you have any questions.
&nbsp;
Thanks,
&nbsp;
Basset Hound
&nbsp;
&nbsp;
&nbsp;
&nbsp;
Manigreatus
2008-08-11 09:40:11 UTC
Permalink
Thanx for your support. That's&nbsp; nice&nbsp; being strict in file I/O because we dont want to loose data at any cost; but there should be the other option as well.Now how to read the power source in field point its done by using power source item but in cRIO 9012 how can we detect that which power source in use. Will I need to use an input channel from I/O module externaly or there is something implicit that I can use. Is there any way to read the color of the LEDs of controller. Please help I need an urgent reply.Regards Mani
Bassett Hound
2008-08-11 14:40:11 UTC
Permalink
Hi Mangus,
I would agree it would also be nice to have a second option if your okay with mounting while the card is a little dirty and I'll be pushing for this feature in our next release.&nbsp; For reading the power source of cRIO-901x controllers, there is a way to do this programatically from the controller without the need of an AI module.&nbsp; Currently, the procedure is not detailed in the shipping software but if you can create a Service Request Number and post it here I can make sure you get access to it.
If your comfortable with posting your email address I can also send you the files as well.
Let me know how you would like to proceed.
Thanks,
Basset Hound
Manigreatus
2008-08-11 15:10:09 UTC
Permalink
I dont know how to create create a Service Request Number. If you can give me your email then I will send mine to your email adress. Reply me soon.
Manigreatus
2008-08-01 15:40:21 UTC
Permalink
Hello I am also using shared variables on the same system but these network published shared variables are not visible on other machines when cRIO is running as a standalone system.Please help me these variables work&nbsp; properly when I&nbsp; target from project explorer but not work when run as startup.RegardsMani
Loading...