LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Performance Issue

Yeah, tea is quite a local thing, but far from just British. I'm from Dublin, but I'll avoid the obvious unneccessary references. I hear it's quite popular in India too. 😉

It's sometimes amazing where different dialects come from. I'm actually living in Switzerland at the moment (have been for the last 6 years), and it's sometimes really eye-opening to experience some of the colloquialisms in use. Most of them are somewhat logical in nature, and it's possible to imagine where they come from. Sometimes, however, there are simply untraceable words and phrases in use.

I've yet to discover an Irish phrase in Swiss german though :(. I have started teaching people to refer to "Bacon" as "Rashers" though. I was immensely surprised when I had to stop over in London that the waitress in a restaurant had no idea what I was asking for when I mentioned "Rashers".

Anyway, getting somehwere close to back on track:

give the multiple queues a try, I think it should work.

Cheers

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 21 of 29
(720 Views)
Michael,

I second Shane's suggestion to use multiple queues.

I would consider going to a state machine architecture and eliminating the sequence structures. State machines provide great flexibility and power. You could easily use the solenoid on state to assure that the solenoid is not turned off too quickly, for example, by noting the time it turns on and disabling the turn off function until the specified minimum on time has elapsed.

Lynn
0 Kudos
Message 22 of 29
(705 Views)
Hey Lynn,

I definitely see how a state machine would be a good solution - after all, each section could be its own state machine, in varying states?

It's just I really don't know how to go about it in Labview

I mean, i've seen the classic washing machine State Machine 😄 but don't know how i'd scale that up to this kind of application

still a bit stuck on this multiple queue idea you have both suggested

sorry to be a pain!
0 Kudos
Message 23 of 29
(698 Views)
Michael,

Start by looking at the examples and searching this site for "State Machine."

I often use three state machines, one for user interface, one for data acquisition, and one for data processing. In your application a different partitioning may be more appropriate. At minimum I think each loop should be a separate machine. Perhaps a state machine for the conveyor and separate ones for assembly and inspection, if those have complicated processes.

Lynn
0 Kudos
Message 24 of 29
(690 Views)
Just confused myself silly thinking about State Machines and more Queues. I genuinely don't think I have the time to do the state machine idea, nor can I really get my head around it.

One quick query: can anyone hazard a guess why the profiler shows that 'PortOutputValue.vi' (a subVI, of the subVI 'Out.vi') is getting twice as many runs as 'PortInputValue.vi' (a subVI, of the subVI 'In.vi')?

'Out.vi' and 'In.vi' run the same number of times, but the subVI in each are running at differing speeds. Odd!

They should be running the same amount of times as far as I can tell - yet the output runs twice as much as the input? Odd! :S
0 Kudos
Message 25 of 29
(676 Views)
The port input an output VIs run in different loops. The lower loop containing the port input might take longer than 150ms to execute, thus the wait skips. If you want to keep them synchronized, you should maybe combine all in the lower loop and wire the blue outputs directly in place of the local variables.
What is your reason to have the two while loops run independently?
0 Kudos
Message 26 of 29
(663 Views)
Oh sorry, I've now got everything in one loop, which is why I find it so odd! :S
0 Kudos
Message 27 of 29
(658 Views)
hmmmmmm, i've definitely got to change the structure totally

the performance is far too hit and miss

just at a glance, is there a way I could use multiple loops or something similar?

when I had things in seperate loops and didn't use as many subVIs it performed a lot better and reacted almost instantly to input - now there's so much lag it often misses the deadlines, which is worrying 😞

if I was to use multiple queues for each section, then i'm unsure how I could pass the input to each section?

i'm ever so sorry for being a pest 😞
0 Kudos
Message 28 of 29
(652 Views)
Of course portout is called twice for each iteration, remember, it's in a FOR loop with two itereations whenever it is called.

I don't understand enough about your application, but see if some of the green VIs can be executed in paralell instead of serial. Also, you don't need shift registers on the queues. If I understand queues correctly, their state is kept internally. Same for some of your subVIs. You can even delete some while loops in the subVIs once they have no shift registers left.
0 Kudos
Message 29 of 29
(645 Views)