From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Correct software architecture

Hello. I´m designing a complex application and I don´t know what software architecture is the best. I have been reading the "LabVIEW Intermediate I: Succesful Development Practices" manual. Lesson 3 gives the reader a lot of options for software architecture selection, but, although it gives a lot of explanations, I can´t find the correct one (maybe I should use a combination of some of them). The application runs in a PC. This application communicates with 4 controllers via CAN and with another one via Ethernet. Both communications are very asynchronous because I have to read a lot of data but send only a few. I have to receive a lot of data from the first controllers (CAN connection) and display a graph containing all data. Reception must be as fast as possible without losing any data. During graphic displaying time is important but not critical. In the other hand, is critical not to lose any data. I mean it is critical to collect all data although they aren´t displayed in "Real time". I have to send some data to the controllers via CAN but in this case, transmision rate can be quite slow, so I guess it can run in another loop. Communication with the other controller (via Ethernet) have a similar behaviour, but it don´t have to be as fast as CAN communication. Finally, I have a User Interface where basically I change parameters and send them to controllers so there are no intensive processing or activity. I have been thinking about using Master/Slave or Producer/Consumer architectures but I don´t know what architecture best fits my application. Can you help me? Thanks!
Message 1 of 3
(2,434 Views)
Personally, I would stick with the producer/consumer approach for this in order to seperate out the UI code from the rest.

Additionally, I would launch a background process (out-of-line via VI server, but I can't find any decent references at the moment) for each CAN so that the communication for each device can run in a seperate thread.  This way if one blocks up or generates an error, it won't block the others.  These VIs running in the background then send the acquired data via QUEUE to the main program.

I've used this approach in the past for communicating in parallel with many devices and have found it to be very good.  The time required to get it up and running is maybe a bit longer, but in the end it's worth it.

So basically, 1 VI 1 device on the level closest to the hardware and then one UI VI which communicates with the others via QUEUEs.

That's my 2c, maybe someone else has a different approach.

Additionally, Sorry I can't give an example of what I mean, or a decent reference but y quick saerch of the forum didn't show me anything useful.  With time it'll work, but I don't have too much time at the moment.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 3
(2,426 Views)

Thank you very much.

I'm going to have a look at it.

0 Kudos
Message 3 of 3
(2,386 Views)