LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to run a subVI in parallel with the caller VI?

and this is the complete code of raster scan.

0 Kudos
Message 21 of 29
(910 Views)
Thank. It is after midnight here. I'll look at it tomorrow.
0 Kudos
Message 22 of 29
(908 Views)

Grrr... why do people inisist a picture of a block diagram is "code"?  How are we supposed to know what is going on in the three other frames?  If I took a screenshot of text-based code, is that really posting code?  What if the code is more than can fit into that one screen shot?

 

From what I can see of the code, it is ill-conceived and probably should be rewritten from scratch.  On the main page of the LabVIEW forum, on the upper right side, there are links to some tutorials you can do to help you out.

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 23 of 29
(906 Views)
The other three frames have the same code.
Except the increment is replaced by decrement and then for third frame the z changes converted to color code to generate the image.

Thanks 🙂
0 Kudos
Message 24 of 29
(887 Views)

Imtisal,

 

     I had not realized that you basically "hijacked" a twelve-year-old thread.  Please stop posting on this thread.  Instead, open a New Message, ask your New Question, and post your code.  This means attach VIs, not pictures of VIs.  We cannot closely inspect pictures (difficult to see the "false" case of Case statements), cannot edit pictures, cannot execute pictures.  If you are using LabVIEW Project, you can compress the folder holding your code and attach the resulting .ZIP file (so we can see all the sub-VIs and load your code without "missing VI" errors).

 

Bob Schor

0 Kudos
Message 25 of 29
(873 Views)

@imtisal wrote:

and this is the complete code of raster scan.


OK, this VI contains missing subVIs, so we are not much closer to a solution. The subVI itself does not contain any loops, so it should return quickly unless the waits are long. How long are they? Maybe the inner subVIs are stalling the code?

 

Who wrote that code? Wherever you got this code, I would not recommend to trust that source for anything. The subVI is complely gummed up and unmaintainable. It looks like it is written by someone with a little bit on text programming experience, but with no formal training in LabVIEW whatsoever.

 

Whenver the most frequent structure is a stacked sequence structure, the most freqeuent items are local variables, and if the terminals are not even connected to the code, we are dealing with a nightmare! Look at the inner case structure: you have two identical cases with tons of code, but the only difference is s single primitive (add vs subtract)!  You only need one instance of all that  code! Only the add/sutract belongs inside the case structure, right? I don't think that you even need one single local variable. Place all controls and indicators outside any structures, and wire them directly to the operations. This will also eliminate all the sequences, because the wires determine the execution order automatically. If you need to write to the same indicator several times or If you need to re-use modified data, create a small state machine.

 

In fact, al you probably need is something like this (Is that wait really needed? Shouldn't that be handled in the calling VI?):

 

 

 

So thanks for posting that small subsection of code. It tells us that your problems are much deeper than you think and you need all the help you can get. As Bob also said, you need to attach all your VIs, not just pictures. If you keep positng images of small code fragments, we cannot help you and we won't keep asking for VIs. So place all your VIs ina zip file and attach it here. Until then, I will ignore this thread.

 

Good luck!

0 Kudos
Message 26 of 29
(863 Views)

I am pretty much understand the problem now. With your help, I am now getting it. I have attached the all the VI's. In the scanning section, I want to run the TWO  marked loop to run in parallel. First one was scanning and 2nd one for feedback which should move faster as compared to XY loop.

I attached the pciture also for better understanding that which part creates problem.

In the previous code, I was using the feed back subVI in the same for loop but that runs only for once along the MOVE Y subvi. But when I placed it outside of FOR loop to run independetly, DUE to data dependency, while loop keep running and for loop not executes.

I hope to have good response as you already help me a lot.

 

Kindly, let me know if some more data is required.

Kindly, go through the VI's please.

 

Imtisal

0 Kudos
Message 27 of 29
(861 Views)

Imtisal,

 

     This will be my last response on this 12-year-old thread.  If you want further help from me, at least, you will follow the courtesy procedures of this Forum and start your thread, with your program, asking your specific question, and posting all of your code that is relevant (including move XYQ (Change 6353), OneStepFDCurves, FD curve measure, color code, picomotor start, Pixel_to_Voltage_2_BackScan, and others).

 

     I'm guessing that you did not write this code, and probably don't know much about it.  In your new Post, tell us what you do know, what VI is exhibiting the problem, what it is that you want to change.  Is someone going to "take charge" of this code and try to turn it into something readable and maintainable?

 

     In case I wasn't clear with my suggestion(s),

  • Start a new thread of your own.
  • Provide a clear explanation of the problem (and choose a new, relevant, title for the Post).
  • Provide all of the VIs (as VIs, not as pictures) that we need to understand the code and the problem.

Bob Schor

0 Kudos
Message 28 of 29
(839 Views)

Hello Bob_Schor,

That example is very helpful for me and I am modifying my code according to your example. Its working perfect and I am using the x100 address to call asynchronously and collect data. I am almost done with the code but I need help in few things.

  1. My two VI (which should run in parallel) are enclosed in the case structure. i.e. When I press the button, it starts executing in parallel fashion. Both VI's start simultaneously but does not finish executing simultaneously.
  2. I am trying to make a code in such a way that both VI start simultaneously and finish simultaneously. But I am unable to figure it out which parameter should I have to use to finish execution at the same time.

Both VI's have FOR loops which running independently and equal number of time (i.e. 128). Due to the time difference, the feedback loop finish execution before the main loop (which is not required as it should finish execution along with the main Loop). I want your help how can I make the feedback loop to finish along with the main FOR Loop.

 

I have attached the modified code along with the feedback vi.

Kindly, let me know that you understand the query.

 

Thanks

Imtisal

 

 

Download All
0 Kudos
Message 29 of 29
(794 Views)