LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save data

Hi alhabeeb,

 


@alhabeeb wrote:

I'm thinking to create an increment by 1 then multiply by the elapsed time. So each true case the counter increased by 1. For example the elapsed time is 5 (s). First ture case the total time is 1*5, the second true case 2*5, the third true case 3*5,... so on. I did it as shown in the pic. but I had an error.


You created a "data cycle": you send data (string) into the case structure, but that string depends on data ("Data No.") from inside the case structure…

 

Why don't you use the wire before the loop?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 31 of 47
(248 Views)

Sorry not really understood your suggestion?

0 Kudos
Message 32 of 47
(237 Views)

@alhabeeb wrote:

It is OK now. First time 0 (s) , counter*second elapsed time. If there is any suggestion please let me know.


No, this is very convoluted and will cause accuracy problems! Why not attach your VI instead of showing us multiple pictures? Also, since your lower shift register is not initialized, it will only work correctly on the first run of a session, but contain stale data from a previous run later.

0 Kudos
Message 33 of 47
(222 Views)

@alhabeeb wrote:

Sorry not really understood your suggestion?


It wasn't a suggestion, but an explanation!

 

You have a circular data dependency that is incompatible with the dataflow. The multiplication at "A" depends on data from the case structure, but the case structure depends on data from the array (B). Catch 22!

 

altenbach_0-1737737238060.png

 

 

If you want the total elapsed time, here is one possibility. (since you seem to prefer pictures over VIs, I am showing pictures 😄 )

 

altenbach_1-1737737518612.png

 

 

 

 

 

 

0 Kudos
Message 34 of 47
(215 Views)

Hi,

Sorry for the inconvenience. This is my VIs. It is good. 

Thanks

0 Kudos
Message 35 of 47
(194 Views)

@alhabeeb wrote:

Sorry for the inconvenience. This is my VIs. It is good. 


 

Well, does it work correctly? I don't think so!

 

No, you still have problems.

 

  • There is no reason in the world for the pink feedback node. Delete it! It will cause stale data to be saved (and nothing on the first run)..
  • There is a +1 primitive.
  • You only need to format the array in the true case, and not with every iteration
  • There is no reason to maximize the front panel and diagram to the screen
  • The total time does not need to go through the case structure.
  • You can just prepend the time to the 1D data array, no need to assemble it again from scalars.
  • For array diagram constant, always show the first invalid element (or show the scrollbar) so we can tell that the size is correct.
  • Don't overlap objects on the front panel (chart legends).
  • Personally, I would use "greater or equal" for the comparison.
  • Spell check your labels ("Trget" is not a word)
  • Decide if you really need to "convert EOL" when saving text. I usually don't.
  • etc. etc.

Here's how it could look like cleaned up a bit...

 

altenbach_0-1737997441605.png

 

 

 

 

0 Kudos
Message 36 of 47
(181 Views)


@altenbach  a écrit :

  • Decide if you really need to "convert EOL" when saving text. I usually don't?
    Thanks a lot but I didn't understand this phrase.
0 Kudos
Message 37 of 47
(156 Views)
0 Kudos
Message 38 of 47
(150 Views)

@altenbach wrote:

altenbach_0-1738085478023.png


To expand a bit on this, this property is platform dependent.  In Windows, it will replace the value for LF with the values for CTRL+LF.  If the file is binary in format, this will be disastrous because it will add an extra byte to your data for every occurrence of the ASCII value for LF.  Turn it off if you're reading/writing binary data.

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 39 of 47
(141 Views)

Thanks for the explanation. 

0 Kudos
Message 40 of 47
(122 Views)