LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert 1 D array to double 64 bit

Solved!
Go to solution

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?

 

0 Kudos
Message 1 of 12
(8,834 Views)

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.

Message 2 of 12
(8,821 Views)
Solution
Accepted by topic author rr1024

@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 

withforloop.JPG

 

0 Kudos
Message 3 of 12
(8,802 Views)

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.

Message 4 of 12
(8,774 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 12
(8,770 Views)

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.

 

enMasse.PNG:

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 6 of 12
(8,745 Views)

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. 

CLD | CTD
0 Kudos
Message 7 of 12
(8,726 Views)

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 8 of 12
(8,721 Views)

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.


 

0 Kudos
Message 9 of 12
(8,646 Views)

@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.

 

enMasse.PNG:

 


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

0 Kudos
Message 10 of 12
(8,644 Views)