05-15-2013 10:24 PM - edited 05-15-2013 10:25 PM
Hi,
I come from the C# world, and I would to like to create a way to control my equipment (actually throught the serial COM Port) through LabView). I'm thinking about creating a driver or a class for the design, but, I dunno which one is the most suitable. In my opinion, for now, it would be better to use a set of classes maybe cause I'm more used and also because of the way of operating of my equipment. the quipment is already working with my C# software.
Basically the equipment is a box for the power supply containing some cards for doing some tests.
The architecture I designed (but probably need some reviews) are made of the following classes:
Device
Box inherits from Device
Card inherits from Device
CommandBase
Many commands are them inherited from CommandBase. I know that all this type of vars are not all implemented in LabView (especially the KeyPair, Dictionary, etc.), they are just here to give an overview of expected behavior.
So which is the best way for implemting a way of controlling my equipment following the architecture given above?
Thanks.
05-15-2013 11:31 PM
It seems the primary concern with the architecture is not the architecture itself, but the fact that it has components (key value pairs and dictionaries) which are not available in LabVIEW. You can use variant attributes to get the same effect, and if you really want to get into a class implementation you can look at this LAVA thread.
05-21-2013 03:56 AM
Dear Nelval!
Before you would create a new driver, please allow me to recommend to search for already implemented solutions: http://ni.com/idnet
If you do not find your device, or if you are not satisfied with the solution you found, please follow the following steps:
You can create instrument driver vi's in LabVIEW through Create Instrument Driver Project.
Please follow the instructions below:
1. Go to LabVIEW»Tools»Instrumentation.
2. Select Create New Instrument Driver Project.
3. Select New Driver from Template under the project type drop down menu.
4. Select the type of your device from Source Driver Menu in this case,press next.
5. Enter the Driver Indentifier (e.g. Agilent 33250A).
6. You can fill driver description in the column below(optional),then press next.
7. VI Banner Template and Menu Icon are user defined, then press next.
8. Next Window shows the location where the driver project will be saved.
C:\Program Files\National Instruments\LabVIEW 8.5\instr.lib\<<Driver Indentifier>>\<<Driver Indentifier>>.lvproj
9. Press Finish.
10. The Project builds and opens up showing the various driver vi's under the<<Driver Indentifier>>.lvproj project.
11. LabVIEW Help will also open with this page: Instrument Driver Modification Instructions
Please allow e to recommend some resources to get familiar with designing Instrument Drivers in LabVIEW:
Create New Instrument Driver Project Wizard: http://zone.ni.com/reference/en-XX/help/371361J-01/lvdialog/idproject/
Instrument Control in LabVIEW Tutorial: http://www.ni.com/white-paper/3511/en
How to Build a Palette Structure for a LabVIEW Plug and Play Instrument Driver: http://www.ni.com/white-paper/14528/en
You also can use the NI LabVIEW Instrument Driver Development Studio 1.1 as a free tool to develop your driver.
Detailed info: https://decibel.ni.com/content/docs/DOC-20135
If you have any questions, please don't hesitate to post them.
BR,