LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with writing to an Excel file

Solved!
Go to solution

I think the state machine you are talking about already exists in the program, if you've tested the code with an empty Excel file you'll notice that everything you said can be found in the result except "to skip rows/columns" which is hard to integrate into the program, if you have any suggestions please modify the code i've posted and see what heppens.

 

Thank you

 

MGarry

0 Kudos
Message 11 of 21
(1,191 Views)

Anyone to help me with the program please, i want to skip the highlighted rows/columns to prevent them from being overwritten and specify the range of blocs where i want to write samples, i have been trying to integrate a code to do that using the invoke/property nodes but i couldn't make it.

0 Kudos
Message 12 of 21
(1,181 Views)

There is no state machine in your code.  All your code does is continuously build a table of data in one loop and continuously keep rewriting the whole table to excel over and over.  That's nothing like the application you described.

0 Kudos
Message 13 of 21
(1,174 Views)

If only the skipping function can be added to the code the result will be good, don't you think so ?

0 Kudos
Message 14 of 21
(1,171 Views)

No, I don't think so.  I've attached an example that shows how to acquire data at a set interval and add that data to both a table and an excel file.  Note that for this example I modified your file to be an excel template and that I leave excel open while the main program runs.

Message 15 of 21
(1,167 Views)

Thanks a lot Wayne this will help me in my application, there is just a thing each time i run the code it opens a new template is there a way to keep using only one template even after stoping and runing the program it should keep filling in the same file (so if something happens suddenly and stops the program we should be able to re-run the program and recuperate all the samples on the same file: No lost data).

 

I have also noticed that the equations are not working because the sapmles are transfered  as String and not as numeric do you know how to fix this?

 

You deserve a compliment.

 

MGarry

0 Kudos
Message 16 of 21
(1,159 Views)

You can modify as needed to resume using a particular file.  You will need to add some code to figure out what was the last file used and where you can start adding data.  Equations working on my machine so it must be a setting in Excel.

0 Kudos
Message 17 of 21
(1,157 Views)

Ok Wayne maybe it's something with Excel,thank you again.

 

MGarry

0 Kudos
Message 18 of 21
(1,152 Views)

I confirm that the functions are not working cause the type string is not supported in this kind of operations, i have been looking into Excel see what's wrong and even followed exactly what is recommended to do by Microsoft support and nothing has changed, i run the VI and samples are written in String type, i was wondering if i could change the type of data from LabVIEW because i tried to adapt the "Set Cell Value" VI to take a numeric in "value" pin but it didn't work, any suggestions to fix this?

 

Please notice that the attached file shows what samples look like on Excel after being written (the blue cells should contain the average of the 8 first samples).

 

MGarry

0 Kudos
Message 19 of 21
(1,137 Views)

Someone to help me please, Wayne said it's working fine in his machine, i did everything i could and it still not working why!!

 

MGarry

0 Kudos
Message 20 of 21
(1,120 Views)