LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read/write into file in LabVIEW RT

Hai

I Need to know if it is possible to write and read from a file in a PXI system running on RTOS. Does LabVIEW RT support this? if yes then how do i give the path to read the file?

Thanx for any answers

Arun
Message 1 of 13
(7,399 Views)
Arun,

Yes, LabVIEW Real-Time supports File I/O operations. Please keep in mind that File I/O operations are inherently non-deterministic, so you won't want to put them inside your Time-Critical loop.

Having said this, you can use the regular File I/O calls under Real-Time in your other non-Time-Critical tasks (Communication or Logging Loops) just as you do in LabVIEW under Windows.

You can provide an absoulte path which usually starts with c:\ for the main drive on the target. Other drives on the target (like Firewire external hard-drives) can be accessed by using the appropriate drive letter (usually G or higher).

To get an idea of the File Structure of your target, simply ftp to it and brose through its folders. I reccomend that you only log data to
the following paths:

- Temp folder: Use the Temp folder constant in LabVIEW, which usually points to C:\Temp
- Data folder: Use the Default Data Directory constant in LabVIEW, which usually points to C:\Startup\Data on most targets.
- Use an external Firewire drive. LabVIEW Real-Time 7.1 or higher supports the use of external hard-drives through a Firewire interface.

I hope this helps,

Alejandro
0 Kudos
Message 2 of 13
(7,394 Views)
Can you read and write a floppy file?
0 Kudos
Message 3 of 13
(7,355 Views)
Hi,
I replied to your original post. Here is the duplicate of the answer I posted there:

Thanks for contacting National Instruments. Writing to floppy disk from the PXI-RT controller in RT mode is not supported. You may be successful sometimes in doing this, but you may see erratic behavior including corrupted files when you do this. This is because the RTOS doesn't extend its file operating system to the floppy drive. As you may be aware, a PXI-RT controller may be booted using an RT bootdisk. At this point, the floppy becomes part of the boot sequence. Limiting write access to the floppy disk ensures that the bootdisk is not written to and made corrupt, since the OS is installed from the bootdisk.
I would suggest writing files to the hard drive of the PXI controller and then transferring them to the PC using FTP. If you have the Internet Connectivity toolset, you can even do the FTP part programmatically.

Hope this answers your question. Please let me know if you have any additional questions.

Have a nice day!
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 4 of 13
(7,319 Views)
Thankyou for your input. I have a few more related questions?

Is it possible to boot in to LabView RealTime from the hard disk alone so that the USB floppy would be available to be read from and writen to?

Can one add a second USB Floppy drive that would be available to read from and write files to?

Are USB Flash Drives supported by LabView RT on the PXI Embedded controllers?

Thanks, McKevin.
0 Kudos
Message 5 of 13
(7,307 Views)
Hi,
I am currently investigating what types of USB storage devices are support by the RTOS. I will post a response here as soon as I find something out on this.

Thanks!
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 6 of 13
(7,291 Views)
Hi,
USB is not supported by the actual Real-Time Operating System (RTOS). There is some legacy support which allows the BIOS to be able to boot from a USB floppy or USB CD ROM device. But this support doesn't extend to the RTOS. Firewire, however, is supported. I would suggest try using a Firewire based storage device. Check out the following document:



NI Developer Zone: NI-1394 External Drive Support



I hope this information is helpful. Please let us know if you have any further questions.
Anu Saha
Academic Product Marketing Engineer
National Instruments
0 Kudos
Message 7 of 13
(7,271 Views)
So LabView RealTime can not read or write to a USB Floppy Drive.
So LabView RealTime can not read or write to a USB Flash Drive.
So LabView RealTime can not read or write to a USB any thing.

So I tried the FireWire as you suggested and did find that a
FireWire Flash Drive was indeed a viable solution. It appears
that the FireWire drive is also hot swappable, as your link suggests.

There are many many makers of USB Flash Drives, but the only
FireWire or IEEE-1394 flash drive that I could find was made by Kanguru.

When I ftp to my RealTime system and cd to my firewire g: drive
I am able to cd and dir the directories even when the flash drive
is removed. Should'nt there be an error generated if one does a
cd within a removed drive, or a dir of a removed drive? A get or
put does complain when the drive is removed.

Kevin
0 Kudos
Message 8 of 13
(7,176 Views)
So LabView RealTime can not read or write to a USB Floppy Drive.
So LabView RealTime can not read or write to a USB Flash Drive.
So LabView RealTime can not read or write to a USB any thing.

So I tried the FireWire as you suggested and did find that a
FireWire Flash Drive was indeed a viable solution. It appears
that the FireWire drive is also hot swappable, as your link suggests.

There are many many makers of USB Flash Drives, but the only
FireWire or IEEE-1394 flash drive that I could find was made by Kanguru.

When I ftp to my RealTime system and cd to my firewire g: drive
I am able to cd and dir the directories even when the flash drive
is removed. Should'nt there be an error generated if one does a
cd within a removed drive, or a dir of a removed drive? A get or
put does complain when the drive is removed.

Kevin
0 Kudos
Message 9 of 13
(7,175 Views)
So LabView RealTime can not read or write to a USB Floppy Drive.
So LabView RealTime can not read or write to a USB Flash Drive.
So LabView RealTime can not read or write to a USB any thing.

So I tried the FireWire as you suggested and did find that a
FireWire Flash Drive was indeed a viable solution. It appears
that the FireWire drive is also hot swappable, as your link suggests.

There are many many makers of USB Flash Drives, but the only
FireWire or IEEE-1394 flash drive that I could find was made by Kanguru.

When I ftp to my RealTime system and cd to my firewire g: drive
I am able to cd and dir the directories even when the flash drive
is removed. Shouldn't there be an error generated if one does a
cd within a removed drive, or a dir of a removed drive? A get or
put does complain when the drive is removed.

Kevin
0 Kudos
Message 10 of 13
(7,174 Views)