07-24-2014 03:54 AM
Good morning,
I have a serious problem. I run a Vi with a while loop (for acquisition). In this loop, there are many values. I want to access to them while the loop is running. The problem of my VI is it does not give me the value until the loop has not finished. But I want to acces to it before the end.
The ultimate objective is to access to this value in a C++ code. In this code, I implemented threads. But since Labview does give me back the value until the VI has not finised... but it must never finish. What does do Labview when I call the VI with values and pointers from C++ ? Can I access to the value inside the running loop in real time ?
Thank you for your answers.
G.D
07-24-2014 08:39 AM
07-24-2014 09:44 AM
I thank you for the reply. The acquisition could be in C but the VI is to much complicated, I did not do the Vi which is very dirty. The VI regulates a temperature system and using C++ would not be a big advantage. The acquisition is so in real time and the while loop is obligatory. About doing the while loop in C++, I thought to this so I am going to try. I only hope that the NiDaq and the Visual Studio 2003 will be happy together. This is a potential good idea thank you very much. If it does not function, I will try to write the VI in C++. If you have any other piece of advice, I will read them carefully.
Best regards.
G.D
07-24-2014 09:49 AM
07-24-2014 09:54 AM
Of course ^^ but it is not the most difficult. Because in fact, with C++, I want to create another dll. This dll, I must call it with a software called digital micrograph. I don't even know if it will work. I first be at ease with Tasks name handling etc because i will put them at the entrance of the VI. Do you have an opinion ?
07-24-2014 10:01 AM
I think the best design is to completely separate both components from one another and define an appropriate interface inbetween.
One possible flavor of a design would be to have two executables (one LV, one .NET) which interface using some ethernet protocol (based on TCP or UDP). The .NET application sends commands, the LV application reacts and sends status information.
Example (displayed from the .NET application view):
You have one command to push a new set-point. You receive an acknowledge.
You have a command to request continuous status updates (potential parameter: update rate). You receive an update of the current value until you send a command to stop updates. This approach is often called "register/unregister" method.
Norbert