11-01-2012 04:36 AM
Hi everybody!
I'm quite new at LabVIEW and I have a question regarding software architecture.
I have to program a software for controlling 3 motorized stage, a camera and a pump. I have separately programmed VI's that control each of them and now I would like to merge them in a single program and I don't know what is the best way to do it.
So far my sub-VIs are made of "event-based" structure that reacts when the users click on pushbuttons. Should I simply put all my sub-VIs (i.e. multiple event structures) in one big while loop? Is it the best way to do it? I've been looking for a while for references about that but I couldn't find any relevant ones and I would really appreciate your help. Also if you know good references please share them to me.
Many thanks!
Bests,
Julien
11-01-2012 04:52 AM
Hi Julien,
I would go with a Stream-based approach implementing a class hierarchy based on InputStream and OutputStream.
When you write to your motors/acutators/AO use a child class of OutputStream
And when you read from AIN/DIN, use an InputStream child.
See for example the Java version of the InputStream class hierarchy.
Br,
/Roger
11-02-2012 08:12 AM
Hi Robert,
Thanks a lot for your answer. Could you however develop a bit your because I'm fairly familiar with OOP in Labview but I'm having trouble to find how I should start and what Stream-based approach is.
If you could give me more details or send me a link to references about it it would be awesome.
Thanks again.
Cheers,
Julien
11-02-2012 08:49 AM - edited 11-02-2012 08:50 AM
If you could give me more details or send me a link to references about it it would be awesome.
Sure, have a look at the attachement and see if it could be extended for your use?
It is a fairly simple implementation. I use it for reading for a number of different InputStream devices, such as FPGA DMA FIFO's, sockets, files, etc..
Br,
/Roger