LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string/wire issues

Hello all,

 

I know there must be ways to convert these wires into the proper types of data, but I can't seem to find the solution.

I want to change the BG color of the indicator based on a value set by the user.

There is one channel indexed out of 64 I'm playing with right now, but eventually I need to set this up for each channels indicator.

convertingwiretypes.PNG

 

Thanks!

 

0 Kudos
Message 1 of 16
(3,033 Views)

Maybe I've solved my own problem?

convertingwiretypes.PNG

0 Kudos
Message 2 of 16
(3,025 Views)

Hi there,

 

It looks you have used "build cluster array" just because it works, not because you actually need the clusters. When you take max & min of two arrays, you get a new array per the help file:

When you compare arrays in Compare Elements mode (default), this function compares corresponding elements in each input array and returns the element with the maximum value.

It seems what you actually want is a single value to see if it is above your "threshold". So you should use array max & min to reduce the array to a single maximum value. From your diagram, you would then build those 4 values into an array, which you index with your channel in.

 

Hint: It will not be good to extend your program to 64 DAQmx reads and indicator updates. You should instead build an array DAQmx steps and run through them in a For Loop. For the indicators, you can create an array of references that also go through the For Loop, or create a table where the background of each cell can be colored individually.

Message 3 of 16
(3,024 Views)

You could get rid of the build cluster array, and replace it with a build array. Although you are then comparing an array of values to a single value, which will return an array of booleans. What do you want to compare? The threshold to the max/min in the array? The threshold to the average of the array? (Nevermind, I just realized each element is a different channel reading)

 

Also, why are you using the max/min on the data thats on the shift register? Once you have crossed the threshold, you will never go back below it because the only new data that would get passed to your threshold check has to be greater than the previous data set. 

 

Edit - I you are doing this for each channel, why bundle each array together at all? You are simply bundling them to unbundle them, no?

Message 4 of 16
(3,023 Views)

I just saw your post in message 2 of 3. At first I thought each "channel" was each of your DAQmx tasks, but now it looks like each task contains 16 channels? (I took your 64 total channels divided by 4 tasks). If that's the case, then your solution with a cluster may be just what you need. 

 

Message 5 of 16
(3,020 Views)

I don't know guys, I'm not a "real" labview programmer lol I just kind of put things where they fit, ask for help if they don't and hope everything works out in the end...

 

My mind is a bit boggled by how I should change bg color for all 64 of these channels, is there an easier cleaner way of accomplishing what I'm trying to do here?

 

Unfortunately I think I have to use single indicators for each channel because there position will be in an order that reflects where the physical positions of the TC's are (can't use a table).

 

The VI actually runs now, but it's horribly slow(attached)

0 Kudos
Message 6 of 16
(3,007 Views)

@paul.ross

 

I do actually want the indicators to remain red for the duration of the VI run if they pass the "threshold"

 

I was bundling them to make things more compact? I also want to put all these readings in a table and data log them later on, after I get this color problem sorted out.

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

 My question regarding the bundling - I may be misunderstanding what you are looking to do. If I am understanding correctly, you want to have an indicator on the UI for each data channel, correct? And for each of those channels, you want to evaluate if the value has crossed the threshold? You are just using the channel control to index the array for test purposes now, right? If that is the case, you are doing an extra bundle that you don't need to do.

 

 

Do you want to log ALL the data readings, or just some of it? 

 

 

0 Kudos
Message 8 of 16
(2,995 Views)

It sounds like you are developing an application with enough features that you should take a step back, and spend a little time learning some LabVIEW fundamentals. This will save you time in the long run, and you will end up with a much better application - learn about producer consumer architecture, and look at some of the project templates, including the one for the hardware acquisition and logging. 

 

I would put all the hardware acquisition in its own loop/submodule, and I would have that send the data it acquires out to whoever wants it - in this case a module that evaluates if its in proper range, and a logger. You could potentially make this all one subvi - with three loops, one for each major function. Then your main application would have 4 of these SubVIs running in parallel on the main block diagram.  

0 Kudos
Message 9 of 16
(2,991 Views)

@paul.ross

 

Yes, the unbundling and indexing is just so I can get the bg color working for one index right now. I don't know how I would begin to do it for all 64 indicators.

 

I'll data log some of the readings(take 1 reading of all channels at the same time once per minute) and log all the timestamp/tc readings for a duration of several hours.

 

But before I do that I really should clean up this while loop. Do like you suggested and have it just supply readings from the modules. Then I can start building things/features that use that data

0 Kudos
Message 10 of 16
(2,977 Views)