06-23-2015 08:59 AM
Actually I am going to have differnt max and min values for better accuracy. But if you see the express VI properties than also I am getting only 16 rows.
06-23-2015 09:10 AM
@andy_kennaugh wrote:
Actually I am going to have differnt max and min values for better accuracy. But if you see the express VI properties than also I am getting only 16 rows.
Oh you're right I think you can add more tasks as long as it hasn't started yet which yours hasn't. Could it be because you are trying to reserve the hardware in two places? Do you only run the express VI or only run the top code? Attached is one that I think should get all your analog signals and return them as a waveform to be displayed.
Oh and a project is a great thing for organization. It's strange how other programming languages a developer would never start coding without a project.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-23-2015 09:19 AM
06-23-2015 09:24 AM
Hmm...I am able to get all the voltages in the waveform chart but not as cluster elements. Is there any limit to number of elements in a cluster.
And I am not a programmer I am a 2nd year mechanical engineer working on a model gas turbine testing rig.
06-23-2015 09:28 AM
When you go from an array to a cluster you must define the size of the cluster to make. You right click the array to cluster and pick the size. Yours is set to 16. But a better solution is to not deal with clusters at all but instead use arrays, like the waveform, or 2D array of data. It scales better.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-23-2015 09:30 AM
how will I pass physical channels in a for loop for differential input, my card is PCI 6255 having 80 AI channels.
06-23-2015 09:36 AM
How do I get rows seperated assuming each channel is a row the only way I figured out is using clusters. You seem to suggest making rows as 1D arrays. How can I do that?
06-23-2015 09:45 AM
06-23-2015 12:09 PM - edited 06-23-2015 12:17 PM
@Hooovahh wrote:
@andy_kennaugh wrote:
Actually I am going to have differnt max and min values for better accuracy. But if you see the express VI properties than also I am getting only 16 rows.
Oh you're right I think you can add more tasks as long as it hasn't started yet which yours hasn't. Could it be because you are trying to reserve the hardware in two places? Do you only run the express VI or only run the top code? Attached is one that I think should get all your analog signals and return them as a waveform to be displayed.
Oh and a project is a great thing for organization. It's strange how other programming languages a developer would never start coding without a project.
I see nothing inherantly wrong with the disabled code in Hooovahs edit. OK the Channel List could easilly be "Dev1/ai0:7, Dev1/ai16:23, Dev1/ai32:39"
Now lets get some terminology corrected here about DAQmx Stuff:
BUT! you can't "Use" a "Verified" Task. Verfied simply means the hardware can be found with those capabilities even if someone else is currently using those hardware resources. So before we can go any farther the Task must be "Reserved" Again, We know the hardware exists so Reserving simply obtains an exclusive lock on the needed hardware resources. If some other Task has any needed resource reserved DAQmx throws an error.
So you think the Task is good to go at this point? We have Hardware Capabilities and a lock on the harware we need right? Not quite. Just because we have exclusive access to existing hardware doesn't meen the Hardware is "Spun up" There may be some things needed yet (Clocks started, Gains set...etc) So the next step is to "Commit". If Some fault occurs spinning up, DAQmx throws an error (And you are probably sending the device in for repair)
Now we are good to go! "Start" the Task and it transitions to the "Run" state and starts doing its job. In the case of a AI Contioneous Task it will run until either: It is Stopped or an error occurs. Errors like Buffer Overflow, or Timeout happen when your sample rate and reads don't make any sense. Occasionally, some engineer screws up and applies a signal that causes the device to catastophically fail (Try to avoid that OK?)
All of these State transitions have to occur! You CAN set them explicitly using DAQmx Control Task.vi or, DAQmx is smart enough to implicitly transition through the states as needed. HOWEVER, lets walk though a brief example: You have a "Verified" AI Task (Finite) and call DAQmx Read.vi; DAQmx Reserves, Commits and Runs the Task, The Task completes, becasuse the last explicit state request was "Verified" DAQmx Uncommits, and Unreserves the Task Resources leaving Hardware in the same condition as when DAQmx Read.vi was called (Think it through its the only correct behavior) This is why "We hate" the DAQ Assistant and yell at programmers that Create and Clear Tasks in loops - way too much overhead. Its also why I like Tasks in MAX or the project These Tasks are Verified when saved ensuring that the verification is trouble free if the hardware hasn't been removed.
SO: Despite my lengthy rambling the only real thing Andy needs to do is drop a Task Property node and read the "Channels" property then use an auto indexed loop to set the Name and Range properties of each channel.
NOTE on File Type. Dump the *.csv and use *.TDMS instead. You will thank me for that. There is a free TDMS Excel addon that not only gives you all the data in a very nice spreadsheet but, lists all the DAQmx Properties as well. You can even use DAQmx file logging and just write the TDMS file "Under the hood" and avoid the whole logging loop.
06-23-2015 01:58 PM
Jeff·Þ·Bohrer wrote:
Now lets get some terminology corrected here about DAQmx Stuff:
Thanks for your clairification. My terms were incorrect.
I also vote TDMS, and the Excel conversion is nice. Here is my wrapper I wrote a while ago.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord