LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C++ Client to read LabVIEW Server data

Good information - thank you. You also make a good point.

 

It seems the best next step for me is to get the application done with proper operation in LabVIEW (that is, LabVIEW server to LabVIEW client). In parallel, I will continue to investigate how to get data from the LabVIEW server using a C or C++ program.

 

The client knows C/C++ and should be able to handle the data stream coming from the LabVIEW application. Nevertheless, their application is going to be more complex than just reading the data my LabVIEW app will provide. I would like to understand the process of data transfer, and, as I mentioned, have a "simple" C program to validate the data I am provided can be read just like the LabVIEW client program would do. In the light of what you mentioned about making sure the data packets get all transferred, the challenge will be to transfer through TCP multiple data channels, and make sure all the information is captured. For now, the solution is to make a (long) string with data from each channel...

 

0 Kudos
Message 11 of 21
(2,551 Views)

Curious to see if the NI reps have any suggestions and example.

0 Kudos
Message 12 of 21
(2,545 Views)

I am trying to do something very similar. Can you share a simple example C++ code I could use to read from the attached example LabVIEW server app?

 

Thank you.

0 Kudos
Message 13 of 21
(2,522 Views)
0 Kudos
Message 14 of 21
(2,537 Views)

Hi RPJ,

 


@RPJ wrote:

An example is posted but not the source code. I posted a question but the post is old...

 


No need to resurrect a 20 year old thread!

(Especially when the posted code comes from a user who visited the last time also 20 years ago…)

 

You already got all the information you need from Rolf. What else do you need?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 21
(2,489 Views)

Gosh - 20 years! You are right. Time flies...

 

I will try to work with what I got from Rolf. (What I really wanted was a working code. )

0 Kudos
Message 16 of 21
(2,480 Views)

Hi RPJ,

 


@RPJ wrote:

(What I really wanted was a working code. )


You also got some (pseudo) code from Rolf…

(When you really want to discuss C++ programming you should post in a C++ dedicated forum. This forum is about LabVIEW!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 21
(2,477 Views)

"When you really want to discuss C++ programming you should post in a C++ dedicated forum. This forum is about LabVIEW!"

 

Dear GerdW - I think LabVIEW is also part of the topic and for me this is a "hybrid problem". In addition, from my experience, there are better chances to find someone that can address both areas (LabVIEW and C++) in the LabVIEW community, than in the C++ community.

 

With the example I found at https://www.youtube.com/watch?v=0Zr_0Jy8mWE

and the information I received so far (thank you Rolf), I am guessing I will be able to get things working.

 

In the meantime, if anybody has an example and wants to share, I would appreciate it.

 

Thank you.

0 Kudos
Message 18 of 21
(2,466 Views)

I recently got a message from NI politely asking me if my problem was solved:

"Topic: C++ Client to read LabVIEW Server data
Date: 07-02-2021 09:52 PM

Did it solve your problem?

Click here to view the replies and mark one as an Accepted Solution.

This helps others find helpful answers in the community too!"

 

That was a no-reply message and I am using this thread to let NI know that the answer is "No, I did not solve my problem".

 

What I really wanted was the example program, and while I appreciate the suggestions and encouragement, the thread did not provide the example I need. I am still waiting for a solution. I'd be happy to mark it if I receive it.

0 Kudos
Message 19 of 21
(2,203 Views)

The problem with that is, that a real program would take quite a bit more work to do, would implement a specific method of data transfer format that likely wouldn't be what you want in the end when your program is eventually fully developed.

 

The mail you received is an automated mail that is send out to every poster that created a topic on here and hasn't assigned an answer as solution. You may feel bothered and maybe even annoyed by it, but the robot who send it doesn't know better.

 

But considering that the code I posted, which by the way is actually almost fully compilable if you know the minimum about how a C program needs to be made to compile, was according to your own statement to complicated to get working for you. If you can't even figure out a few missing include statements and maybe fix a typo that causes a compilation error, how in the world will you be able to understand what has been written in the code, and even more so how will you do even minimal modifications to suit your final implementation? The posted code as shown, with the necessary includes added will exactly receive data from the LabVIEW program as you have posted it. However for any meaningful data transfer, that program is definitely to simple so you will have to program quite a bit more both on the LabVIEW side and the C side.

 

And even if I took the time to write such an example that would do a bit more meaningful data transfer, which allows the client to actually send commands to the server to do specific things and receive responses as reaction to those commands, the code would quickly balloon to 10 fold what it is now and you would understand even less of it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 20 of 21
(2,197 Views)