LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to select the specific channels attached to specific "create virtual channel"

Solved!
Go to solution

Dear LabView user,

 

I've made a program to acquire data from a LVDT, a forcecell and a strain gauge. I 've made it so that I can add multiple LVDT's and multiple gauges... So there can be 1 voltage task and 1 strain task, but also multiple voltage tasks and multiple strain tasks...

 

The problem now is, I want to show these data on 3 different graphs, each task would have it's own graph. But unfortunatly I'm not able to select which graph should show which task. I've tried to do this with index, it went good for when i had 1 of each sensor connected, but when i attached an extra LVDT sensor, so an extra channel, the sequence of my graphs moved up, and there were only 3 channels showing up instead of 4. I wanted to show the data of the 2 LVDT sensors on 1 graph , and another graph for the forcecell and another for the strain. 

 

Is there a possibility to filter the tasks so i can select on which task the graph should work?

 

I've attached my program.

 

With kind regards, 

 

Peter

0 Kudos
Message 1 of 35
(5,578 Views)

Here's what you want I think:

3Graphs Consolidated.png

 

You can use the index array to pull each element in order if you want instead of how you had it before. The order always starts at zero and counts up unless you wire something else in to the index terminals.

Alternatively you could do this:

3Graphs Consolidated Indexed.png

 

If you have a 2nd task that you're pulling data from, you can pull that along side the analog input VI that's already there and just build an array with that value as well. The waveform charts will always take in a single plot, or an array of plots.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 35
(5,546 Views)

Dear James,

 

Thank you for the fast reply.

 

But the thing is, my program should made it possible also to use like, for example, 4 LVDT's and 8 Strain Gauges. Also the physical channels are chosen by an unknown person, so he could choose ai0 for the input channel, or he could choose ai5 or ai6, you understand? The physical channels will be selected randomly, and the number of sensors too. Is this possible?

 

Kind regards,

 

Peter

0 Kudos
Message 3 of 35
(5,529 Views)

HI Peter,

 

yes, that's possible.

All you need is to program your own selection routine, which works based on the user settings…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 35
(5,526 Views)

Dear GerdW,

 

How do I do this? What do you mean with selection routine? 

 

 

Kind regards,

 

Peter

0 Kudos
Message 5 of 35
(5,524 Views)

You see how I have multiple indices wired in to the Index Array VI in the snippet above? You could come up with a selection algorithm to adjust those indices accordingly. We can't help you much there because we don't know how you are going to be changing your channels around. If it's a user input, you could pull the input values. If it's a hard-coded arrangement, you could just leave it like I have it above.

Here's one arrangement where you could have those array constants I made be replaced by actual user inputs, or information from somewhere else:

3Graphs Consolidated Multiple Indices.png

 

Your own personal selection routine would be what decides those array inputs.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 35
(5,498 Views)

Dear,

 

Thank you for this information,

 

but this still doesn't work... If I put 3 LVDT's, the first one will show on the first graph, the second one on the second graph and the 3th one on the 3th graph, the PC and the Strain Gauge are not shown on graph then... I need to combine the unknown amout of LVDT sensors into 1 graph, the same for the other sensors...

 

Isn it possible to select: graph 1 only needs to show the data comming from the first 'create virtual channel vi" and all of his inputs , the 2nd graph needs to show data comming from the 2nd 'create virtual channel vi" and the 3th needs to show data cammong from the strain gauge "create virtual channel vi" ?

 

 

With kind regards

 

Peter

0 Kudos
Message 7 of 35
(5,477 Views)

It looks like you have an array of inputs by the user. You could use this array information to know which channels are going to which chart.

 

If the LVDT array is size 3, pull the first 3 channels for that chart. If the PC array is size 2, pull the next 2 channels for the PC chart, and so on...

 

You can only have one task per device, so you'll need to split the channels from a single task. The ay your code is cucrently set up, you are adding all of the channels to the same task.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 8 of 35
(5,470 Views)

Dear,

 

It is possible to use 2 input channels for 1 task, no? Or you mean it isn't possible to do the voltage task and the strain task on the single module?

 

How do I do this? Can you show me an example maybe?

 

With kind regards,

 

Peter

0 Kudos
Message 9 of 35
(5,465 Views)

The Waveforms will have an attribute named "NI_ChannelName" so you could check each waveform in the array to pick out the desired channel. Or you could access the array of Physical Channel names from your Virtual Channel using a "DAQmx Channel" property node (General Properties: Physical Channel Name) and unflatten the string list using DAQmx Unflatten Channel String

0 Kudos
Message 10 of 35
(5,410 Views)