08-11-2014 08:00 AM
Good afternoon everybody,
I have a data communication issue. I have an application that reads dll. These dlls must be wrapped : it means that they are themselves built in C++ with the dll from labview. The problem is that Labview, in its structure has a while and nothing goes out until the VI ends up. But, I want access to the value before the VI ends.
So, I was advised to use a TCP a protocol. But, I do not know anything to this subject. I do not know if my application can establish a TCP communication (has it a sense to say that ?). So, I think otherwise to do the communication between VS 2003 that calls the dll of Labview and that builds the second of my application. Do you have a link or a paper to explain me ?
Best regards
08-11-2014 08:10 AM
08-11-2014 08:27 AM
Yes, but the question is different. The topic is linked but not the question. On the other post, the question is how to keep the front panel with a dll.
Here, the question is to establish a data communication (in TCP) between applications in particular way. Should I delete one post or the other ? How to do ?
08-11-2014 09:26 AM
08-11-2014 09:39 AM
I would like to provide the code but it is a commercial code and I cannot give it. I want to add the code for tcp. But is there a good tutorial to make a communication between C++ and Labview ? The only thing I would like to do would be to receive the data on C++ so C++ is the client ?
08-11-2014 09:49 AM
08-11-2014
10:04 AM
- last edited on
11-06-2024
06:39 PM
by
Content Cleaner
@gautierdufourcq wrote:
I would like to provide the code but it is a commercial code and I cannot give it. I want to add the code for tcp. But is there a good tutorial to make a communication between C++ and Labview ? The only thing I would like to do would be to receive the data on C++ so C++ is the client ?
If I recall from the last thread, I would have guessed you want C++ to be the client and LabVIEW to be the server (Didn't you want to send "stop" to LabVIEW?) Redefine your end goal in clear wording and I can recommend the most appropriate response.
Either way, the code examples for LabVIEW are already mentioned above. For C++, you can base it off of the Winsock examples from MSDN. I have personally used these before and they may take a little tweaking but are pretty simple if you are familiar with the language of C++:
Client - http://msdn.microsoft.com/en-us/library/windows/desktop/ms737591%28v=vs.85%29.aspx
Sever - http://msdn.microsoft.com/en-us/library/windows/desktop/ms737593%28v=vs.85%29.aspx
I usually do something like this (for sending commands TO LabVIEW):
08-11-2014 10:11 AM
08-11-2014 10:14 AM
Thank you very much. It is a good starting point for me. I understand that I need to implement something in C++ and in Labview.
In fact, I am going to be precise. I call a dll in a software. Thanks to the previous posts, I can call the dll and managing the VI in this software because I have the frontpanel.
But I need the measures, so I want Labview gives me a scalar.
Is it true that Labview is my server ? And that C++ is the client ?
08-11-2014 10:19 AM
I have absolutely no knowledges about property right. I do not how it works. I can indeed modify the code but I had to ask the VI to see the code. Thus, I think I cannot give the VI. Anyway, I am going to implement the codes in Labview and in the C++ code.