LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic data, tunnels, wires. conversion and storage

OK

I'm attempting to use a USB-6211 DAQ to read voltage on a sensor.  I'm hooking it up OK on the tester panel.   It produces dynamic data and I haven't been able to figure out how to convert the data to an array for storage.  What I want to do is run the daq in continuous mode until the stop control is toggled "true".  I then want to store the data in a file.  I wouldn't mind displaying the data at that point either.

I also have some general questions concerning tunnels.  I am able to convert dynamic data inside of the control structure that the daq vi resides in.  If I run a wire through a tunnel outside of the structure, I get a broken wire.  What precisely is a tunnel, both as an abstraction in the LV sense, and described in more conventional computer terms (stack, heap, shifter, fifo whatever).  What does a tunnle do to dynamic data?

Thanks

LV 8.6 on Windoze XP
0 Kudos
Message 1 of 14
(3,960 Views)

In most cases, an exit tunnel does nothing to data - dynamic or otherwise. The exception is a for loop. The default behavior of a for loop is to create an array of data exiting the loop. You don't mention which type of 'control structure you are using. If you are using something like a case statement or event structure, all of the data types exiting the structure through the same exit tunnel must be the same. For example:

If x=1

  Then

     a=2

  Else

     a=3

This is the same thing as an exit tunnel from a case statement. You are assigning a value to a variable. You cannot assign an integer in one case and in the other case, make it a string.

You also don't mention if the wire gets broken when you connect it to some function on the other side of the tunnel. If you are not connecting to anything, then you probably have a data type mismatch inside your structure. Post the VI or an image of the VI

  

0 Kudos
Message 2 of 14
(3,943 Views)
Cluess1,
        I recommend that you use the "Write to LVM" Express VI to write the data to a file and just connect the Dynamic Data Type (DDT) to a Waveform Graph if you only want to show "X # of samples at a time" or to a Waveform Chart if you want to it to have a history.  If you use the "Write to LVM" Express VI, you will not need to convert the DDT, but it is possible with the "Convert from Dynamic Data" Express VI.  To find it, do a function pallet search for "dynamic."

Cheers,

NathanT
0 Kudos
Message 3 of 14
(3,933 Views)
Well,  So what you're saying is that tunnels are polymorphic in the sense that they do different things based on context.  So, I need to learn a different  definition of a tunnel for each structure.  OK, I'll try and do that.  It would be nice if context help were able to help sort this out.  In fact, there are a number of hidden modes of functionality that need to be better presented in the help system.

Anyway, I'm talking in this case about a "for" loop, and yes the wire breaks when I attempt to connect the data of a daq vi to an array.  I've tried different conversion stuff that I found browsing the multitudinous function menus.  I thought I would try and do an intelligent search, by asking someone who know what's what.  Searching help has not proven that helpful.  I just get way too much informationto be usefull  In fact, if there is one general beef I have with LV help is the lack of directed, focused search tools.  even having a list of related issues, and more examples would be a great improvement.

Regards,

Clueless1
LV 8.6 on Windoze XP
0 Kudos
Message 4 of 14
(3,933 Views)
Thanks NathanT.  I'm always happy to get information about stuff that works. 

How would you suggest that I go about saving the data in a general binary format that can be read by say a "C" or Matlab program?  Or in an excel binary format?

Come to think of it, has anyone got a way of saving a cluster of data in matlab .mat format?

Oh, and since this forum software does not have a way to edit posts (that I can see), I meant putting related items (as hyperlink text), and examples at the bottom of the help entries for the various functions.  For instance, in entry for the daq function, have hyperlinks to the dynamic data type information.  In dynamic data type help, have hyperlinks to all of the conversion and data functions that can do something with this type, etc.  And where there is polymorphic behavior (as in tunnels of different structures) explain the particular behavior that can be expected.  The wire is a cool metaphore, but when a wire is not a wire but a number of wire like behaviors, then this needs to be pointed out somehow for the clueless ones like me.

Thanks
LV 8.6 on Windoze XP
0 Kudos
Message 5 of 14
(3,929 Views)

So, you have some sort of data out of your DAQmx Read and that exits the for loop. By default, the for loop autoindexes the output into an array. The type of array will depend on the data you have output from the DAQmx Read. You can select the type of data that it returns. For example, if you have multi-channel/multi-sample, it can be either a 1D array of waveform data types or a 2D array of DBLs. Out of the for loop, you would then have a 2D array of waveforms or a 3D array of DBLs. You can disable autoindexing but then you would only have the very last iteration of data. You have to pay attention to the type of data you generate and how you want to display it. You say you wire up the results to an array and then get the broken wire. What is the data source type, what is the data sink type, and what are you trying to do with the data? As I mentioned, posting your VI or an image of the block diagram will help explain exactly what you have done and how to fix the problem.

I actually think that NI has done a great job of shipping a large number of code examples that show real applications instead of just function help that you get with other programming languages.

0 Kudos
Message 6 of 14
(3,925 Views)
Here's the vi, such as it is...

And I don't disagree that NI has provided a mountainous pile if information.  The problems is that's like trying to drink from a river.  There needs to be a better way of presenting the data, that leads to directed, and focused perousal of the resources, which I repeat are many, many,many etc...times google.

A spell checker on this forum would also be nice...


As always,

Clueless1
LV 8.6 on Windoze XP
0 Kudos
Message 7 of 14
(3,920 Views)
Could you post an image of the block diagram so I can look at it? I only have 7.1.
 
Also, there is a spell check. It's on the toolbar of the message box over on the far right side.
0 Kudos
Message 8 of 14
(3,917 Views)
I would be happy to include an image as soon as I figure out how to do it.  And as a perfect example of what I've been trying to say, I go the search tab of help and type saving vi as image and get 57 entries.  I'll get back to you after I've read through them.  I'm not that hopefull though. 

You might want to try this, as an example.  I see a function called "VI Logger".  This looks interesting.  So I type "vi logger" into the help tab.  I get 27 entries.  A quick read through them and I get all kinds of information about how to use the vi logger functions, but have yet to find the a good explanation of what a vi logger does, and how it will make me look good to the boss.

I remain as always,

Clueless1
LV 8.6 on Windoze XP
0 Kudos
Message 9 of 14
(3,914 Views)

To take an image of a block diagram I normally just use Alt-Print Screen and paste into ms paint. Save as a .png or .jpg.

The term "VI Logger" usually refers to a stand-alone program that ships with NI's DAQ boards. The 'lite' version is free but you can pay for a more full featured one. It's an easy to use program for basic data acquisition and logging. There is no programming involved. There are functions in LabVIEW to access this separate program. I haven't used this but there is more information in MAX.

Instead of doing a search in help, try doing a search in the example finder.

0 Kudos
Message 10 of 14
(3,907 Views)