LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI to pull data from an embedded webserver page?

Greetings! I'm trying to write a VI that will establish a connection to an Omega iServer DNS address, then send RS-232 READ commands and write the results to a file. The problem is, aside from me being a LabVIEW rookie, that the embedded webpage has several Javascript-based pages that need to be dealt with.
I've used MAX to create the TCP/IP connection as a VISA resource, and it can communicate with it, but that's about as far as I've gotten. I'm really looking forward to using this project to get some LabVIEW experience, but I'm not making much headway.
Can anyone help me out?
0 Kudos
Message 1 of 18
(4,517 Views)

Hi,

Is there a specific part of this application design that you are working right now and having trouble with?  If you're looking for some overall LabVIEW guidance, I think a great place to start is with the online LabVIEW Introductions:

Three Hour Introduction to LabVIEW
Six Hour Introduction to LabVIEW

These courses will give you a foundation of dataflow and other LabVIEW essentials.

Hope this helps,
Megan B.
National Instruments

 

0 Kudos
Message 2 of 18
(4,502 Views)
Hey, thanks for the links Megan, I'll be sure to check them out ASAP.
I spoke to an applications engineer at Newport (maker of the iServer) and it appears that things are easier than I thought. According to him, I simply have to get LabVIEW to open a connection to the DNS address and send the RS-232 read commands. No need to fool with the Javascript at all.
So at this point I've used the TCP Open Connection, TCP Write, and TCP Read VIs in  a simple loop application. I'm using the TCP Write to send *X01, which is the read command, and everything appears to work except the TCP Read, which times out and returns and error code 56.
Any ideas? Any other info I could provide that would help? Thanks in advance!
0 Kudos
Message 3 of 18
(4,494 Views)

Hi,

You might want to take a look at this KnowledgeBase on TCP/IP Error Codes and Related Time-out Issues in LabVIEW.  Since error 56 is a timeout error, you could also try increasing the timeout input on the TCP Read VI.

Hope this helps,
Megan Beck
National Instruments

0 Kudos
Message 4 of 18
(4,481 Views)
Hehe, I was reading that just before lunch. I got some more info from Newport, and I was using the incorrect port. With that rectified, I now still get an error from the TCP Read function, error code 66. I looked that one up, and it's a timeout caused by Windows not seeing a response fast enough and closing the TCP connection. This has me stumped, but I'm still picking away at it.
Any other suggestions you may have, specifically in regards to finding why the connection is being closed or more importantly if there's anything at all being returned by the TCP Read would be appreciated.

Thanks again!
0 Kudos
Message 5 of 18
(4,477 Views)

Hi,

As you say, it looks like perhaps nothing is being returned in response to the Write command.  Although LabVIEW doesn't have built in functionality to monitor this, there are a number of third party tools which will monitor all TCP/IP communication between your PC and the server/instrument.  One you might check out is Ethereal.

Good luck!
Megan B.
Applications Engineer
National Instruments

0 Kudos
Message 6 of 18
(4,460 Views)
Megan,
Thanks for the link, I'll check it out. I've figured out what the problem was, the iServer manual had a tidbit of info that I'd overlooked (funny what happens when you read the manuals, eh?) and it turns out that the Newport applications engineer I'd spoken with wasn't quite correct. I had to change the allowable number of connections to the device and a port number.
So, I'm successfully getting data from the meter now, and just need to hammer out the rest of the nuts and bolts of the program. The great thing about being completely confused is that you usually learn a whole lot.

Thanks again!

Message Edited by LabVIEWn00b on 07-18-2006 11:19 AM

0 Kudos
Message 7 of 18
(4,456 Views)
LabVIEWn00b,

Can you post in more detail the ports you changed and some info on your vi? I'm trying to talk to my iserver on the default port 2000. I'm not really getting an error, but i get nothing back when i do the read. Maybe you can post the part of your program where you get data back from the iserver.

I was trying the TCP open, with a TCP write with Data in =*01 and a TCP read.

thanks,
_ALEX
0 Kudos
Message 8 of 18
(4,423 Views)
I don't have Photoshop here at work, so I don't have a way to crop the screenshot down to a reasonable size.
Did you change the number of allowable connections under the Termial Server settings in the embedded webpage? I set it to 2 and that should enable you to use port 2000. I'm sending a *X01, I don't know if *01 works or not.
If I can crop the screenie, I'll post it.
0 Kudos
Message 9 of 18
(4,421 Views)
I have attached what i have setup. Just a basic program. Once i get it to work, it will be come more involved. I also attached my configuration for the iserver.
 here are the links:
http://www.alexlights.com/lv/iserver-read.bmp
http://www.alexlights.com/lv/iserver-cfg.bmp

Thanks for the help.
0 Kudos
Message 10 of 18
(4,409 Views)