Showing results for 
Search instead for 
Did you mean: 

Flexiable Communication through TCP/IP or RS-485 using VISA

I am trying to create a flexiable distributed application that can communicate over RS-485 or TCP/IP visa.  The application has a basic Host / Client(Listener) type of Architecture.  What I would like to be able to do is simply to change my Visa resource name from [Com4] to [TCP::] and seemlessly change communication protocals.  The problem I am running into is creating a flexiable visa listener.  I tried using the visa events vi's, but I don't know what the syntax of the visa string should be.  Any thoughts or clarifing questions would be apprecaited.
0 Kudos
Message 1 of 7
From what you describe, it doesn't sound too different than the way numerous instrument drivers are written. If the interface type is serial, then you have to configure the com port (baud rate, etc). Anything else, and you don't need to do anything. Attached is an example from an initialize function in a driver. This code will communicate to any type of instrument just by changing the VISA Resource Name like you want.
0 Kudos
Message 2 of 7

The problem is that I am creating the instrument and I want to change the interface on both pieces, by utalizing the flexability of visa.  In other words I have two labVIEW programs.  One designed to run on a PC the other on a cFP-2020.  Becasue of certain restrictions all communication to the cFP-2020 must take place over RS-485.  That part is straight forward enough.  But I have several clients that need to test the software who don't have access to 485 ports let alone cFP modules.  Not to mention they are consitently traveling.  So the idea is that if I can very simply move from 485 to TCP/IP they could run both pieces on software on there PC and be done with it.  I hope this helps to clarify what I am looking to do.

I realize there are other ways to do this, but I though it could be very helpful to have such a flexable communication path.



0 Kudos
Message 3 of 7
I'm sure I understand all of the details. If you have two pieces of software and these two pieces of software are installed on a client machine with no 485 port or cFP-2020, does the software designed to run on the cfP-2020 run in simulation mode? Wouldn't both front panels be available to the user so that both VISA Resource Names could be set (i.e. localhost and localhost) or can you only set one?
0 Kudos
Message 4 of 7
I can set the resource name on both pieces of software.  And the software is not really running in a simulation mode, currently the cFP is only being used as a real time controller, no IO is being acquired with it.  Let me be more specific.  On one end I need to do something like:
writevisa("This is my data")
data=readvisa(20 bytes)
The problem is I don't know how to do the listenvisa portion of the code, or if it is even possible
0 Kudos
Message 5 of 7
You can set up your FieldPoint Controller as a TCP listener, which you could then access as a TCP resource in VISA from your host computer.  The programming on the controller; however, will need to be completed using the TCP functions which are available in the Communication function pallette, rather than with VISA.

If you have installed LabVIEW RealTime, you should have some example programs available in your example finder which demonstrate how to use these.  The most useful for you will probably be the example entitled "TCP Communication - RT"  This example demonstrates how to listen for an incoming TCP connection, and write data out to it.  Following a similar method you could read from the port as well.
0 Kudos
Message 6 of 7
I am using Compact FieldPoint 2120 with analog I/O to control a robot arm and i am trying to interface a third party device such as a mobile phone (using Java) to program and control the rotation of each joint of the robot arm. I understand this process can be done through TCP/IP or usign DSC software.
For example:
Hosting on TCP port (?) and use the syntax

[newline]::[joint number]::[degree of freedom]::[set to angle in degrees]::

[arm number] = an ascii value 1 or 2 to determine which arm.
[joint number] = an ascii number value.
[degree of freedom] = ascii value x,y or z.
[set to angle in degrees] = ascii value between 0 and 360.

The true is that i have no clue how to set up the interface steps and i will appreciate if someone can suggest an easy way of doing the above steps and which software to use. I am currently using LabVIEW 8.20 for building the control model for the robot arm.
Many thanks
0 Kudos
Message 7 of 7