LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone please just tell me the steps to take to build a VI that output data collected from a sensor on a table created on the front panel?

Solved!
Go to solution
Solution
Accepted by GRC5000

@GRC5000 wrote:

Hi cbutcher,

Thank you, but what is the name of the block in the for loop right on top of the "number to fractional string function" block. I want to copy what you did and simulate it to check if it's working, but I do not know where to find that block or can you please attach a VI?

Thank you.

 


I was about to say it was a VI Snippet and you could drag it into the block diagram, but I see it was not!

Apologies. I suspect by now you've already recreated the diagram (with help from others in the thread) but here is a VI backsaved for 2015 just in case.


GCentral
Message 11 of 16
(980 Views)

Ok, so now you'd like to place data in a table (which is a Control/Indicator for string data) according to some csv file. Is that right?

Note that unless you actually want to store and use String data, you might be better with a different datatype (e.g. numerics, like double, unsigned integer, etc)

 

You already have code that reads the csv file into a String array. From there, you'd need to combine your two columns piece by piece (because LabVIEW builds rows before columns) and wire the output into your table.

Note that naming two separate controls/indicators with the same name doesn't make them share data! You need to connect the same data to each using a wire if you want them to have the same data 🙂 

Spoiler
Technically, there are lots of other ways to have two controls or indicators share a dataset, but here your problem is that you have a display in one indicator and a separate control providing data for your next step

Once you've wired the actual data into the indicator, you should be much closer.

Then you can work through ensuring the right orientation (rows, columns).

I suspect you'll need to use either a For loop or Transpose Array (or neither, depending on how you structure your code).


GCentral
0 Kudos
Message 12 of 16
(983 Views)

Cbutcher. You are the best!!!!!! I want to be like you one day. That's my dream.

0 Kudos
Message 13 of 16
(964 Views)

I want my table to look like this:

Capture.PNG

I keep getting this below every time I run the VI. Can someone please help me solve this problem? I attached my VI and my .txt file

Capture.PNG     

My goal is to assigned random number to RPM, torque, CO2, speed and these 4 are from .txt file

P.S: I am new to labView

Download All
0 Kudos
Message 14 of 16
(999 Views)

Hi again GRC.

 

I know this has already been suggested a few times, but I also believe you could probably save yourself some difficulty by reading through some of the available training materials linked at the top of the forum.

Those materials (particularly anything about For loops, arrays, and tunnel modes) might help you identify the issue you're having here.

 

To get you started, I'll suggest that you right click on your Read Text File node and choose to "Read Lines". This will give you an array of strings, one per line in the text file. It's likely that will be easier to work with to accomplish what you want.

 

After you have that part working, you need an array of random numbers. At present, you're creating/generating a single random number and passing that value into the array, where it is used for each iteration. You instead want a new value each iteration. If you're not sure how to do this, I encourage you to think about how often you want a new random number 🙂

 

Good luck.

p.s. we usually type LabVIEW, when we're being picky 😉


GCentral
0 Kudos
Message 15 of 16
(992 Views)

Show to column and row headers and fill them in first (via property nodes) then just throw the rest of the data at the table.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 16 of 16
(948 Views)