12-10-2018 12:39 PM
@Mark_Yedinak wrote:
Here is a LV 2015 version. I happened to have a copy on my PC.
Thanks, I am not sure though - how do I set the data type? It seems like I can enqueue whatever, but the dequeue only seems to spit out a string and I don't see with the obtain queue a place to set element type.
Thanks!
12-10-2018 01:20 PM - edited 12-10-2018 01:35 PM
You can enqueue anything. The dequeue returns the data as a flattened string. The receiving end needs to know the data type which was enqueued and use a Unflatten From String to get the data back in the correct type.
Basically something like this:
12-12-2018 09:12 AM
Mark,
If I am opening the server queue in one application and adding elements to it on another application (but same machine), is localhost still the right connection? When I use localhost I get the error when opening the client queue: GetRawSocketFromConnectionID.vi - invalid connID
If I open the server and client from within the same application, however, it opens up the client queue OK.
Thanks for you continued help!
Alex
12-12-2018 09:33 AM
Show me your code. Localhost will work. The name of the queue needs to be the same for the server and the client.
12-12-2018 10:11 AM
Here are the two files. I run the servetest first and then try adding to the queue via the other vi and I get that error.
12-12-2018 10:28 AM
Give this a try. Don't close the client until you are done using the queue.
12-12-2018 11:01 AM
Sorry, can you repost those as LV 2016 (or do a screen grab)? I tried removing the close queue and I still get the error on the client initialize.
12-12-2018 11:17 AM
These are pretty straightforward VIs. I am not sure why you would be getting an error on your Create Client. Have you verified that you don't have a firewall blocking the connection?
12-14-2018 02:49 PM
OK so,
If I run those two VIs from the same project, then it works fine. If I run them from separate projects then I get the connect error. It is possible that we have a firewall set up, that sounds like the sort of thing they do here. Is there a specific port or something that i should ask about?
Alex
12-14-2018 03:46 PM
I have used this library across projects as well as across multiple computers. By default the server will automatically select an unused port number. This will generally be above 50000 but is random and will change every time you execute the code. You can specify a port to use if you want. A set port will generally make IT folks happier since they only have to provide a firewall rule for a specific port (or a few) rather than a large range of port numbers. The NI Service Locator uses port 3580. That port will also need to be allowed.
The reason the code work in a single project but not across projects is that it will use a native LabVIEW queue if it can. Within a project the client will find that native queue and use that. Different projects will not see each other's native queues so you need the network. If the firewall is blocking access then it will not work because of that.