LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save values from subvi into spreadsheet

Hi everyone,

 

I am new to LabView and I have a problem that has been on for days now..

 

I am creating a quiz where each questions will be in a VI itself. The main VI will be calling the subVI into the subpanel when it is called. My problem appears to be at the "results" part of the quiz. I do know the use of "Save to spreadsheet.vi".

 

I have tried putting the save to spreadsheet.vi in the subvi but it does not save the data until the "stop" button in the subvi is pressed. Clicking the stop button is not a problem. The problem is that once I pressed the stop button, I cannot call out the next question.

 

I have also tried to put the "save to spreadsheet.vi" at my main vi. But the whole VI does not run at all.

Download All
0 Kudos
Message 1 of 12
(3,421 Views)

I think what you need is an event structure. Make a write to file button, then set the event strucutre to write the file when your button is pressed. This will stop the program from stopping.

 

In the example I attached, I didnt name the buttons (which i should have), but when each button gets pressed, the event structe will happen. Similar to when your write to file button gets pressed. 

 

Good luck. 

0 Kudos
Message 2 of 12
(3,379 Views)

One problem is you are using tunnels on the while loop in your sub-vi.  You should enable auto-indexing to capture all the data from every iteration; otherwise, you will only see the last data element. 

 

Edit: Perhaps your intentions is to capture on data set?  In that case, never mind.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 3 of 12
(3,358 Views)

How did you create these .png files?  Did you create a Vi snippet?  I can't load your pics onto the BD.  Can you post your code?

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 12
(3,350 Views)

Also add a Wait function in Q1 loop so you don't monopolize the CPU.

 

Ben64

0 Kudos
Message 5 of 12
(3,327 Views)

very sorry for the late reply.

 

the attached is my VI. i did not use a labview tool to take the picture.

 

Another problem i realise was that when the back button is pressed, the vi is "refreshed" the value that was previously keyed in was gone.

Download All
0 Kudos
Message 6 of 12
(3,309 Views)

ic... thanks for your input... i will try to add the event structure into my "questions" and get back to you (:

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

I suggest down-converting your code to 8.x.  You may get more help because more folks will be able to access your VIs.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 8 of 12
(3,277 Views)

oh... i have solved my problems already... although i think i need some activex thingy to save it to excel...

 

I inserted another case so as to save into spreadsheet. thanks everyone for helping me (:

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

If you solved your issue please post your solved VIs

I think it will be informative for others alsoSmiley Wink

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thanks as kudos only:)
0 Kudos
Message 10 of 12
(3,255 Views)