LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP-IP communication

Hi,

I have a system with VxWorks and I need communicate with using our network.
I already have communicated with it by an FTP software (WS-FTP).
How can I do something like that using LABVIEW ? (i.e. send commands to the
system, list its resident files, etc.)
I only have the IP number.
I never used that TCP VIs and I don't know how to do that! (What does "port
number" mean ? How I choose that?)
Can someone help me?

Thanks in Advance.

Paula Paro
0 Kudos
Message 1 of 5
(3,616 Views)
"Paro, Paula [CMPS:2721:EXCH]" wrote:

> I have a system with VxWorks and I need communicate with using our network.
> I already have communicated with it by an FTP software (WS-FTP).
> How can I do something like that using LABVIEW ? (i.e. send commands to the
> system, list its resident files, etc.)
> I only have the IP number.
> I never used that TCP VIs and I don't know how to do that! (What does "port
> number" mean ? How I choose that?)
> Can someone help me?
>

Paula

To use TCP/IP you would need a server running at the VxWorks end. (It opens a
port and makes data available to a client at your end.) What you need is a vi
that opens a socket and asks the IP address to list or send files. All my
experience has been with TCP/IP server-clients so I don't know much
about
sockets other than they are in LabVIEW.

Ed
0 Kudos
Message 2 of 5
(3,616 Views)
"Paro, Paula [CMPS:2721:EXCH]" wrote:

> I have a system with VxWorks and I need communicate with using our network.
> I already have communicated with it by an FTP software (WS-FTP).
> How can I do something like that using LABVIEW ? (i.e. send commands to the
> system, list its resident files, etc.)
> I only have the IP number.
> I never used that TCP VIs and I don't know how to do that! (What does "port
> number" mean ? How I choose that?)
> Can someone help me?

Here are a couple of options for FTP operations using LabVIEW:

** If you only need to _read_ content from the remote FTP server:

You might be able to use the DataSocket VIs under the Communication palette
(LabVIEW 5.1 and up). However, keep in mind that DataSocket currently does not
support FTP write operations (only reads), and--more importantly--DataSocket
only supports a specific set of file formats. The officially supported file
types include ASCII text, tab-delimited text, and .wav data. Here is an example
of a URL input to a DataSocket Read VI that causes the VI to retrieve a text
file from a remote server:

ftp://ftp.ni.com/support/00README.txt[text]

I will add that DataSocket file format support is growing, and in LabVIEW 6i you
can read arbitrary file types by telling DataSocket to treat the file content as
text.

** If you need to perform the full range of FTP operations (reads, write,
directory listings, etc.):

The Internet Developers Toolkit (part of the LabVIEW Enterprise Connectivity
Toolset add-on) is a very good way to go. The toolkit provides high-level VIs
for getting and putting files and data as well as lower-level VIs for arbitrary
FTP operations on the remote server. Another advantage of the NI toolkit is
that it provides high-level telnet functionality as well, in case you need to
issue commands to a remote machine from a login shell. More info on the
Connectivity Toolset is available in the NI Catalog:
http://sine.ni.com/apps/we/nioc.vp?lang=US&pc=mn&cid=1017

There may also be FTP-specific toolkits floating around out there from other
sources. Without a toolkit, though, you would be forced to implement the FTP
protocol yourself using low-level TCP reads and writes from LabVIEW. Buying the
NI toolkit would likely be more cost-effective for you.

Hope it helps,
John Lum
National Instruments
0 Kudos
Message 3 of 5
(3,615 Views)
In article <8o3aq9$pld$1@nrchh45.us.nortel.com>,
"Paro, Paula [CMPS:2721:EXCH]" wrote:
> Hi,
>
> I have a system with VxWorks and I need communicate with using our
network.
> I already have communicated with it by an FTP software (WS-FTP).
> How can I do something like that using LABVIEW ? (i.e. send commands
to the
> system, list its resident files, etc.)
> I only have the IP number.
> I never used that TCP VIs and I don't know how to do that! (What does
"port
> number" mean ? How I choose that?)
> Can someone help me?
>
> Thanks in Advance.
>
> Paula Paro
>
>
I suppose you could set up the server on the vxWorks end, but that may
be more difficult to do than doing the server in LabVIEW. Labview has
many TCP/IP vi's that are very
easy to use.

My suggestion... Set up the PC (LabVIEW) to be the Server. Do this by
using the LabVIEW TCP/IP vi's to create a listener. (use any unused port
number between 1024 and 65535 - I believe the lower 1024 are reserved
for system use) Then, via telnet (to the IP addr that you have), you
could kick off a program on your vxWorks system that would attempt a
hookup to the listen port that you created. Its as easy as that. The
listen vi returns a reference when a connection is made and you just use
this reference to write to and read from the connection. (using the TCP
read and TCP write vi's.)

Hope this helps...
Rick


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 4 of 5
(3,615 Views)
To Learn more about TCP/IP look up RFC on the web . These RFC documents are
Request for comment documents and usually refer to different things that
people want to use or have used with TCP/IP . You should be able to locate
at least a partial index of the socket numbers in use. The FTP you used
will be an allocated socket for instance, likewise there are sockets for
mail etc, the list is pretty big . The trick with using TCP/IP with Labview
is working out how many bytes are still to come. If you make your own little
protocol with a client server relationship it is easier. The Labview
examples will give you a clue with that.

"Paro, Paula [CMPS:2721:EXCH]" wrote in message
news:8o3aq9$pld$1@nrchh45.us.nortel.com...
> Hi,
>
> I have a system with Vx
Works and I need communicate with using our
network.
> I already have communicated with it by an FTP software (WS-FTP).
> How can I do something like that using LABVIEW ? (i.e. send commands to
the
> system, list its resident files, etc.)
> I only have the IP number.
> I never used that TCP VIs and I don't know how to do that! (What does
"port
> number" mean ? How I choose that?)
> Can someone help me?
>
> Thanks in Advance.
>
> Paula Paro
>
>
0 Kudos
Message 5 of 5
(3,600 Views)