08-07-2014 01:58 PM
Maybe I could rephrase. How to keep the control of the state machine in C++ ? You said that there is a way to keep the front panel by calling the dll ?
08-07-2014
02:09 PM
- last edited on
05-02-2025
07:04 PM
by
Content Cleaner
@gautierdufourcq wrote:
Maybe I could rephrase. How to keep the control of the state machine in C++ ? You said that there is a way to keep the front panel by calling the dll ?
I did some searching around, it seems like this should do it:
To show the Front Panel of the VI when it is called inside the DLL, open the VI and go to VI Properties»Window Appearance»Customize. From this window, you can choose to Show Front Panel When Called. Enable this option.
Source: http://digital.ni.com/public.nsf/allkb/D363FE185910D952862569F40078FF8C
08-07-2014 02:15 PM
08-07-2014 02:16 PM
Thank you very much. It is the first thing I will test tomorrow. I hope that DM will charge the dll.
08-07-2014 02:37 PM
08-07-2014 03:13 PM
DM is the Digital Micrograph software (no, I don't know anything about it either) mentioned in the initial post (and also in a later post).
What are you actually trying to do? When you call a LabVIEW VI in the DLL, that VI executes until it ends. The calling thread (the thread in your C++ code) is busy until the VI stops. There is no straightforward way for the C++ code to pass new values to the LabVIEW VI (for example, to stop the VI) - is this something you need to do? Is the C++ code multithreaded - can it continue to do something else while the LabVIEW VI is running?
If your C++ code is multithreaded, you can add additional VIs to the DLL that handle communication (through named queues or notifiers, user events, or functional global variables). You would then call those VIs in a separate thread after launching the main VI.
08-07-2014 04:04 PM
08-08-2014 02:07 AM
Exactly. The main software is DM. It excutes dlls. These dlls are written in C++ and can use VI (effect of wrapping). Indeed, my problem is the monitoring. When the VI is running, I can not communicate until the VI ends. I tried multithreding, I could not receive data passed by pointer while the VI was running because data were in the while of the running VI. keeping the front panel, i hope to create a thread that allows me to launch and change values in the dll. Then, I will try to create another in which I will read data.
08-08-2014 03:21 AM
08-08-2014 03:40 AM
DM can do multithreading. But the problem is, i do not understand the VI because I did not conceive it. So I am trying to convert it in a good dll. That is why I would need the interface. I am, for the moment, unable to create sub VI because evrything is dependant. So, I hope to get the frontpanel.