12-24-2013 04:31 PM
Hi
We have many C# project and I would like to integrate them in LabVIEW . Each C# projects contains thousands of lines, many classes and forms. Could you please help me on this?
I have found this article very helpful, however it is very basic.
http://erdosmiller.com/blogs/news/6605401-integrating-labview-and-c-1
I really need some guidlines on how to start?
I would greatly apprecaite your help
Thanks,
12-29-2013 04:23 PM
Any help is really appreciated. For example when I would like to use an object of class using the link in previous post I always see many constructors. Default and override ones. How can I implement inheritance in LabVIEW
12-29-2013 08:30 PM
Can you be more clear about what you are trying to do? As the link you posted explains, if you have C# code that you want to call from LabVIEW, you need to build that C# code into DLLs. I don't understand what you mean about implementing inheritance in LabVIEW; the inheritance is all handled on the C# side. It might help to show a screenshot of the LabVIEW behavior that you find confusing, if possible.
12-29-2013 11:11 PM
hi all
i also have some problem in learing from labview learning manuals , i can not find examples for practice like C:\Exercises\LabVIEW Basics I\Temperature Multiplot
and more ,,kindly help to find a solution
12-30-2013 05:19 AM
danishasefi: Your question has absolutely nothing to do with this thread. Please do not hijack another persons thread, create your own.
To answer your question, have you installed the LabVIEW Basic Course DVD ? You need to install the course DVD to get the exercises for the course. The DVD should be together with your course material.
12-30-2013 12:26 PM
hi nathand
The first problem is when I call the constructor and then an invoke node I get the following error. Could you please help me to fix this error
Error 1172 occurred at Invoke Node Error calling method MotionSense.TestStation.ELD.CELDTestBench.onVdd, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.NullReferenceException: Object reference not set to an instance of an object.)
Possible reason(s):
LabVIEW: A .NET exception occurred in an external assembly. For information about correcting this error, copy the following exception (in bold), and search the Microsoft Developer Network (MSDN) Web site or the Web for a possible explanation.
System.NullReferenceException in
12-30-2013 12:28 PM
This is an error in the C# code, not LabVIEW. You'll need to work with the C# developer to identify the problem. Perhaps you need to do some other initialization of the object before calling that method?
12-31-2013 12:14 PM
Unfortunately I don't have acess the c# developer. The problem is all these classes are all internally related to each other
for example when I call a method af a class, it inside calls many other classes and in each class constructor they also call different classes. The otehr problem is the c# program is GUI based
what is your recommenadation in this situation? I really don't know how to start?
The program starts by calling a main form and then from main form it calls another form and all the controls are there. Do I need to start with the constructor of the main GUI and initiate everything?
Thanks
12-31-2013 01:32 PM
Let me use an example.
Somewhere in the code I should use the constructor of a class called NIAnalogOutput and then call the methods inside this class
as can be seen below inside the constructor it uses 2 objects from other classes: clsSystemInfo and SystemBusType
If I delete that line and then compile and use the dll file I don't get any error
However if I keep this line in the constructor and compile the code I will get 1172 (null reference error )
I even tried to call the constructor of these classes and then call NIAnalogOutput but I still get the 1172 error. Could you please help me on this? How can I get rid of the error in this example?
in the attached picture you can see that I call the 2 class constructors (then all pass OK) before callingNIAnalogOutput
but I still get an error from NIAnalogOutput constructor
public NIAnalogOutput(string[] DeviceAndChannelName, double maxVal, double minVal, bool isMaster = false, eNIAOutCalOpt eCalOption = eNIAOutCalOpt.USE_STATIC)
{
this.master = isMaster;
if (eCalOption != eNIAOutCalOpt.NONE)
{
// Go change the niScales to either the static brdOffset values, or immediately measured values
UpdateAnalogOutputBoardOffset(eCalOption);
}
Dictionary<string,List<string>>devicesAndChannels = new Dictionary<string,List<string>>();
List<string> devices = new List<string>();
List<string> tmpChannels;
string[] tmpString;
int key_idx = 0;
NrOfChannels = DeviceAndChannelName.Length;
rNum = new Random(Environment.TickCount);
int chanIndex;
//#if PCI
if (clsSystemInfo.DAQmxInfo.sysBusType == SystemBusType.PCI)
{
SyncSignal = "RTSI5"; //not functional yet!!!
SampleClkSignal = "RTSI4";
GlobalSyncSignal = "RTSI3";
}
}
12-31-2013 04:39 PM
Basically the problem is how to manage dependency between c# classess in LabVIEW. In c# "using take care of dependencies" and I thought when I create a dll all these dependencies will be added and LV doesn't care about dependencies inside this dll