LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed Loop Does Not Work When Connected to Constants or Controls

Problem:  Timed loop with 1khz Absolute time source does not work when connected to constants or controls, but does work when constants are entered directly into the timed loop input nodes.

 

I am trying to run a cycle where my daq assistant will output to a digital channel to engage and disengage a clutch at specific times.  The cycle times need to be adjustable.  When I set the timing loop input nodes directly (via the dialog box you get when you double click the input nodes), it works.  But if I connect a constant or a control (which I need) to the input nodes, the loop stops working.

 

I attached a vi showing my problem.

 

What did I do wrong?

0 Kudos
Message 1 of 3
(2,820 Views)

Is this code for an RT target? If not, i recommend not to use Timed Structures for this use-case.

However, you have made two mistakes:

1) All Timed Loops have the same priority. This is a NO-GO

2) You configured the loops for absolute time. If you are using relative time (1kHz(R)) as clock source, it works

 

Also note that you should not implement unstoppable loops unless you are targetting an FPGA. For RT, in certain cases, it is also OK, but not recommended. For Windows, it is again a NO-GO.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 3
(2,781 Views)

While I agree with Norbert, I would have said it differently:

  • Use the Timed Loop structure only mainly with code running on an RT Target.  For code running on a PC, use the Wait (or Wait until next Millsecond Multiple) function in conjunction with a While or For Loop structure.  To get two time periods, put a Sequence (ouch -- I dislike sequences) inside the loop.
  • Waits are always in units of a clock, i.e. are integers.  Don't confuse things by wiring in a Float.
  • You probably want the Timing Source to be the Clock, not Absolute Time.  Read the Help for Configure Timed Loop Dialog Box to see the difference.

Bob Schor

Message 3 of 3
(2,775 Views)