I'd like to make a dll from labview that has some functions that include datasocket writes and reads, where the dll would be used by a C program (being developed by our subcontractor) to talk to our existing Labview applications. This was the simplest solution to my situation arrived at after a phone call with an application engineer in Austin last week. It seems to me, however, that DataSocket server drops writes from a process that isn't Labview (or some other NI product, perhaps.) Can you confirm this? I came to this theory after creating the attached project.
There are several items in this: "read test.vi" just loops forever watching for a change in the example data that I hope to write. "F_to_C.vi" is from NI's posted ex
ample on how to create dlls with labview and call them from C - except I have added a dataSocket write inside, and I pass out the error code from this.
The visual C++ project is a console application where I try giving the temperature at the command line, and call the dll as usual.
What I observe is that if F_to_C.vi is run as a vi, the data changes when read by the reader vi.
If the console application is run, I see a the number of processes connected increase at DataSocket Server window. I see the number of packets there increase also. I see my temperature get converted properly by the dll. I see a proper error code that DataSocket Write would generate (either 0 if data socket server is running, or 63 if it isn't). The only thing I don't see is the data actually change in the reader vi. If I go back and run the original temperature conversion vi, I see that the reader.vi is still working.
The other vi in the folder (F_to_C2.vi) is where I've taken the dll that was created
by labview, and then reuse it back in labview. The dll works 100% when used in this way.