LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best way to run two processes (loops or VIs)

 

Thank You. I ll go through the producer/consumer achitecture. 

The 3 subvis do not have any data dependencies. Even then I cannot make them run in parallel. If 2 return the correct values, the third one returns 0. I can never have all 3 return the correct data simultaneously, though they work correctly when executed separately. 

 

0 Kudos
Message 11 of 21
(1,174 Views)

 


 

for(imstuck) wrote: 

 A person cannot click the mouse 3 times simultaneously. Therefore, if your subVIs are in the event structure, this is impossible. If you post code, like has been suggested multiple times, I am sure we suggest a way to implement what you are trying to do.

 


This is not impossible. As a single click is needed to trigger one event. the event being calling 3 subvis. And the boolean data from the click is passed to the 3 subvis. 

 

0 Kudos
Message 12 of 21
(1,172 Views)

Without seeing the code it would be impossible to give you any suggestions to resolve your issue. Do you have any other dependency between the subVIs? Are they trying to communicate with the same device? Are they sharing any resource? There are lots of reasons you could be experiencing a problem but without code we are simply shooting in the dark.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 13 of 21
(1,170 Views)

I am sorry i know i have been asked a few times for the code... but I really need permission from my superiors to do that..

Though I will try to post a screen shot. Besides I guess I can see where the problem lies. As has been pointed out, they do share a single com port and they r tryin to communicate with the same device.. Are these restraints the reason behind not being able to carry out simultaneous execution?? 

0 Kudos
Message 14 of 21
(1,163 Views)

Yes, since they share the same COM port (I assume serial) then they cannot run in parallel. They must be run in some synchronous manner.

 

As for the code we understand that it is not always possible. However you can also create a simple example that illustrates your problem.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 15 of 21
(1,155 Views)

they do share a single com port

 

You can't get there from here then!  The com port can only do 1 thing at a time.


"Should be" isn't "Is" -Jay
0 Kudos
Message 16 of 21
(1,149 Views)

Thank you very much.

Yes it is a serial port. And I used flat sequence to execute the 3 subvis. it works ok (obviously slow).
And yeah will make a simple example code illustrating my main problem from next time. 
Thanx a lot once again.... Take Care.... 🙂
0 Kudos
Message 17 of 21
(1,145 Views)

Rather than use the sequence structure why not use dataflow to control the order of execution? Use the error wire or the VISA resource name to chain your three subVIs together. This will order the execution for you. As for the speed it could be that the device is slow in responding. The other likely cause is that you are not reading the data correctly (looking for a termination character or reading the number of expected bytes for the response) and running into a timeout. For example, your response is only 10 characters but you call your read VI with a byte count of 100.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 18 of 21
(1,142 Views)

 


@Preetisar wrote:

But I am not able to make the 3 different subvis in parallel. When one is running, the others dont.

Can anyone please help.... thanx....


 

If you're using the same sub vi to read all values i'd wager it's not set to be Reentrant.

If they're reading from the same resource (as through RS232) it's probably a resource limitation.

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 19 of 21
(1,127 Views)

 


 

Rather than use the sequence structure why not use dataflow to control the order of execution? Use the error wire or the VISA resource name to chain your three subVIs together. This will order the execution for you. 

 


I tried with dataflow... I found the speed to be more or less the same(since the code is not very big). Thanx a lot anyways.. 🙂

 

0 Kudos
Message 20 of 21
(1,107 Views)