LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My web service network stream will run on port 8001 but not on 8080

So I have a web service running  on a myRIO which at the moment is just taking in a boolean value. When the MyRIO receives the GET request it starts a network stream writer to a receiver which is running in a different loop also running on the MyRIO itself. If I run the program by just clicking "Start" on the web service then it behaves exactly as requested.

 

When I go to http://172.16.0.1:8001/web/connect?Connect={value} from a separate PC on the network then it starts the network stream, writes the value and deletes the stream waiting for the next request. However when I choose to deploy the service to the application server on port 8080  and go to http://172.16.0.1:8080/web/connect?Connect={value} nothing happens on the recieving end and I can't debug it on the sending end to see why not.

 

I am guessing something to do with the IP I am passing it when I create the writer, in debug mode (8001) it is happy with 172.16.0.1 but I thought maybe when it's deployed to 8080 it maybe needs 127.0.0.1 as its connecting to a stream on itself however I tried this and it didn't work.

 

Here is my web service code

labview support 4.PNG

 

I have attached the source files. "connect.vi" is the web service running on the myrio and the network stream sender and "web control" is the vi running on the myrio and the network stream sender.

Download All
0 Kudos
Message 1 of 6
(4,591 Views)

I read through this a few times to try and understand what might be going wrong and I can't see anything obvious - you probably need to use the localhost IP of 127.0.0.1 if you're talking to a network stream on the same device but you said that you tried that and it still doesn't work.

 

I can't open your VI as I don't have LV2014 but are you 're-listening' on the reader after the connection drops? Once you destroy the endpoint from either side I believe you have to re-create the reader endpoint to listen for an incoming connection.

 

Also, according to the documentation here, you must set the appropriate wait condition before destroying the writer?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(4,574 Views)

Hi, On the receiving end I have a state machine which constantly destroys the endpoint and reconnects it and waits for a connection if it is lost. As I say it is working perfectly on 8001 just won't work on 8080. I wouldn't mind but data dashboard on ipad can't see the 8001 web services only 8080.

 

Other bonus information, windows firewall is turned off. I have tested other communication on port 8080 and it works fine (simple buttons just setting shared variables) it seems to just be the network stream part which it doesn't like.

0 Kudos
Message 3 of 6
(4,569 Views)

Have a look at the tutorial here: https://www.ni.com/docs/en-US/bundle/labview/page/tutorial-creating-and-publishing-a-labview-web-ser...

 

If you can get that working on 8080, you should be able to figure out what's wrong with your own code.

 

Hope it helps. 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 6
(4,554 Views)

Hi thanks for the suggestion but in my post above I just explained that I have already had web services running and working on port 8080. I've had buttons sending and booleans receiving and strings sending and receiving all across network shared variables. it is only when I have added this network stream code that port 8080 doesn't work. 8001 is working fine though.

0 Kudos
Message 5 of 6
(4,547 Views)

Ah, my bad. Smiley Embarassed  Network streaming is a different animal I'm not so familiar with. 

 

There is this discussion here:  https://forums.ni.com/t5/LabVIEW/which-ports-to-forward-for-network-streams/td-p/1567988

 

Not sure if it will be helpful or not. 

 

Good luck with your project. 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 6 of 6
(4,541 Views)