LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

table read write

Hi,

 

I am tring to import data from excel file into a table. the user should modify the data in the table, then export the data again into another excel file. i dont have any problem to import/export data from/to excel file.

 

the problem how i can use same table as control/indicator???

 

I am looking for your support please.

 

thanks and best regards,

FAHAD

0 Kudos
Message 1 of 11
(4,422 Views)

Hi Fahad,

 

that's what locals are good for!

Make the table a control. After reading the excel file write the data to a local of the table, before writing the file back you can read from the control...

Message Edited by GerdW on 09-09-2009 04:15 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,414 Views)

thanks for your assistance.

 

 

did you mean "local variable"??

 

other thing, how i can modifiy the contents of the table while it is running. the cell look like locked while the VI is running?

 

Thanks so much for your help and assistance,

FAHAD

0 Kudos
Message 3 of 11
(4,389 Views)

To create a local variable, right click the control (or indicator) and go to

Create >> Local Variable

 

If you right click the local variable, you can change to read/write depending if you want it to act as a control/indicator respectively.

Cory K
0 Kudos
Message 4 of 11
(4,380 Views)

Hi FAHAD,

 

when I do it like this I can edit the table:

locals.png

Write to the local once to initialize, then do editing in the loop, then write the final content...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 11
(4,362 Views)

Thanks Mr. GerdW.

 

 

 

 

 

 

0 Kudos
Message 6 of 11
(4,339 Views)

dear,

 

the above way is suitable in case of no previous values in the table. but in my case already the table contains a values. i tried many times but in all times it is not works.

 

could you please help me with an example with reading values from Excel sheet then edit those values then send it back to excel.

 

 

0 Kudos
Message 7 of 11
(4,217 Views)

Hi Fahad,

 

replace the empty array constant by your "reading some Excel values" routine and you're done Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(4,215 Views)

Hi,

 

in the attached file , how i can link "all rows" variable with "table"

 

could you please modifie the VI to be clear for me.

 

 

Thanks in advance for your assistance,

FAHAD

0 Kudos
Message 9 of 11
(4,204 Views)

Why did you create the local variable 'local rows' in the first place?

 

To fix it, just left click on the local and select 'Table' to link it to that  control.

 

Please check the free LabVIEW tutorials.

0 Kudos
Message 10 of 11
(4,191 Views)