11-21-2008 08:46 AM
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
11-21-2008 09:04 AM
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.
11-21-2008 09:19 AM - edited 11-21-2008 09:20 AM
I unable to recognize any problem:
Show your code, please.
Andrey.
11-21-2008 10:00 AM - edited 11-21-2008 10:03 AM
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.
11-21-2008 02:39 PM
11-24-2008 09:45 AM
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!
11-24-2008 10:03 AM
11-27-2008 05:35 AM - edited 11-27-2008 05:38 AM
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.