LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Drop down menu output to populate list that gets written to spreadsheet

Hello,

 

What I am trying to accomplish is take the output from my drop down list (Spring Name, K1, K2, K3, Open Load, Seat Load) and arrange them in a list to then populate on the spreadsheet that the other chunk of code writes too.  It needs to be after user data and before spring on the spreadsheet writing portion of the code. 

 

There will have to be an additional column header for the larger output, I know.

 

I was partially successful previously in wiring the spring info from drawing output to the input between the user info and spring, but when i opened the spreadsheet the cells were all populated with somthing like 'long binary'

 

hopefully what I am asking is clear, if not let me know

 

Thank you

Download All
0 Kudos
Message 1 of 8
(4,245 Views)
Your VIs reference a database but the subject and the text of your message refers to a spreadsheet. They are not the same. Please clarify.

The block diagram shows a database write before any selection in the while loop. It is unclear to me what you want to do.
0 Kudos
Message 2 of 8
(4,215 Views)

You are correct, I intended to say database and not spreadsheet.  Is it in fact writing to a database

 

I would like to select an option from the drop down menu, (the selection populates other fields) and when the VI writes to the database have it include the populated fields in a column.  In theVI i have the 2 pieces of code seperate.  the 5 fields that get populated from the drop down VI I would like included in 1 column on the database

 

hope that helps clarify

 

thank you

0 Kudos
Message 3 of 8
(4,199 Views)

I suggest using a State Machine template for your design. Are you familiar with State Machines in LabVIEW?

You may consider using an event structure to detect a button being pressed, rather than polling it every 100 ms as well.

 

As a note, most databases are row-oriented structures; their insert functions will insert data as an entirely new row.

When you say you want to write the data to a column in the database, do you really need to write to a single column, or will writing the data into a new row be acceptable?

Nathan Murphy
NI C Series Modules Product Manager with an expired CLA
0 Kudos
Message 4 of 8
(4,169 Views)

Here is a copy of some sample data written to the database.  It titles columns and writes to them.

I would like it to be columns since everything else i have does the same.

 

I am not too familiar with database stuff so it could very well be row oriented and i wouldnt know it specifically.

so if it inserts each term in a new row that would be alright.  i think my wording is incorrect when i say columns

 

it is a microsoft access database

 

I do not know about slate machine or event structures.

 

 

 

0 Kudos
Message 5 of 8
(4,157 Views)

The data that you have displayed in the screenshot in the database is row-oriented. This means that the data is being input horizontally, spanning multiple columns. It appears that this is working fine. 

 

Your initial post said all you were seeing was "long binary" in the database. Have you tried writing other data types besides your cluster? What happens if you just write one integer, or a string? 

 

As a side note,

I highly recommend using the example finder that is built in to LabVIEW so you can become more familiar with the program as well as common design patterns. It is located in Help >> Example Finder. 

Nathan Murphy
NI C Series Modules Product Manager with an expired CLA
0 Kudos
Message 6 of 8
(4,117 Views)

Thanks and yes I do try and go through the examples as best I can and sample/learn from them.

 

I added an image of the database where it lists the long binary data. 

The way it lists is in the column which is why i made my assumption, but I can understand why it is row oriented.

 

My goal is still the same, to get my populated drop down lists to write to the database when running the program.  If there is an example for that please let me know.

 

surely someone else has done this before?

0 Kudos
Message 7 of 8
(4,097 Views)

You can find an example of inserting into a database in the example finder.

 

Example Finder >> Toolkits and Modules >> Database Connectivity >> Database Insert

 

I suggest starting here and adding your code on piece at a time, testing in between, to make sure that it is still performing the way you expect. 

 

From your last screenshot, it looks like your table is not being created properly. The Long Binary Data is the type that Access has assigned to that column, meaning that whatever data type that you fed it cannot be interpreted. I suggest creating a new table with the predefined column types that you are expecting. You may need to typecast your values (on the LabVIEW end, before inserting them) into strings to guarantee that what you are inserting is simply an ASCII string.

Nathan Murphy
NI C Series Modules Product Manager with an expired CLA
0 Kudos
Message 8 of 8
(4,081 Views)