LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to store data into a file from a host VI developed for Compact RIO

Hi,
I am new to the CompactRIo.I have developed a VI which runs on the FPGA(CompactRIO) which continuously monitors tha data from a system and i have developed a host VI to read the data and i am successfully getting the data into my computer and i want that data to store into a file.When i use the write to spreadsheet VI for writing into a file.The data is not written into file can anybody tell me why this is happening?
0 Kudos
Message 1 of 17
(7,208 Views)

Hey,

Are there any errors? Did you debug your VI to see if the data reaches the "write to spredsheet.vi"? Is there no file or an empty file after writing the data? And so on...

I think we need a little bit more information on whats going on to help you!

Christian

0 Kudos
Message 2 of 17
(7,187 Views)
Hi,
Data is coming up to write to spreadsheet, but after we open the file it shows empty.In simulation there are no errors.I have tried with write to measurement file vi also there also the same situation i.e. file is empty.I am not able to findout what is happening.

Vishnu
0 Kudos
Message 3 of 17
(7,182 Views)

Hey!

One thing you can try is to take the File I/O Part, place it in another VI and write dummy data (e.g. random numbers) to the "write to spreadsheet file.vi". So just test the File I/O part for its own.

Christian

0 Kudos
Message 4 of 17
(7,178 Views)
HI,
By the way host VI developed is running on the CompactRIO RT controller(9004) not on the host computer.As you asked i did the seperate file I/O in my computer where it is working (as it should be) fine.But, when i am running that host VI which will be running on the RT target i am not receiving any data into the file.I am attaching my VI's please look into it.
Regards,
Vishnu
0 Kudos
Message 5 of 17
(7,139 Views)
Hi,
When we normally using file I/O in Labview in windows, if we are using write to measurement file even though file is not existing it will create file and write the data into it.When we are using write to spreadsheet to Vi we have to select the file even if it is text file it will write into it.But waht is happening in my case i am not able to figure it out.If i use write to measurement file it shows blank file.If i use write to spreadsheet if i select text file it is showing that the file you selected is not matching with the foramt.If i select an excel file the Vi runs but, after that it shows blank file.Is there any special procedure to write the data into file when we are running VI on RT(9104) target? please tell me.
Regards,
Vishnu
0 Kudos
Message 6 of 17
(7,137 Views)

Hey!

Ok, so you don't run the File I/O on your Host computer but on your 9004 controller...., anyway it should work! Again i would suggest to run a realy simple example with only the File I/O on your 9004. Attached you will find a very simple VI which only writes random numbers to C:\test.txt of your 9004. Please test this VI.

Christian

0 Kudos
Message 7 of 17
(7,121 Views)
Hi,
The Vi you have attached is written in Labview 8.2 but here i am using the Labview 8.0 only.Any way i have built a simple VI which runs on the controller and am attaching the file please see it.Still i am getting the emptyu file only.I dont know what is happening but it stalled my work.I have few doubts in this regard 1. When we running a Vi on a RT target it is downloaded into flash memory of controller and there it is running right? In that case can we store the data in flash memory and from there can we read the data? If the data it is displaying in the front panel why it is not able to write in a file? 2.Can i interact with the analog input/output modules which are fixed to chasis through 9004 with out involving the FPGA?
Regards,
Vishnu.
0 Kudos
Message 8 of 17
(7,050 Views)

Hey,

First of all, you shouldn't use Express VIs on realtime targets.

Another hint would be to copy the file from the cRIO target to the host PC, so to open the File via ftp://100.100.100.101 (please use the IP of your cRIO there) and then copy it on your desktop. This is because Windows keeps the file in memory as longe as the ftp connection is open, so it will display no changes of the file since you open it the first time.

Christian

0 Kudos
Message 9 of 17
(7,038 Views)
Hi,
The last one you said is working when i conected through it is working, whatever files i have  used earlier are there.Thanks  for that but i have few queries please answer me so that i acn proceed in my  project.

1.As you said to connect to ftp://xx.xx.xx.xx i have seen some extra files along with my files waht are they? waether my data files are stored in flash memory of RT controller?if so, how to clear those files?
2.Suppose i want to clean up the flash memory of RT contrller i.e suppose i have deployed some file earlier , now i want to cleanup those i dumped into the memory how to do that?
3.How to disable the Application running on the RT controller when it powers on? i.e. when i switch on the power it should be connected but nothing hould be running on.
4.I mean at the end of the experiment when i stopped the host VI by pressing stop button weather application running on the RT controller will stop and weather FPGA VI runnibg on that also stop if not how to stop?
5.Suppose next time when i connect to ftp://xx.xx.xx.xx i dont want to keep earlier files there how to delete them?Because my doubt is if i am using the file name which is same as the prevoius one there is aproblem of appending the new data to the old file.?

Regards,
Vishnu


0 Kudos
Message 10 of 17
(6,745 Views)