07-01-2015 12:30 PM
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
Solved! Go to Solution.
07-01-2015 02:55 PM - edited 07-01-2015 02:57 PM
Here's what you want I think:
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:
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> ---'
07-01-2015 03:42 PM
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
07-01-2015 03:46 PM
07-01-2015 03:48 PM
Dear GerdW,
How do I do this? What do you mean with selection routine?
Kind regards,
Peter
07-01-2015 04:10 PM - edited 07-01-2015 04:11 PM
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:
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> ---'
07-01-2015 04:31 PM
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
07-01-2015 04:48 PM
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> ---'
07-01-2015 04:55 PM
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
07-01-2015 08:06 PM - edited 07-01-2015 08:06 PM
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