10-13-2014 11:02 AM
We have to sense some house variables and act upon them and the resident's settings. For this, the house will be connected to a single PC and the plan is to make the house controls in LabVIEW + LIFA and also there'll be 4 interfaces around the house:
- 1 in the living room which has to have access to most but not all these controls and also be able to change the user's settings.
- 1 in the kitchen as an assistant and one in the bathroom, both of them will only control their respective controls (i.e. lightning, vents, water flow, timers, etc.)
- And a last monitor to display the LabVIEW front panel and to setup the PC that'll be hidden.
The system's idea:
- LabVIEW will run and execute the controls for all the operations using an ArduinoMEGA according to a user database of personal preferences.
- The living room interface will be a touch display programmed in VB.NET wich should be able to read and modify the same user database, change settings and override current values in the main vi as well as display the house's variables (like the temperature, the current lightning and AC values).
- The bathroom display will be an IR touch control with an Arduino UNO connected to another VB.NET application that will only control the room and display external info.
- The kitchen assistant, like the bathroom control, will add timers for cooking, recipes display and some other features.
So our doubts are:
a) What's the best way to store a file which both VB.NET and LV can read and modify?
b) How can I share the variables and controls throughout the 3 interfaces and the main.vi?
c) Is it really a good idea to use the plan as described?
We are using Arduinos because we have a lot of them around and the university can't lend us some of the NI equipment.
10-14-2014 08:19 AM
Hello Suspeso.
Thanks for using the NI Forums. Answering to your questions:
You can use several options here, you can use a simple ASCII file in which you can save and share information between your applications and that will give you portability no matter what platform you use to read and write information. You also can use also XML files, this format has become quite popular and both .NET and LabVIEW have the tools and functions to deal with them. Please refer to the following link for more information regarding these formats:
http://www.ni.com/white-paper/9630/en/
My suggestion here if you want to use both platforms (.NET and LabVIEW) is to create a library .dll based on your .NET application and call it from LabVIEW, basically what you need to do is to call a constructor node to generate a reference to your .NET library and use invoke nodes within LabVIEW to start using the methods in your library. Please refer to the following links to learn more about Constructor Nodes and Invoke Nodes:
https://decibel.ni.com/content/docs/DOC-29952
http://digital.ni.com/public.nsf/allkb/DCB90714981A1F148625731E00797C33
Why do you want to use .NET and LabVIEW? Is it because of the Database? The best approach is to use only LabVIEW unless you have already developed a dll built in .NET. With LabVIEW you can perform all the instructions to manage your Database not matter if it is Access, MySQL, SQL Server Oracle, etc. You can simplify your design if you only use only LabVIEW because rather than create ASCII files to share information you can use Network Published Shared Variables in LabVIEW in order to share information among all your targets within the LAN. Please check the following link to learn more about Network Shared variables:
http://www.ni.com/white-paper/4679/en/
Hope this information works for you!
-- Luis C
10-14-2014 10:18 AM
Thank you for the links. They're very helpful.
We are using LV and NET because all the interfaces and controls are hooked up to a single PC and because we have more control over VB to handle the user experience, is more stylish and we can include more options like weather forecast, social media notifications or selecting which monitor the application will launch always, etc. aaaand we have more knowledge over VB than LV 😛