LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sub vi does not return all elements

Solved!
Go to solution

ok, this config produces data that has timestamp issues.  it generates blocks of 10 identical timestamps per iteration.

0 Kudos
Message 11 of 23
(1,594 Views)

I don't see any timestamps generated. All I see is an array of DBLs. Given that you did not include the subVI, I have no idea what those values are supposed to mean. You previously uploaded a VI called "Example Sub VI", but given that if I open that one, the "Example 3" shows a need to relink, it tells me, that the "Example Sub VI" was changed somehow.

0 Kudos
Message 12 of 23
(1,586 Views)

I didn't change anything that i know of.  really, the only thing in the sub vi are math nodes.  add, subtract, multiply...

example 3 is just a small sample of a larger program.  it is quite posible that these problems are generated outside the scope of the example.  upon further investigation, the timestamps  look like attached.  I am still wondering if a queue would work better, eliminating the need for the for loop.  I went with the for loop b/c I thought it would be hassle free.

0 Kudos
Message 13 of 23
(1,577 Views)

Since you are not creating an actual Excel file, do not give it an xlsx extension. It's just confusing.

 

Why do you think there should be any valid timestamps inside any file you write since you are not passing any valid timestamps to the write file function. As already mentioned, you have an array of DBL. That is much different than the dynamic data you start with and then strip of all time information.

 

If you are going to play with (evil) dynamic data, leave it alone and don't convert back and forth to other data types. You don't understand what the conversions are doing.

0 Kudos
Message 14 of 23
(1,574 Views)

so what would the easiest way be to retain timestamps?

the xlsx format is due to post processing.  the tdms file is called, converted to excel 2010 and then it calls a macro. so after testing, all results are in excel.  everything worked peachy until I had to add in the subvi that scales the measurement to temp.  LV does not provide scaling for this particular device.

0 Kudos
Message 15 of 23
(1,565 Views)

would using daq mx and getting a dbl output work?

the express vi only outputs dynamic.

0 Kudos
Message 16 of 23
(1,564 Views)

Getting a DBL will not work. That is what you have now. The only things that have timestamp information is dynamic or waveform data types. I avoid dynamic data but you can certainly perform any math function you want on a waveformdynamic data - without that silly conversion and for loop and autoindexing the array. Your code is already doing it with the two add functions so I don't see why you thought you needed to convert from dynamic data in the first place.

0 Kudos
Message 17 of 23
(1,557 Views)

right.  I could pull everything out of the sub vi.  it just takes up a lot of space.  that would be the easy solution.  i was hoping to keep the subvi w/o having too much trouble.  In addition, keeping it in a sub vi would allow me to drop this code into an automated program.  that program is considerably more involved and resizing everything would be  PITA

0 Kudos
Message 18 of 23
(1,553 Views)
Solution
Accepted by topic author comedygene

That comment makes no sense. There is nothing that I said that would require you to pull anything out of a subVI. What I said was that it was silly to convert from dynamic data to a DBL array and then convert element by element inside a for loop. Pass the subVI the waveform data type. Wire your numeric functions directly to the waveform. They operate on arrays as you are already doing.

 

 

0 Kudos
Message 19 of 23
(1,546 Views)

I understand that the dynamic data and waveform datatypes can be wired to math nodes.  the reason that the math nodes are in the sub vi to begin with is that it takes up a little more than a full screen to do the math.  it is real-estate intensive. on other projects, LV scales things like thermocouples and RTDs for you.  so I wired up my program with dynamic data from the express vi to the write to file vi.  worked fine.  this new project requires custom scaling.  I contained it in this sub vi.  the sub vi is causing problems.  maybe i am not clearly articulating the problem.

0 Kudos
Message 20 of 23
(1,539 Views)