LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

saving data into file

Hi,

 

I can not save my pressure data into notpad file in a correct format such as it must be in three columns for pressure 1 (P1) and pressures 2 and 3.

 

Also I do not want the character denoted with red color i.e., [1,0,0].

 

I want all data for each pressure, for example 100 data, in the same column without any charater or blanks for each pressure data.

 

Could you please help me for this basic and easy problem? (but it is too hard for me:))

 

I attached the program file, and also pictures of program and data output in notpad.

 

 

Download All
0 Kudos
Message 1 of 5
(2,616 Views)

The first thing that jumps out to me is that you are inserting P2 and P3 into array P1 using the Insert Into Array function with a constant 1 wired to the "Index Row" input. If you switch this to the "Index Column" and insert P2 into array column 1 and P3 into array column 2. This should allow each row to contain the corresponding data point from each array. 

 

Give this a try and then let us know what other problems still exist. 

 

 

Regards, 

 

Mike Watts
Applications Engineer
National Instruments
http://www.ni.com/support

Regards,

Mike Watts
Product Manager - Modular Instruments
Message 2 of 5
(2,574 Views)

Dear Mike Watts,

 

We thank to you for your reply and help. We have almost succeeded the program. However there is a bit problem such that we do not the terms [0, 0, 0], [1, 0, 0], ....etc in the text file as I attached you.

 

Could you please help me for this problem.

 

Best regards,

Download All
0 Kudos
Message 3 of 5
(2,546 Views)

The reason why the [X, X, X] indices are showing up is because you are using the Array To Spreadsheet String function with a 3D array. If you reference the Array To Spreadsheet String function's help documentation linked below, you will see more information regarding this. I believe that you expect a 2D array as a result, but if you keep an eye on array dimensions, you will see that you are ending up with a 3D array. If you have context help open, you can hover over wires to see their data type and size of arrays. I believe that one of your dimensions is not really being used, because it seems to only have 1 element. I would take a look at your code step-by-step and compare what you expect to what you get, for both values and dimensions.

 

I hope this helps some.

 

Array To Spreadsheet String Function

Regards,

Mike Watts
Product Manager - Modular Instruments
0 Kudos
Message 4 of 5
(2,488 Views)

Yet another case where th DDT fails to make sence.

 

OK You bring in 1D arrays to the smothing filters,  Why try to convert them to 2D arrays coming out?  If you look closer the DAQmx task is 4 Chanels single sample!  which for some strange reason you are also casting to a 2D array! TWICE. (Really, once would be enough)  This makes very little sence since you need an array for your filters to work.

 

As far as all the math goes- Why not just apply a scale to each of the DAQmx Channels? 

 

Here is you vi slightly re-imagined.

!0.png

We won't go into why you would miss-use a while loop as a for loop.  You have bigger issues.


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,476 Views)