LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to connect 1D array of long with cluster of elements

I have two following questions:

 

Q1: I have two SubVIs inside a While loop. SubVI "A" and SubVI "B". I want to connect SubVI "A" with SubVI "B". SubVI "A" has output 1D array of long and SubVI "B" has input cluster of 3 elements (Please see attach image). Can any body guide me how to do this?

 

Q2: SubVi "B" has output in the form of double precision and since it is inside While loop its value is continously changing. I want to save all its values. Can any body guide me what should I do so that all values generated by the double precison output can be saved in a txt or spreadsheet form?

 

Regards

 

JK

 

 

N19_14.jpg 

0 Kudos
Message 1 of 9
(4,539 Views)

@josephkirmani wrote:

 

Q2: SubVi "B" has output in the form of double precision and since it is inside While loop its value is continously changing. I want to save all its values. Can any body guide me what should I do so that all values generated by the double precison output can be saved in a txt or spreadsheet form?

 

 


Post your VI of what you have attempted so far. 

0 Kudos
Message 2 of 9
(4,531 Views)

@josephkirmani wrote:

I have two following questions:

 

Q1: I have two SubVIs inside a While loop. SubVI "A" and SubVI "B". I want to connect SubVI "A" with SubVI "B". SubVI "A" has output 1D array of long and SubVI "B" has input cluster of 3 elements (Please see attach image). Can any body guide me how to do this?

 

Q2: SubVi "B" has output in the form of double precision and since it is inside While loop its value is continously changing. I want to save all its values. Can any body guide me what should I do so that all values generated by the double precison output can be saved in a txt or spreadsheet form?
 


Q1:  What is the format of your cluster?

 

Q2:  Look in the File IO palette.  You will want to open/create the file before you look, write the data inside the loop, and close the file after your loop.  If you watn to save the data to a tex file, then you will need to format the data into a string and then write to a text file.



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 3 of 9
(4,514 Views)
  • Include code whenever available.  Asking somebody to troubleshoot your software without any code is like asking your mechanic to fix your car without taking your car to him.

Source

 

Beyond that here is my advice.  An understanding of what the data represents is important, and knowing this will likely answer your question for you.

 

Lets say you have a single analog reading of 5 volts.  This is a scalar double.  Now you want to graph it so you grab the Waveform Graph and put it on the front panel.  But when you wire your 5V reading to the graph it says you need to provide a 1D array.  This makes sense when you realize the graph is intended to display many values at once, not just one value.  This is why it wants an array of values to put on the graph all at once.

 

This example doesn't fit exactly in what you are doing.  But my point is that if you know what your data represents, putting in into the format needed will become obvious.  Lets say you connected an array of data points.  That array can change size, it is (practically) and unlimited size from 0 to infinite elements.  Now you are wiring it to a cluster of three elements.  What are these three elements?  Are they a string "Computer Name" a string "User Name" and a numeric "Voltage" well then that tells you te type of data it needs.  So convert your 1D array of numbers into those 3 elements.  How?  Well that depends on what the data is and what it represents.  This is information that only you can know.  Posting those subVIs will help us, but still you should know what the output of A is and what it represents, and the inputs B wants and what it represents.

Message 4 of 9
(4,502 Views)

My VI is attached below:

0 Kudos
Message 5 of 9
(4,482 Views)
  • Include all subVIs, typedefs, global variables, project files, and any other files you made to run the VI.  Do not just post the project file, this has no source, and will be of no use without the rest of the files.

Source

 

You didn't include any of the required subVIs.

0 Kudos
Message 6 of 9
(4,473 Views)

ALL SubVIs are included. 

0 Kudos
Message 7 of 9
(4,465 Views)

Still missing a subVI (subDCOffset.vi).

 

But from what I could figure, you need to convert the read data into complex data type.  Somewhere in your documentation for the unit you are trying to test or communicate with, there should be a definition of how to convert the binary words you captured into this complex data type.  This usually involves a gain and offset.



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 8 of 9
(4,454 Views)
0 Kudos
Message 9 of 9
(4,448 Views)