LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transform string into live table and save in Excel

I am struggeling to find the correct way of structuring my string in order to properly display it in a live table and in an excel table. How it is currently looking can be seen in the pictures. How the string looks like before entering the tables can also be seen in the picture.

The goal is to have the time in the first section, then the number, the unit and so on. The next part should be in a new row. 

Edit: whole Blockdiagramm added

Block Diagramm full.jpg

How it currently looks:

Frontpanel 

InkedLabview aktuelle Anzeige.jpg

Excel 

Labview aktuelle Excel-Ausgabe zugeschnitten.png

 

What it should look like: 

Excel correct.png

0 Kudos
Message 1 of 11
(3,216 Views)

Please attach your actual VI instead of some truncated pictures with wires flowing in all directions.

 

Where is the data coming from? What is the structure of the incoming string?

 

A table is just a 2D array of strings, so if it should be built-up row by row, you need to accumulate the data in a shift register.

 

Your file IO will not happen until the loop ends. What triggers that?

0 Kudos
Message 2 of 11
(3,190 Views)
Hi Tilto,
Can you attach a VI with the data (you can save it in a 2D array of strings as a constant or as a control saved with default value)?
If I understood correctly, neither of the images of the tables are what you are looking for. Can you attach an example of what the table should look like?
0 Kudos
Message 3 of 11
(3,186 Views)

The incoming string looks like:

Time Number Unit

Number Unit

Number Unit

Number Unit

 

Or as seen in the picture of the frontpanel, the indicator shows the string in the small grey rectangle

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

@Tilto123 wrote:

The incoming string looks like:

Time Number Unit

Number Unit

Number Unit

Number Unit

 

Or as seen in the picture of the frontpanel, the indicator shows the string in the small grey rectangle


You will not get reasonable help by showing pictures of text. We cannot see the delimiters and other hidden characters. We cannot see your program architecture if you show disconnected code fragments.

 

Instead of concatenating all strings, then converting that ever-growing string into a table, just parse each new part and built it into a 2D array for the table. Much more efficient! Only the table data should be in a shift register. Why is there so much duplicate code?

 

Doesn't your string have a termination character? "Bytes at port" is probably not the best tool here.

 

Again, attach your VI and make sure a typical string is included as diagram constant or control default value.

0 Kudos
Message 5 of 11
(3,165 Views)

Sadly i was not able to answer as i was limited to 2 posts in 24 hours. I am getting a string looking as follows. That string should be written into a Live table/excel table while the \s is used to determine what should be written into a single field.

 

14:24:18.20\s+000.07\sbar\s\s\s\s\s\s\s\s\s\s\s\s+0023.6\s\B0C\s\s\s\s\s\s\s\s\s\s\s\s-000.04\sN\s\s\s\s\s\s\s\s\s\s\s\s-000.03\sN

 

The goal is to get rid of the multiple \s and only have a single \s instead after the time, each number and each Unit. 

 

By "attach your VI" u mean uploading the actual file or is the screenshot fine?

Sorry, english isnt my first language

 

 

 

0 Kudos
Message 6 of 11
(3,088 Views)

Hi Tilto,

 


@Tilto123 wrote:

The goal is to get rid of the multiple \s and only have a single \s instead after the time, each number and each Unit. 


See this:

 


@Tilto123 wrote:

By "attach your VI" u mean uploading the actual file or is the screenshot fine?


What do you think is more helpful?

Would you enjoy of downloading my VI or do you enjoy looking at that image I included in this post?

(Would you bring a photo of your car to the garage when you want your car to be repaired?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(3,085 Views)

@GerdW wrote:
(Would you bring a photo of your car to the garage when you want your car to be repaired?)

Sometime the car problem can be fully identified from a picture 😄 (... same for certain LabVIEW diagrams!)

 

altenbach_0-1619056360492.png

 

 

Message 8 of 11
(3,068 Views)

In this specific case I would call the garbage disposal and ask for a new car! 😉

 

(I hope that isn't one of those T**** cars with big electrochemical energy storage called battery inside that fireball…)

 

Btw.: Crosspost warning (same question in German LabVIEW forum)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(3,053 Views)

@GerdW wrote:

(I hope that isn't one of those T**** cars with big electrochemical energy storage called battery inside that fireball…)


Well, a T with about 2-3 gallons of gas worth of battery storage is probably preferable over a Pinto with factors more. 😄

0 Kudos
Message 10 of 11
(2,000 Views)