Lichter Posted July 23, 2015 Report Share Posted July 23, 2015 Hello, my first post here, so I hope this fits. I´m using the NI structure: "continuous measurement and logging" to build a programm t run a test bench. There are 5 parallel loops in this structure. Now I need to add a few features to the programm (some timers, cyclic test bench parameters, PID controller, time controlled logging ...) and I dont know where to build them. I added some features (that just run one time) in the UI message loop but for continous running code that doas not work. Now I would put the feature SubVi´s in the Data Display Loop to not slowing down the acquisition or the looging loop. Is this the right way to go or should i build more parallel While loops to run the features. In general: Is it better to use a small number of parallel while loops with much stuff that happens inside or is it better to use lots of parrallel loops with just one function per loop? If this is important: The programm later should work on weak intel atom embedded pc´s. Thanks in advance and kind regards Lichter Quote Link to comment
Popular Post hooovahh Posted July 23, 2015 Popular Post Report Share Posted July 23, 2015 Software design has many questions that need answering, and this is one of them. I've seen some software written where each dialog in the application was its own separate VI running a while loop in parallel with the other ones. Each VI and loop had a messaging scheme to show and hide the dialog. This mean there were something like 10 parallel while loops just handling dialogs. This goes too far. I've also seen applications that have one while loop, where DAQ data logging, report generation, sequencing, communication, database control, and UI were all in a single loop. This didn't go far enough. In the end it is up to you to decide how it should be designed, and personally I don't mind adding parallel loops as long as the functionality and responsibility of the loop is well defined, and encapsulated. Performance-wise it might become a problem. An atom is not a powerful PC, and if each loop is doing lots of work in timeout cases you will have a problem eventually. But if most of the time, most of the loops are truly idle, not polling anything, then I wouldn't worry too much about it. 3 Quote Link to comment
Lichter Posted July 24, 2015 Author Report Share Posted July 24, 2015 I think that answered my question. Thanks Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.