LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine a boolean val with double array and send to mixed signal graph?

Ok, so I've got a bunch of analog I/O that I'm trying to chart, but I also want the boolean state of when an output is turned on and off on the same chart.

 

I've tried everything I can think of, from converting the bool to a 0,1 and then multiplying that value by something so it becomes a double and then trying to combine that with the main analog array but I cant get that to work.

 

Now I'm trying to send the plain boolean value and the analog array to a bundle function, and then send that to a mixed signal graph, but the mixed signal graph is not happy.

 

Any help is greatly appreciated. See attached VI

0 Kudos
Message 1 of 5
(1,168 Views)

@David99999 wrote:

I've tried everything I can think of, from converting the bool to a 0,1 and then multiplying that value by something so it becomes a double and then trying to combine that with the main analog array but I cant get that to work.

 


Graphs don't typically like scalars, so try this:

 

altenbach_0-1614711513955.png

 

 

(Still, I never use the mixed signal graph and can't help you much more. While it fixes the broken wire, I am not sure the result is what you want. If you look at the example, it typically is happier with waveform datatypes. There are probably better alternatives.)

0 Kudos
Message 2 of 5
(1,154 Views)

I appreciate the response. So I tried your method but modified it a little to just go into a waveform chart. Accept now my data is funky. I think I screwed up the way the cRIO is scanning the physical i/o? It's oscillating badly for some reason....see attached screenshot and VI

Download All
0 Kudos
Message 3 of 5
(1,134 Views)

I don't understand what you are doing with the Reshape Array.  It seems like a hack to get the first 6 elements of your 1-D array coming through.  Perhaps you should be using Array subset, then building on your scalar to the end of that array.

 

Your chart shows data, zeroes, data, zeroes.  If you put an array indicator on that 2-D array before it goes to the chart, I think you'll see all these extra zeroes.  You can then try to figure out why they are there.  (Probably because of what I pointed out in the first paragraph.)

0 Kudos
Message 4 of 5
(1,116 Views)

We cannot really help because we don't know how the data looks like. Can you replace your shared variable with some typical simulated data, for example?

 

I agree that your "reshape function" is incorrect and there are quite a few questionable code construct beginning with maximized front panel and diagram (sigh!). What's the purpose of the sequence structure? You are creating a 2D array with one row and 6 columns which is fine for the chart, but appending a 1D array will add a row (padding with zeroes) while you want to append a columns with one element. I recommend to create a tiny test VI where you play with just the input to the chart. Why don't you place a plain array indicator on the wire going to the chart to see how it looks like? You'll probably be surprised.

 

altenbach_0-1614728673871.png

 

Maybe something like the following would work better?

 

altenbach_1-1614728977646.png

 

 

0 Kudos
Message 5 of 5
(1,111 Views)