02-21-2014 04:52 PM - edited 02-21-2014 05:12 PM
My question is twofold. First is there a way to tie in the channel number of an active channel (per the DAQmx Assistant or enabled with a boolean button) back to a "convert from Dynamic data" so that I dont have to manually change code everytime my channel configuration changes (see Fig 1). Sorry for the Icons, the snippet screenshot did that.
Second, is there a way to cleanup this snippet to be in a For Loop and link the in the number of active channels into N so that this bit of code is simplified and easier to read? I saw an example somewhere in the forums like in Fig 2.
I would appreciate explanation or examples. Thanks!
02-24-2014 10:10 AM
Im surprised nobody has responded. I'll ask again, does anyone have an explanation or examples to help me out?
02-24-2014 12:17 PM
Hi TEmran - When you say you're changing your channel configuration, are you changing the actual devices in your setup? If so, unfortunately there won't be anything you can do as far as tieing those channels in to the Convert from Dynamic Data nodes.
If not, you could try taking the (Waveform) array into an Index Array and then into Get Waveform Components in order to parse the array and retrieve the channel. I'm not 100% sure about this method but it might be worth a try.
As far as cleaning up your code, it looks like what you have provided in figure 2 will certainly work, although I'm not so opposed to your code's current configuration.
02-24-2014 12:25 PM - edited 02-24-2014 12:25 PM
@David-H wrote:
Hi TEmran - When you say you're changing your channel configuration, are you changing the actual devices in your setup? If so, unfortunately there won't be anything you can do as far as tieing those channels in to the Convert from Dynamic Data nodes.
If not, you could try taking the (Waveform) array into an Index Array and then into Get Waveform Components in order to parse the array and retrieve the channel. I'm not 100% sure about this method but it might be worth a try.
As far as cleaning up your code, it looks like what you have provided in figure 2 will certainly work, although I'm not so opposed to your code's current configuration.
While all my devices are 4-20mA instruments, they do change on a regular basis. For the sake of saving time and money, Id rather have one interface that I can manipulate to change my configuration each time. So far Ive had to manually change the code everytime channels and instruments change - which is a real hassle. Since I will be working with at least 15 channels on an upcoming project...Id like to streamline the code to be able to adapt it to N number of channels.
02-24-2014 12:42 PM
02-24-2014 12:45 PM
@Dennis_Knutson wrote:
Then don't use the DAQ Assistant.
How would you suggest I do it then? Can you give me an example?
02-24-2014 01:02 PM
In LabVIEW, go to Help->Find Examples. This will open the Example Finder. Do a search for "Voltage - Continuous Input" to find a decent example. It should be at least enough to get you started.
02-24-2014 01:08 PM - edited 02-24-2014 01:34 PM
Thats definitely not what I was looking for. I already know those examples (hence the reason why I have thus far gone with the DAQmx Assistant - its less cluttered). What I was asking is an example for measuring the 15 current channels and have them logging with different scales all at the same time, without cluttering my block diagram. Thats the whole point behind asking for input on the FOR loop.
This is what I was thinking in my head...but Im open to less complicated versions.
02-24-2014 02:31 PM
02-24-2014 02:44 PM - edited 02-24-2014 02:45 PM
You want something like this...