LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subdiagram no longer works within a flat sequence

Hello everyone. I'm new to labview and I ran into a roadblock with my program.

 

I have a diagram that involves a DAQ assistant controlled by a timed loop within a for loop (its purpose is to output voltage from a max to min value in a number of steps). By itself the code works. I constructed another diagram that is supposed to increase the voltage from 0 -> max voltage as a "warmup" for the device. I need the warmup to happen before the main diagram, so I put them in a flat sequence. However, once I do so the program only executes the warmup then ends. Any ideas on what could be causing this?

 

The computer I am doing it on is not connected to the internet and I do not have a flash drive so the best I can do is post pictures of the screen.

 

http://imgur.com/a/Li9md

 

Could anyone help? Thanks.

0 Kudos
Message 1 of 6
(3,675 Views)

 

You should never use "equal" comparisons on floating point values.

Why are none of the error out wired. Maybe they try to tell you something?

What are typical controls values (e.g. for "number of loops", etc.)

 

0 Kudos
Message 2 of 6
(3,649 Views)

>> program ends

Do you mean it gives error in the main loop? Or does it normally end the program without giving errors?

 

I suppose there is an error happening - because first daqmx write does not close write to AO. Next daqmx assistant write tries to access the same resource and fails.

Connect first loop end condition with Stop terminal of daq assistant. 

 

Also I would be not surprised if the original program never end the internal timed loop - you are comparing two doubles with "equal" as a loop end condition. No-No-No. Less or equal (like in the first loop) is better.

Message 3 of 6
(3,639 Views)

If you really insist on "equals", the best you can do is "equal to a point" where you decide how many places you want to use in your comparison.  Then you just use "number to fractional string" for each number with the precision equal to the number of decimal places and THEN do the comparison (while they are still strings).

 

I've seen some really esoteric discussions that go way over my head about how to compare them, but this seems to be the easiest way for me.

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 4 of 6
(3,603 Views)

Well, the "equal" problem (while real!) would cause the program to never stop so it cannot explain the observation.

Of course it could be that comparison is immediatly equal and the loop stops after one iteration.

There is no error handling, so the code would not stop if there is an error in the DAQ stuff.

I still suspect that N of the FOR loop receives a zero, causing the FOR loop (and the containing timed loop) to be skipped entirely.

 

We clearly need more information from the OP.

0 Kudos
Message 5 of 6
(3,579 Views)
Thank you guys for the advice. I had a less than or equal sign before but I changed it thinking it might help. I'll revert that and wire the loop condition to the DAQ stop terminal next time I'm in the lab. Hopefully that'll fix it.
0 Kudos
Message 6 of 6
(3,577 Views)