07-06-2016 02:14 PM
Let me start off by saying I'm a newbie to LabView and this is my first lttle project/learning experience.
I'm trying to take the output of "34401A DMM Read Measurement" see comment in vi or little organge line and dump every reading into the "Measurement" DBL
The output of each element in the array is already of type double. So I've put the items I could find that I thought I would need, like the for loop and the size of array in place?
Also open to any recommendations to do this better? So what goes in the for loop to shift each element out?
Solved! Go to Solution.
07-06-2016 02:34 PM - edited 07-06-2016 02:37 PM
What do you want to do with each element as you get it out?
You can put the Measurment terminal in the For loop and wire it up to the auto-indexing tunnel on the left. That will show each value in turn. But it will do it so quickly that you really won't be able to see anything.
You don't need the array size function wired to the N terminal. The number of For Loop iterations is automatically determined by the auto-indexing tunnel. The Array Size going to N is redundant.
You still haven't fixed the problems talked about in your other threads. The lonely event structure with the front panel set to lock. If you hit Start twice in a row, your VI front panel will lock up because the event structure only executes once. It will never handle the 2nd button press. The only way to end your VI at that point will be to abort it.
And the Strip followed by Build Path. I know you claimed in another thread that solved a problem you were having. If you think it works for you great. But I really don't believe it solved anything.
07-06-2016 04:07 PM
@RavensFan wrote:What do you want to do with each element as you get it out?
You can put the Measurment terminal in the For loop and wire it up to the auto-indexing tunnel on the left. That will show each value in turn. But it will do it so quickly that you really won't be able to see anything.
You don't need the array size function wired to the N terminal. The number of For Loop iterations is automatically determined by the auto-indexing tunnel. The Array Size going to N is redundant.
You still haven't fixed the problems talked about in your other threads. The lonely event structure with the front panel set to lock. If you hit Start twice in a row, your VI front panel will lock up because the event structure only executes once. It will never handle the 2nd button press. The only way to end your VI at that point will be to abort it.
And the Strip followed by Build Path. I know you claimed in another thread that solved a problem you were having. If you think it works for you great. But I really don't believe it solved anything.
Thanks RavensFan
1. Once I figured out how to dump the Array out I was going to connect it to the format String functions just above it
2. I did a quick read on auto index tunnel, thanks and the Double Measurement Tunnel was for trouble shooting if I needed it, ultimately I want to take the 1d array and convert it to string.
3. Oh, I was using the lonely event stucture because someone told me it was the correct thing to use to prevent the program from starting up before the user had a chance to fill in the data, like file and GPIB. It seem to do the trick but is there another way to use it or should I be using something else?
4. The intent of the log path was to allow the user to select/create a text file in their My documents directory and I don't want to hard code a file name since they could use this for many different measurements throughout the day. If I get rid of it then I need yet another imput box for the file name? I also found the main problem with selecting the file was doing a right click on the Path and setting the browse options which I found by mistake but allowed me to select filed or folders and New or Existing. That is why it wouldn't create a file originally.
Ok so base on your info I wired this up and it kind of worked and dumped the data to Measurements but not to Measurement in the for loop and it appears because the 1d array is
07-06-2016 11:03 PM
While you're still learning, focus on having good habits. You'll want to avoid having tunnels on the top or bottom of your loops. Your code becomes easier to read if inputs come in from the left and outputs leave on the right.
07-06-2016 11:46 PM
@natasftw wrote:While you're still learning, focus on having good habits. You'll want to avoid having tunnels on the top or bottom of your loops. Your code becomes easier to read if inputs come in from the left and outputs leave on the right.
Im okay with having tunnels on the bottom (usually inputs) if there isn't a convenient way to make them go in the left and out the right. I can't hang with tunnels on top, though, because that's where my documentation goes.
07-07-2016 06:55 AM - edited 07-07-2016 06:56 AM
Welcome to LabVIEW !
If you're coming from some other language, you should be aware that there are things that you don't have to do anymore.
For example,you don't have to use a FOR loop to turn a 1-D array of numbers into a 1-D array of strings.
:
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-07-2016 09:22 AM
Coastal,
Do you know how many thousands of times I've put for loops around those primatives to auto-index in/out to build arrays of strings or numerics.. All this time I had no idea those were polymorphic.
07-07-2016 09:34 AM - edited 07-07-2016 09:35 AM
Do you know how many thousands of times I've put for loops around those primatives to auto-index in/out to build arrays of strings or numerics.
Send your royalty checks to my work address, please.. 😉
You should always try using primitives with arrays/clusters etc. A lot of them DO accept arrays. If it doesn't work, you can still do it yourself, but you might save some work and some execution time.
See En Masse Operations, and notice how a literal translation of an algorithm from C into LabVIEW is not the best way to do it.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
07-11-2016 10:05 AM
Thanks will do
@natasftw wrote:While you're still learning, focus on having good habits. You'll want to avoid having tunnels on the top or bottom of your loops. Your code becomes easier to read if inputs come in from the left and outputs leave on the right.
07-11-2016 10:14 AM
@CoastalMaineBird wrote:Welcome to LabVIEW !
If you're coming from some other language, you should be aware that there are things that you don't have to do anymore.
For example,you don't have to use a FOR loop to turn a 1-D array of numbers into a 1-D array of strings.
:
I'm been looking for that graphic with the little # and arrow to n.nn that you used but I can't seem to find it anywhere? what group is it under, I looked through array's and strings