02-27-2017 02:13 AM
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
Solved! Go to Solution.
02-27-2017 12:26 PM
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:
Bob Schor
02-28-2017 02:31 AM
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.
02-28-2017 06:10 AM
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).
02-28-2017 07:38 AM
OK. Here is some code to do the following:
As I mentioned before, you do need the Report Generation Toolkit for this ...
Bob Schor
03-07-2017 03:59 AM - edited 03-07-2017 04:22 AM
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.
03-07-2017 07:08 AM - edited 03-07-2017 07:12 AM
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: