10-04-2007 12:59 PM
Hi,
here I found, that is possible to create from LabView a dll this more functions. Each added VI, will be one function - http://forums.ni.com/ni/board/message?board.id=170&message.id=19858&query.id=416227 (question no. 3)
But I would need that the
For example:
I'd like to create a dll (for TCP/IP communication) with 3 functions (Open connection, Write data, close connection). First, I call dll function Open connection, then can call several times function Write data and at the end, I want to close connection with the last function.
If I tried to create such dll from VIs, which contains blocks for these tasks, I was not able to create "a bridge" between the
Has somebody experience with this?
Thanks
10-05-2007 12:55 AM
Hi Ondrej7,
You're creating a DLL using LabVIEW - what programming language is calling the DLL? Are you saying you need to pass a TCPIP connection out of the DLL? You could pass it out/in as a variant or by casting it to a U32, BUT I think it should be possible to keep the TCP connection inside the DLL (in a Global variable or shift-register) so the caller doesn't have to worry about the connection.
Does the caller need to use the TCP-connection, or only the DLL?
Cheers!
10-05-2007 04:09 AM
Hi,
the caller is an acquisition program Testpoint (probably nobody knows it any more), I need just to call in this program the dll (not use the TCP-connection).
On one computer, I run LabView, which produce some data (e.g. 1D Array of integer). I want to transfer this data to another computer, where Testpoint runs and implement the data to Testpoint. I created dll, which I call from Testpoint. The dll read data from TCP-connection (output for the caller is only array of numbers). However, my dll has only one function, when I call this function, it opens TCP-connection, reads data and closes TCP-connection. I call the dll many times, so it is not necessary every time to open and to close the connection. I'd like to open the connection at the beginning and close at the end..
So I don't need to pass the connection ID out or in, I need following: I make function OPEN and call it, this function pass the connection ID to the second function READ (within dll). The same for function CLOSE.
Thanks
Ondrej
10-06-2007 08:56 PM - edited 10-06-2007 08:56 PM
Hi Ondrej7,
Here's some example code that may be all you need! (just remove ".txt")
This DLL will only manage a single connection, but you don't have to pass any connection-reference to it. I know nothing about Testpoint and don't know if we can pass strings Out of the DLL. If this is a problem, then we should try outputting an array-of-bytes instead.
Cheers!
Message Edited by tbd on 10-06-2007 08:58 PM
10-08-2007 07:56 AM
Hi tbd,
That's exactly, what I was looking for.
Thanks a lot
Ondrej