LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

format and append data to word file

Solved!
Go to solution

Hi,

 

I have designed a GO button when clicked it has to write the status of few buttons to a word file. As of now, the data is populating vertically.

1) How to populate data horizontally?

2) When the vi is running, for each and every click on the 'GO' button, the data has to keep logging.

This is not happening as a new word document opens every time I click on the GO button. Kindly help. Herewith, I attach the vi here.

salauddin_0-1576565643386.png

0 Kudos
Message 1 of 15
(1,677 Views)

Hi salauddin,

 

why do you have to use ExpressVIs to convert 3 boolean values into a 2D array of floats?

Why don't you use BuildArray, and BooleanTo01 function? Much easier, much more readable!

 


@salauddin wrote:

As of now, the data is populating vertically.

1) How to populate data horizontally?


You have a 2D array of data.

Which operation is used to transpose 2D array data, from "horizontal" to "vertical" and vice versa?

 


@salauddin wrote:

2) When the vi is running, for each and every click on the 'GO' button, the data has to keep logging.

This is not happening as a new word document opens every time I click on the GO button.


Why do you create a new file each time? Why don't you open the old file?

Or: why don't you open the file once before the loop and close it only once after the loop???

 

Please team up with Diaspora for the very same problem!

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
Message 2 of 15
(1,660 Views)

Dear GerdW, Thank you for your time and help. Based on your reply, I tried to make few changes but still unable to. I am fairly new to LAbVIEW. Your help will be really appreciated if you could share in the form of vi. Thank you so much.

0 Kudos
Message 3 of 15
(1,638 Views)

Hi salauddin,

 


@salauddin wrote:

Based on your reply, I tried to make few changes but still unable to.


So what did you change? Why don't you attach the changed VI?

 


@salauddin wrote:

I am fairly new to LAbVIEW.


So you did notice those "Training resources" in the header of the LabVIEW board? (Together with your classmates?)

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
Message 4 of 15
(1,636 Views)

Herewith, I attach the changed vi here.

0 Kudos
Message 5 of 15
(1,629 Views)
Solution
Accepted by topic author salauddin

Hi salauddin,

 

why do you create a 1D array when the RGT function expects a 2D array?

check.png

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
Message 6 of 15
(1,621 Views)

Dear GerdW, Really I am grateful for your kindly service. At the same time, kindly forgive me for being naive. I am progressing towards achieving the output I am expecting of.

 

Right now, empty table is getting populated whereas from row number 2, the status of the buttons should be getting populated. I attach the vi on which I implemented further changes and producing it for your expert guidance. I am really thankful for your selfless srevice.

0 Kudos
Message 7 of 15
(1,603 Views)

Hi salauddin,

 

what is the current result and what is the expected result? (Keep in mind: I don't have MSOffice installed on my computer and so cannot execute your VI.)

 

When the table should contain more data than just one row (or column) then you need to collect the data before appending the table to your report. That's what the help for this RGT function suggests - did you read it?

 

On your VI:

You should NOT use plain tunnels for references (like the RGT reference class wire), always use shift registers to hold references. You should also not "delete" the reference by wiring an empty constant to a tunnel (as you did in the other case): wire the reference through the case!

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
Message 8 of 15
(1,592 Views)

Sorry for the trouble. The expected output is each time I click on the GO button, the table needs to keep getting populated(in this case, the same status of the buttons).

 

When I run the vi for the first time and click on GO, this is the output I get on Word

salauddin_1-1576575494991.png

As the vi keeps executing when I press the GO button the second time, I want the same data to be written below(as the status of the buttons remains unchanged) but this is the output which I get.

salauddin_2-1576575572646.png

From the above picture, you can see the rows 2nd and 3rd are being populated but the values are not getting populated.

0 Kudos
Message 9 of 15
(1,587 Views)

Hi salauddin,

 

what happens when you implement all my suggestion from my previous post?

Best regards,
GerdW


using LV2016/2019/2020 on Win8.1/10+cRIO
Message 10 of 15
(1,577 Views)