LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice DataTable

Hi all,

 

Ive imported a webservice into Labview 2009 using the Wizard provided.  However when I try to display what I am bringing back I experience problems.

It seems to bring back 2 .Net methods aswell as a numeric indicator.

 

What I am trying to import is a datatable.  Is there a particular problem with this particular format?  What is the preferred layout?

 

Thanks in advance to any help I recieve.  Ive been blitzing the web for this for the last couple of days.

 

Cheers,

Rik

 

_________________________________________________________________________________________________

That glass?

Thats glass is neither half full or half empty....
Its twice the size it needs to be
0 Kudos
Message 1 of 4
(2,992 Views)

The DataTable is not a known data type in LabVIEW. You need to extract the contents in order to operate or display the DataTable elements.

 

See this post for an example of extracting the elements.

 

How to convert .net datatable datatype to labview array of strings

 

 


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

Message 2 of 4
(2,980 Views)

Thanks alot, that kind of makes sense but Im still very new to Labview so it may well take a while to get my head around.  Having just had a talk with my boss we going to reconstruct the webservice to output xml instead so that I can parse my way through it.  Still annoying but a fair bit easier than that example!

 

Cheers,

Rik

_________________________________________________________________________________________________

That glass?

Thats glass is neither half full or half empty....
Its twice the size it needs to be
0 Kudos
Message 3 of 4
(2,976 Views)

Using XML data in LabVIEW is hard.

 

OK. I've just bummed you out. Why are you using LabVIEW in the first place, right?

 

LabVIEW is a dataflow language. That means that in order to write your program, you need some sort of definition for the data that will flow over the wires. The DataTable object and XML data do not represent a fixed data definition. These structures are normally manipulated by programming languages that rely heavily on pointers within the data.

 

The example I pointed you to is effectively extracting (copying) all of the data from the DataTable and placing it onto wires where it can be manipulated by LabVIEW. You need to know the structure of the data in the DataTable in order to extract it and create LabVIEW data.

 

The Import WebService wizard is pretty good; as long as you keep your data types simple. For example, if you import this WSDL definition:

 

http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl

 

you should  have two 'get' type functions. Each one will return a cluster of data based on the zip code provided.

 

The cluster includes strings, a Boolean, and an array of references to a forcast object that contains a forcast for each day. Each forcast element includes a timestamp, string, and arrays of references to max/min temps and an integer value for the WeatherID.

 

What you want to do is export your data from your service in a way that you will create simple data types; strings, Booleans, integers or floats, and arrays of these types...

 

Try the example Weather service and get your feet wet before trying to modify your WebService...


Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.

"You are what you don't automate"
Inplaceness is synonymous with insidiousness

0 Kudos
Message 4 of 4
(2,961 Views)