LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i write the data from the xy graph

Solved!
Go to solution

i want to write the values of x and y.....how can i do that........i have tried with the unbound cluster.but the wires were not connected.it tells that the dimensions are not same.why my xy shows 3 dimenssional array? it should be 2d array.

can someone help me please......:)

towhid

Download All
0 Kudos
Message 1 of 16
(7,461 Views)

I can't see your VI 'current measurement.vi' because LV2009 but 'Bar Plot.vi' is ok...

 

Why don't you use the direct build by Bundle function?

 

GraphXY.jpg

 

Arrays of constant are to replace with your data. 

0 Kudos
Message 2 of 16
(7,440 Views)

thanks for the reply.i want to save the data obtained from the graph.so i need to write the graph in a write spread sheet file or text format. in the current measuring vi.....i used a daq card and measured the currents.i have plotted the no.of channels vs the measured current data in a bar graph.so i need to record the datas i obtain from card that means from the graph.i have tried to write it but i cannot connect the pink wires to the write file option.

 

it is the similar as the bar graph.i want to save my x&y vaues from the graph.

how can i do this.

towhid

0 Kudos
Message 3 of 16
(7,432 Views)
Solution
Accepted by topic author towhid113

Normal, 'Write to Spreadsheet File.vi' required a simple 1D or 2D array as entry and not a specific type as cluster (because XY graph is a cluster).

 

So, considering your [X] data are the same for each [Y], you could build an 2D array of your data to use it (by implementing 'Build array' with [X] & [Y]).

 

 GraphXYAndRecord.jpg

 

 

 

If it's not the case (same [X] for all [Y]), you will need to proceed with other method => 2 files or custom text conversion before writing.

 

 

Message 4 of 16
(7,426 Views)

thanks for your solve.

but another problem is that...suppose i need data in the form (x,y)

i mean here it is not possible to write the data in this form

0 Kudos
Message 5 of 16
(7,369 Views)

actually i got the voltage from 5 different channels using Ni DAQ and showing the graph in a number of channel(horizontal axis ) vs voltage(vertical axis).so i plotted this in a xy bar plot.now i want to write the voltage datas in a file. i have five channels and five voltage datas which varies always(its not a static voltage).so i want to write this datas in a format (number of channel,voltage)for five channels and a series of voltage datas.it may be like this:

1                     2                  3                 4                 5(these are the no of channels)

1.4                 1.2               1.78             1.5              2.1

2.3                 2.5               1.3               0.9              2.2

14                  21                10                5                 13(these all are the voltages)

i want to write in this way.

pls someone help me.

   

0 Kudos
Message 6 of 16
(7,367 Views)

It's the same case as previous but make a double access to file in order to start with the channel name or number then write voltage with append option.

 

 WriteVotageAndChannel.jpg

 

In this example, i write String as channel number but because the function is polymorphic, you could write a simple interger too. 

 

The problem with this function 'Write To Spreadsheet File.vi' native to LabVIEW is that you can not manage error and if you have an error to the first call, you probably have the same to the second. So, insert a parade : a function to know if the file exists. it's a primary test to know if there is no problem with the first call.

 

 

 

But if you need to read it don't forget to ignore the first line as voltage data.

 

 

 

Message Edité par J.DECHET le 01-20-2010 02:47 PM
Message 7 of 16
(7,353 Views)

 

and i also need to add a command,like a boolean button.so that i can press the button and then start writing the file.

can you please add the vi also.

please

0 Kudos
Message 8 of 16
(7,329 Views)

but the problem is that,i want the data as a format as follows

1                     2                  3                 4                 5(these are the no of channels)

1.4                 1.2               1.78             1.5              2.1

2.3                 2.5               1.3               0.9              2.2

14                  21                10                5                 13(these all are the current values)

 

and so on

 

i want to write in this way in a spreadsheet or in a write to measssurement file.vi

any of the format.writing is my only problem

pls someone help me.

0 Kudos
Message 9 of 16
(7,307 Views)

I hadn't the VI any more but I just do it again, see attached file.

 

So, if I understand, it's a problem of format => add %#.1f as format entry to have 1 or none digit of precision, %#.2f to have 2 or none, etc...

 

But when I see your attached image, you use another method (by Express) and you seem to be near the soluce, aren't you?

 

 

0 Kudos
Message 10 of 16
(7,297 Views)