LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Java Applet connecting to DS Server

Hello. I'm really hoping someone is able to help me with this...

I'm running a LabView DataSocket Server and an Apache HTTP Server. I have written a small Java Applet that connects to the DataSocket server and writes a random integer. Running this Applet from my local computer using AppletViewer gives the wanted result. Copying the Applet to my WebServer catalog and running it from IE 5.0 (still using my local computer) is also successfull.

My problems begin when running the Applet in a browser from a remote computer. Everything in the Applet works fine until it's trying to connect to the DataSocket server. This fails. Any suggestions? Why on earth does the Applet work perfectly when run on my local computer, but not from the sam
e WebServer when run remotely.

Any help would be appreciated. Thanx

Anders, NUST
0 Kudos
Message 1 of 5
(3,490 Views)
Anders,

Do you have your DataSocket Server set up so that all computers are writers? If not, then this is what you will have to do because the Java Applet is running on the browser computer, not the server computer. If you create your program using Java Server Pages, then it would be running on the server computer. This is the first thing to check.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 5
(3,490 Views)
Thank you for answering, Randy

Yes, my DS Server is set up so that all computers are writers.

I have now uninstalled my Apache http server, and instead I am making my html-pages (with the applet) available through the LV Webserver. By doing this I got access to the DS Server as well (with no other changes than changing http server). I can't understand why, but the important thing is that it's now working. Any clues to why it didn't work with Apache?

By the way, the initial values of the DataSocket Server items I have made are not working properly. I am using either string or int initial values on several of my DS items (set up using DS Server Manager), but none of them are correctly initialized when starting DS Server. (Polling of item-values
are done using a small Java program implementing the DS JavaBean). What am I doing wrong?

Anders
0 Kudos
Message 3 of 5
(3,490 Views)
Anders,

There have been reports that some users have to write to an item initially twice to get the value to update. I have not been able to reproduce this yet. It is being looked into for a future release of DataSocket.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 4 of 5
(3,490 Views)
Hello, Randy.

Yes, that's correct. I have to write every item twice to get the value to update. This is a well-known bug.

But my problem is that I want to read a item that has not yet been given a value by a DS Writer. I thought that setting a pre-defined item's initial value in DS Server Manager took care of this, but it doesn't. It is beeing read as NULL, not the initial value. Suggestions?

Anders
0 Kudos
Message 5 of 5
(3,490 Views)