LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

flat sequence inside timed loop not executing

Hello all,

I wrote a very simple VI made by a timed loop (period 500ms) with a flat sequence inside. The flat sequence has two frames: on first frame I send a "*trg" command to a GPIB-connected instrument (this frame is executed with no problems), while on second frame I use a DAQmx to send an SPI command to a device. Second frame is NEVER executed. If I use the "start single stepping" debugging tool, I see that the program executes the frame, but the DAQmx doesn't perform the requested action. What's more surprising: if I repace the timed loop with a while loop (with a "wait 500" inside), everything works fine (loop duration is almost 500ms).

What's wrong with timed loops?

Thanks to all

0 Kudos
Message 1 of 8
(3,526 Views)

A timed loop is equal with "wait until next ms multiple".

Not "wait" function. That may be the reason.

See Labview help for the difference.

0 Kudos
Message 2 of 8
(3,517 Views)

I unable to recognize any problem:

 

 

Show your code, please.

Andrey.

Message Edited by Andrey Dmitriev on 11-21-2008 04:20 PM
Download All
0 Kudos
Message 3 of 8
(3,508 Views)

Thanks for your replies. See the code in the attachment.

On the left, there's only instruments initialization.

SPOC FL is a simple utility made with DAQmx wizard, that sends a hex pattern on a digital output.

Message Edited by xdaf on 11-21-2008 05:02 PM
Message Edited by xdaf on 11-21-2008 05:03 PM
0 Kudos
Message 4 of 8
(3,499 Views)
Hmmm... Interesting... Its may be bug (interference between DAQmx and timed loop), or error propagated from VISA, or... What happened if you will swap frames in the sequence? First DAQmx, then VISA? Which one will be not executed? Also what happened, if you will remove flat sequence completely (execution order already defined by Error in/out)? Andrey.
0 Kudos
Message 5 of 8
(3,457 Views)

Thanks for your suggestions.

Swapping frames doesn't solve the problem: the VISA write executes correctly, but the DAQ doesn't perform any action. The same occurs if I remove the sequence structure (anyway, I need it in order to syncronize other operations performed by other instruments, once I've solved this).

As you suggested, this is probably a DAQmx-related problem: I tried to put two VISA writes, and they both work. On the other hand, I tried also with two DAQmx commands, and both don't work.

For now, I'm working with a simple while loop (random delays introduced by Windows aren't big issue on my application).

Thanks again!

0 Kudos
Message 6 of 8
(3,430 Views)
Why not post your VI and your DAQ subVI so others can look in on it?  Does the subVI have a loop that never ends?
0 Kudos
Message 7 of 8
(3,423 Views)

I think no, because the VISA write is executed every 500ms, as requested.

Here's the sub-VI with its components.

BTW, the sub-vi is an SPI driver. It writess an SPI command driving three digital lines (CS, SCLK, SI), and reads an SPI frame (SO).

Thank you.

Message Edited by xdaf on 11-27-2008 12:38 PM
0 Kudos
Message 8 of 8
(3,382 Views)