LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

crazy problem with two programs

The for-loop won't run until the while loop is completed because that's how dataflow works. You've set up that condition by putting the for-loop outside the while loop. Why did you do that. It seems to me that what Dennis posted is what you want to start with. Your code won't work.


EDIT: Sorry for the double-posting, Dennis. I hate time delays. Sometimes.


Message Edited by smercurio_fc on 05-31-2007 11:15 AM

0 Kudos
Message 11 of 16
(795 Views)
The code which Dennis has posted , in that the network analyzer loop works but the serial port code doesn't work...so I tried it by keeping the GPIB code outside of while loop of serial port . But agian in that serail port code works but the analyzer code doesnt start as of dataflow problem.
Can't I do it like creat an even structure, such that whenever I press the Run button/Start button, present in the while loop of serial port, directions are given to the event structure outside of while loop and the network analyzer code starts storing data in to the file till I press the RED stop button??Robot Sad
0 Kudos
Message 12 of 16
(789 Views)

You really need to be more specific than 'the serial port code doesn't work'. How doesn't it work? Is there an error generated? Wrong values read? A hole is torn in the space-time continuum? You've not posted a good explanation of what is going wrong or even what exactly you want to do. You wanted the two VIs merged. I merged them.

Remember what I said about dataflow? Your Agilent code has a while loop. This loop must finish before the main outer while loop can iterate again. If you want the serial and agilent code to run in parallel, you can simply put a while loop around the serial code.

I don't know what you mean by 'RED stop button'. The only stop button you have has no affect on "stopping" anything. All it does is control whether you do one VISA Write.

0 Kudos
Message 13 of 16
(777 Views)
Ok,
I explain my problem once again,
When I run the program, after entering the the distance and left and right ,etc...the number of pulses are calculated.
And when I press start, the Visa write should write the number of pulses to the serial port, which is what it's doing and also trigger the agilent code.The agilent loop should trigger on when I press the start and stop when I press the Stop in the control menu, but at the same time the agilent loop should not run for more number of pulses calculated.

By the time Visa read will occur i.e. the number of pulses written out to the serial port to the stepper motors are complete, the agilent code will also take in the data for those number of times,automatically.
When I keep the agilent code inside my while loop of serial port code...no Visa write occurs! and thus the pulses are not transferred to the port...

Regards,
Rohit
0 Kudos
Message 14 of 16
(771 Views)

This starting and stopping of the agilent loop is a bit more complicated than just copying and pasting code. As it is now, there is no relationshipt between your front panel controls and the agilent loop. You will have to modify the logic of the Booleans. I'm sorry, but I don't have time to rewrite your program from scratch and I that is what it will take.

I'm still not sure why the none of the VISA Writes will occur when the agilent loop is there. I would believe that the write might be delayed but not happening at all is something I can't see. Have you used any of the program debug tools? You could set a probe and see what happens when one of your front panel 'Run' buttons goes true. See if there is an error.

0 Kudos
Message 15 of 16
(752 Views)
Hi Dennis,
I found a simple soultion to this problem and have pasted my problem in the nre thread...If you are free can you please have a look over it?
Regards,

0 Kudos
Message 16 of 16
(739 Views)