LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Smart naming /updating multiple nodes + data output

Solved!
Go to solution

Hoping someone can help me with this problem of naming and updating different nodes, attached is the old code that i have picked up and need to update but i am struggling to find a smarter way of being able to change each thermocouple (as these change name on every test) and display the appropriate headed raw data in excel, currently we also then copy and paste the data into excel and make a graph so we can display temperature / Current clearer. At present this process is pretty long and tedious, can anyone help with making this nice and slick, i would appreciate it greatly.

 

Thanks in advance,

Martin

0 Kudos
Message 1 of 7
(3,006 Views)

I'm not certain I understand what you want to do, or what you see as the "problem".  You mention Excel, but I'm not sure whether Excel is being used to read data, write/save data, or both.  So these comments may be "wrong-headed", but here are some semi-random thoughts:

  • Repetetive things are much easier to do in an Array.  I would take the Channel Names cluster, do "Cluster to Array", then feed the Array into a For loop where you set Active Plot from the Loop Index and Plot.Name from the Array input.
  • I would definitely use DAQmx and get rid of the Dreaded DAQ Assistant and its Evil Twin, the Diabolical Data Wire (who doesn't love alliteration?).
  • If you need links with Excel (and data files with the extension .xlsx or .xls), I highly recommend the Report Generation Toolkit.  It's an "add-on" component in LabVIEW 2013, but in LabVIEW 2015 and later, it is included in the Professional license.  The RGT is (reasonably) fast (at I/O), reasonably full-featured, and reasonably easy to program.  [My definition of "reasonably" means "with a little help, if needed, you should be able to do most things".]

Bob Schor

0 Kudos
Message 2 of 7
(2,969 Views)

Hi Bob, sorry if not that clear, the general problem is that although i can display all of these temperatures on the graph at the same time it seems bit of a fudge as the data exported will not have the heading of the updated thermocouples, currently i have to manually update the data headings in excel, i can not seem to find a way of having multiple displays on a graph with editable names that then also exports the data with those headings into Excel.

Attached is the data output that i currently have. 

0 Kudos
Message 3 of 7
(2,961 Views)

Not directly related to your problem, but you only need 1 task/DAQ Assistant.  You can also have DAQmx apply your voltage scale for you.  Simple things to make your life easier.

 

As far as the data logging, it is using the names from the DAQmx Tasks that you defined in the DAQ Assistant.  You can update these names using the Set Dynamic Data Attributes function (use a FOR loop to make it easier on yourself).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 7
(2,943 Views)

OK.  Here is some code to do the following:

  • Generate a set of headings, "TC #1, TC #2, ... TC #10" and save these in the Cluster "Channel Names".  Note I create an Array of these names then stuff them into the Channel Names cluster.
  • Take my Cluster and turn it (back) into an Array.  Note that if I don't need the Cluster, per se, I can simply leave my Array (in the previous step) as an Array.
  • Generate some "random data", 6 rows of the "number of columns in Channel Names".
  • Open Excel, write the data in a Table with Column Headers specified from the Channel Name strings, save the Excel file as an Excel file, and exit.

As I mentioned before, you do need the Report Generation Toolkit for this ...

 

Thermocouples in Excel.png

 

Bob Schor

0 Kudos
Message 5 of 7
(2,938 Views)

Thanks for reply i have tried this method but my main difficulty is that i need to be able to manually type in each heading on the front screen, that changes with every test, and to then have that data displayed on the graph and exported into Excel currently i just have Temperature 1- 10 in Excel. 

 

I think the problem lays at the signal output array (this gives a list of the temperatures) which has no link to the names being updated, its all bit of an old fudge i am sure there is a smoother way of doing this, just unsure how.

0 Kudos
Message 6 of 7
(2,868 Views)
Solution
Accepted by topic author MagpieSwift

Hi MagpieSwift,

 

i have tried this method but my main difficulty is that i need to be able to manually type in each heading on the front screen, that changes with every test, and to then have that data displayed on the graph and exported into Excel

You have been told to use the SetDynamicDataAttribute function. And you have been told to use a FOR loop to name your 10 signals easily/efficiently.

Have you tried any of this?

Once you have set the signal names the datalogging and the graph will use them automatically!

 

Example:

check.png

Best regards,
GerdW


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