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::192.168.1.10::3000::socket] 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.

Hi,
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
Bakari

Similar Messages

  • Labview was blocked when building communication through TCP/IP

    I am trying to transfer data between a Labview system with Win2k and a RT system on PXI controller through TCP/IP. A problem is that when the Labview program started to build the communication to RT, the other Labview programs are all blocked. Howerver, the other application programs except Labview are running properly.  

    Thank you Mike.
    I am trying to transfer data through TCP/IP and Ethernet. The source is a Labview RT program in a PXI controller, and the receiver is a Labview 6.1 program in a workstation with Win2k, and here we focus on the program in the workstation. Besides the communication program, some other Labview programs are also running in the workstation in the mean time.
    The problem occurred at the beginning of the TCP connection: during the following several seconds after the communication program started, I cannot access any of the Labview programs (no response when click on any Labview program). Meanwhile, I found that the CPU usage and memory usage were in normal level and I can access any other windows application program properly. So it seems that the communication program held up all the LabVIEW programs when it started to build connection. Do you have any idea?
    Pierce

  • Serial Communication through TCP/IP Socket

    There are several companies offering a serial to ethernet software solution--emulating a terminal server, however they are all for Windows or MAC. I am looking for a starting point, examples, or a final solution (yeah) that is 100% java. In the field, the device is a RS232 LED board connected to a hardware terminal server. The message software writes to a TCP/IP socket. For testing, I would like my notebook's serial port to emulate the terminal server (I have been using TCP/COM from TAL tech for Windows). I bounce back and forth between Windows and Linux (dual boot) and would like one consistent solution for testing on most any platform/flavor.

    Check out this link:
    http://kaffe.iocon.dk/serialjavademo.html

  • Receiving data through TCP Socket

    Hi all,
    I am trying to receive some data through TCP Socket from the
    server using XMLSocketClass. Ther server is responding with some
    data. But I can't access this data in my application. Pls tell me
    the reasons for not working of handler private function
    dataHandler(event:DataEvent):void .
    =============================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.DataEvent;
    import flash.events.IOErrorEvent;
    import flash.net.XMLSocket;
    private var socket:XMLSocket;
    private var nextId:int;
    private var events:ArrayCollection = new ArrayCollection();
    public static var host:String = "34.234.43.97";
    public static var port:Number = 8002;
    public var xml:XML;
    private function connectToServer():void
    socket = new XMLSocket();
    socket.addEventListener(DataEvent.DATA, dataHandler);
    configureListeners(socket);
    socket.connect(host, port);
    //This function is Not working
    private function dataHandler(event:DataEvent):void {
    Alert.show("dataHandler: " + event.data);
    xml = new XML(event.data);
    Alert.show(xml); }
    private function
    configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.CLOSE, closeHandler);
    dispatcher.addEventListener(Event.CONNECT, connectHandler);
    dispatcher.addEventListener(DataEvent.DATA, dataHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
    ioErrorHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    securityErrorHandler);
    private function closeHandler(event:Event):void {
    trace("closeHandler: " + event);
    private function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
    private function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + "
    total: " + event.bytesTotal);
    private function
    securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    /* private function dataHandler(event:DataEvent):void {
    trace("dataHandler: " + event);
    private function connectHandler(event:Event):void
    var obj:Object = new Object();
    obj.id = nextId++;
    obj.eventName="connect";
    obj.timestamp = new Date().valueOf();
    events.addItem(obj);
    private function sendData():void
    var xmlvalue:String=txtData.text.toString() ;
    var xmlfile:String =
    "<command>SndIns<parameter1>0x06</parameter1><parameter2>0x00</parameter2><parameter3>0x7 1</parameter3><parameter4>0x0F</parameter4><parameter5>0x11</parameter5><parameter6>0xFF</ parameter6></command>";
    socket.send(xmlfile);
    Alert.show(xmlfile);
    ]]>
    </mx:Script>
    <mx:HBox width="80%" horizontalAlign="center">
    <mx:TextInput id="txtData" name=""/>
    <mx:Button id="btnConnect" label="Connect"
    click="connectToServer();btnConnect.enabled = false"/>
    <mx:Button id="btnSend" label="Send Data"
    click="sendData()"/>
    <!--<mx:Button label="getData" id="btnGet"
    click="getData()"/>-->
    </mx:HBox>
    <mx:HBox x="10" y="30" width="100%">
    <mx:DataGrid width="80%" height="100%"
    dataProvider="{xml}">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn headerText="Event Name"
    dataField="eventName"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>

    Hi all,
    I am trying to receive some data through TCP Socket from the
    server using XMLSocketClass. Ther server is responding with some
    data. But I can't access this data in my application. Pls tell me
    the reasons for not working of handler private function
    dataHandler(event:DataEvent):void .
    =============================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.DataEvent;
    import flash.events.IOErrorEvent;
    import flash.net.XMLSocket;
    private var socket:XMLSocket;
    private var nextId:int;
    private var events:ArrayCollection = new ArrayCollection();
    public static var host:String = "34.234.43.97";
    public static var port:Number = 8002;
    public var xml:XML;
    private function connectToServer():void
    socket = new XMLSocket();
    socket.addEventListener(DataEvent.DATA, dataHandler);
    configureListeners(socket);
    socket.connect(host, port);
    //This function is Not working
    private function dataHandler(event:DataEvent):void {
    Alert.show("dataHandler: " + event.data);
    xml = new XML(event.data);
    Alert.show(xml); }
    private function
    configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.CLOSE, closeHandler);
    dispatcher.addEventListener(Event.CONNECT, connectHandler);
    dispatcher.addEventListener(DataEvent.DATA, dataHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
    ioErrorHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    securityErrorHandler);
    private function closeHandler(event:Event):void {
    trace("closeHandler: " + event);
    private function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
    private function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + "
    total: " + event.bytesTotal);
    private function
    securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    /* private function dataHandler(event:DataEvent):void {
    trace("dataHandler: " + event);
    private function connectHandler(event:Event):void
    var obj:Object = new Object();
    obj.id = nextId++;
    obj.eventName="connect";
    obj.timestamp = new Date().valueOf();
    events.addItem(obj);
    private function sendData():void
    var xmlvalue:String=txtData.text.toString() ;
    var xmlfile:String =
    "<command>SndIns<parameter1>0x06</parameter1><parameter2>0x00</parameter2><parameter3>0x7 1</parameter3><parameter4>0x0F</parameter4><parameter5>0x11</parameter5><parameter6>0xFF</ parameter6></command>";
    socket.send(xmlfile);
    Alert.show(xmlfile);
    ]]>
    </mx:Script>
    <mx:HBox width="80%" horizontalAlign="center">
    <mx:TextInput id="txtData" name=""/>
    <mx:Button id="btnConnect" label="Connect"
    click="connectToServer();btnConnect.enabled = false"/>
    <mx:Button id="btnSend" label="Send Data"
    click="sendData()"/>
    <!--<mx:Button label="getData" id="btnGet"
    click="getData()"/>-->
    </mx:HBox>
    <mx:HBox x="10" y="30" width="100%">
    <mx:DataGrid width="80%" height="100%"
    dataProvider="{xml}">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn headerText="Event Name"
    dataField="eventName"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>

  • External system to XI through TCP/IP

    Hi Experts,
    I have a scenario where the external system can send messages thru TCP/IP. That will be mapped CC thru RFC
    which adapter has to be used for this scenario??? ne suggestions??
    Regards,
    Teja

    >>I have a scenario where the external system can send messages thru TCP/IP. That will be mapped CC thru RFC
    All transport protocols are working on TCP/IP network. You need to ask the external system's transport ability. Even File can be ftped through TCP/IP network.
    >>which adapter has to be used for this scenario??? ne suggestions??
    Basic protocols are File and HTTP. If you need synchronous communication with RFC. You can try SOAP or HTTP on the sender side too.

  • CANopen communication over TCP/IP

    The NI Modbus Library makes it possible to implement the MODBUS protocol through COMPORT or over the TCP/IP. I would like to implement the NI CAN or the NI CANopen communication through a COMPORT (VISA connection) or secondary through TCP.
    Can anyone purpose solutions to that challenging task?

    There are TCP-IP<->CAN converters that also support modbus, so you can talk modbus TCP towards these.
    The NI CAN does not hold any functions for the frames itself, this is all done through a call function library node, so creating the frames itself manually would be the only option I could think of.
    If anyone else has additional information, please answer, have recently actually stumbled upon the same issue.

  • Communicate a PC with GPRS module through TCP/IP

     I want to exchange data between a PC and a GPRS module.
    One problem i have is that my PC is on a local network and the IP my computer has, is the local IP. The server has a different IP through we connect to the internet. Which IP I must use and how?
    I know almost nothing about TCP/IP (i have use the Labview TCP/IP functions successfully at our local network) and i would like to ask for informations. I know it is a little irrelevant with Labview, but as there are many users who uses GPRS modules, i would like informations about how to connect a GPRS module through TCP/IP. Simple examples will be the best.
    Any informations, links, recommended books, will be highly appreciated.
    Thanks

    Pnt wrote:
    Thanks for answering Rolf.
    To be more clear : i have a GSM/GPRS module (like the well known Wavecom's modules (or Falcom, Telit...)). They accept AT commands and they have a D-sub-9 serial connector. They connect to serial port of the PC. I want to connect to the internet with TCP/IP (by sending AT commands). But i can not find any manual..! The module have some commands for TCP/IP but no explanation or examples. Those modems have no drivers, they accept only AT commands.
    For example i have to set APN and IP Address which i don't understant what i should write to. It is independant of Labview but i do not know where to look for information.
    If someone knows anything similar please reply.
    In that case what I wrote applies fully to you. You do not want to communicate with the modem from LabVIEW itself. You want to use TCP/IP and that means using the Windows socket library that the LabVIEW TCP/IP functions access. The modem then needs to be installed in the Windows system as a dialup adapter. There is really no other way to use a modem, GPRS or not, as TCP/IP communication path. Trying to implement TCP/IP,SLIP/PPP and all that in LabVIEW would be a many man year project with lots of problems and the likely chance that it will never fully work.
    So get your modem to work under Windows so that you can use your browser to view some internet pages and once that works you can also use the LabVIEW TCP/IP functions to communicate with whatever is there.
    Direct communication to the modem through AT commands would only make sense if you wanted to access the SMS facilities in that modem instead. Even that is not exactly trivial as I can attest to, especially if you want to make it work with more than one GSM modem type.
    Your modem manufacturer should be able to give you the necessary modem initialisation string to put your modem into the right GPRS mode and your mobile phone network provider should be able to tell you the dialing number to fill in the dialup configuration. No need to do anything else!
    As Wiebe explained rasdial.exe would then make it possible to connect to the internet under LabVIEW control.
    All in all it's doable but I have spent many hours to get it working last time I did. A few of those were spent waiting on the line for the support persons of the mobile network provider to answer my calls and then playing the ping pong game to get a person that actually knows what a computer is and that it's actually possible to connect a modem to it to use their services.
    Rolf Kalbermatter
    Message Edited by rolfk on 01-09-2008 06:06 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Sending file through TCP/IP

    Hi all,
    I would like to know whether LabVIEW is able to send file through TCP/IP. Can anyone please enlighten me on this. Thank You
    Rgds 

    Hi taytay,
    Of course it is possible !
    Go to function palette >> Communication >> TCP ; I have never used them but here they are.
    Go to Help >> Find examples.. and search for TCP, you'll find example code
    You can also purchase the "internet toolkit" that provide ready to use FTP VIs to send or copy simple/multiple file(s).
    Hope this helps.
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"

  • How to interface instruments through TCP/IP port

    I want to connect an instrument ( which has RS-232 port ) to a Computer Ethernet port through an Ethernet to RS-232/485 Converter. In past I had successfully made many GUI with Java-2 swing to interface instruments via serial ports (COM-1, COM-2 etc.). This time I am interested to do the same thing but through TCP/IP port programming in Java-2 application.
    Please suggest me websites/java tutorial sites where I may get guide line, advice and sample example programmes.
    Avijit

    a_das wrote:
    I want to connect an instrument ( which has RS-232 port ) to a Computer Ethernet port through an Ethernet to RS-232/485 Converter. Ok.
    In past I had successfully made many GUI with Java-2 swing to interface instruments via serial ports (COM-1, COM-2 etc.). This time I am interested to do the same thing but through TCP/IP port programming in Java-2 application.So you first need to understand the protocol of what the converter does. Until you understand this then coding in java is pointless.
    Then you use sockets. There isn't any magic for that part.
    [http://java.sun.com/docs/books/tutorial/networking/index.html]

  • Need help : Reading from DAQ through TCP/IP ?!!

    Hello
    I have two machines running labview connected to a network. Basically,
    I want to read data from a temperature sensor through a DAQ card
    from one machine, and be able to plot the data in a chart in the
    other machine. I'm trying to use TCP/IP feature to do that but it's not
    working.
    There is a VI in the tcp.lib "simple data client.vi " and
    "simple data server.vi" that does the same thing except that
    the data are of type double generated from a sine function and
    a random number generator. So i tried to do the same but since
    the data read from the DAQ has a thick brown line (not sure what
    type) the task was not easy. In the server part i tried to broadcast
    3 things through (tcp write.vi): The type of the data, the l
    ength of the
    string, and the data itself. On the client side i read (tcp read.vi)
    these things and plot the data. But i'm not getting any output on the chart.
    I had to use (Type Cast), (flatten to string) and (unfatten from string)
    in order to get the right wiring. Both VIs run but there is no output
    on the chart.
    I know it's hard to explain in words, but if anyone is interested i can
    give more detai or send the vis to him to look at them. They seem very simple and
    straight forward but i don't know why they don't work.
    Appreciate any help.
    Thanks
    Sami

    Try running the "Remote Device Access Server" (RDA) on hte machine that has the DAQ card in it. You'll find it in NI-DAQ folder under National Instruments in your Start Menu. (guessing you're running Windows here?)
    With this running, you can start MAX on any machine on the network and access and configure the DAQ cards in the remote machine and program an applicaiton just as if the DAQ cards were local. You'll need to know either the remote machines IP address or network name.
    I've used it quite a bit and have never had a problem. The Help inside MAX gives good details on how to set it up and use it.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Capture video through TCP/IP protocol in labview

    Hi Friends, How to acquire video data using TCP/IP read? actually i am trying to control a robot using labview. This robot has WiFi card and has an ip 169.254.0.10. Robot control protocols are already burnt into blackfin processor, of the robot, example.... if i enter 8 in string control of front panel, robot will move forward, 2 is backward, 6 is right and 4 is left. Robot has camera and transmits images through tcp/ip protocols. well.... i am able to establish wifi connection between my PC nd robot and i am able to control it simply by entering corresponding numbers in string control of VI but i am not able to acquire video from the camera through TCP/IP read platelet. ( someone has created a java consol for this robot and i downloaded it from online forum. by running this consol i can control the robot and also accquire real time video) but i want to do the same using labview. please help.
    labview version: 8.6
    NI vision 8.6
    vision acquisition 2009
    robot reference
    robot control protocols: http://www.surveyor.com/SRV_protocol.html
    http://www.surveyor.com/SRV_info.html
    journal: http://www.surveyor.com/cgi-bin/robot_journal.cgi
    Forum: http://www.surveyor.com/cgi-bin/yabb2/YaBB.pl
    Attachments:
    roboimage.vi ‏39 KB

    You do realize that you are not actually reading any data, don't you? Your input to the TCP Read VI is the default which is a value of 0. So in essence you are saying read nothing. Also from reading through some of the information you pasted it appears that the video is streamed via a web browser. There simply reading from a TCP port will not accomplish what you want. Do you have the Interent Toolkit? That has an HTTP protocol implementation which may work for you though I don't think it will have what you want. It looks like you need to send an HTTP GET to retrieve the video image. You could also try using ActiveX or .Net to embed a browser window in your application.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Passing data through TCP/IP

    Hello ! My challenge is this: I have a vi that i have to use as a server and a vi as a client. In the server vi, i want to modify multiple parameters of one graph and these modifications should reflect on the client vi. How can i transmit, through TCP/IP, the modified graph to the client vi/application ? I would appreciate very much a link or a example vi that can show me exactly how such an opperation can be achieved. Thank you!

    You can make the string you pass include any data.  Here is a simple example using an XML string.
    <Graph>
    <Value>1,2,3,4,5,6</Value>
    <Visible>True<\Visible>
    </Graph>
    Send this string on the server side taking a reference to a graph and build a simple vi to generate a string containing  the data you want to send.
    At the client side you parse this string an a loop as set the appropriate property node as the tag dictates.
    I cant think of a precanned solution for this but my morning coffee has not kicked in yet.
    Paul 
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Flatten to string for sending through TCP/IP contains CRLF characters

    Hi,
    I'm using a 'flatten to string' function to send some data through TCP/IP.
    To minimise delays, I use the CRLF mode so that the receive function returns as soon as it receives a CRLF sequence (termination character).
    I noted that every now and then only part of the data is transmitted because the flattened string itself sometimes (albeit rarely) contains CRLF characters.
    I was wondering if this is correct behaviour, or if I'm missing something.I expected flatten to string to produce pure ASCII strings without special characters.
    Now I first have to scan the string and replace possible CRLF characters by some known series of characters and do the opposite on the receiving side, and hope that this particular sequence never occurs.
    Any comment is appreciated,
    Manu
    Certified LabVIEW Developer (CLD)
    Solved!
    Go to Solution.

    mkdieric wrote:
    Hi,
    thanks for the feedback. I'll use the way you describe, by first sending the number of characters to expect.
    Manu
    Make sure you are consistent with the format for the number of butes. That is, always use an 8, 16 or 32 bit value. Which one you use is up to you and will depend on the size of your data. A 32 bit value is the most common size to use. Anyway what I am basically saying is that if you are inconsistent with what size number you use for the size you will get inconsistent results when you read the data since you will be interpretting the size incorrectly some of the time.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Tranfering data to LabVIEW through TCP/IP

    Dear all,
    Hello! I am a new LabVIEW user. What i am trying to do is to transfer
    data from one computer running a commercial package, to a remote
    computer running LabViEW, through TCP/IP. To do that i developed a
    simple LabVIEW code, which establishes a connection first and then
    tries to read data. The connection seems to work, but i get no data.
    After the first TCPread i placed an indicator, to check if data is
    transfered, where i am getting the message "nect"...any ideas on what
    this could mean?
    Any help would be more than welcome!Thank you in advance!
    Ferrari

    I don't think we have enough information to troubleshoot this issue from your description, because there is a nearly infinite number of possibilities to "transfer data via TCP/IP". What kind of "commercial software" is the server you are trying to contact? Is it LabVIEW based? What are the specifications to transfer the data? Are you trying to use low-level TCP or e.g. datasocket?
    LabVIEW Champion . Do more with less code and in less time .

  • UDP communication through proxy

    Hello,
    I've been struggling for hours now trying to work out how to use UDP communication through a proxy. It took me quite a bit of work to get it working for HTTP, but it's working fine now.
    I'm trying to use the DatagramSocket class and there's no option to use a proxy anywhere. I tried setting the proxy globally by doing:
    properties.put("proxyHost", "proxyAddress");
    properties.put("proxyPort", "proxyPOrt");
    properties.put("proxySet", "true");
    but it doesn't work. I get errors on name resolution when I try to connect.
    I'm looking for a global (programmatical) way to set up the proxy, so that I can use the InetAddress too to get IP addresses and such.
    Cheers.

    properties.put("proxyHost", "proxyAddress");
    properties.put("proxyPort", "proxyPort");Those two properties are just equivalents for http.proxyHost/proxyPort. They come from the defunct HotJavaBean (1997-8) and somehow leaked into the JDK, maybe because books of the era mistakenly documented them as part of the JDK, or maybe because part of the HJB implementation leaked into Java.
    properties.put("proxySet", "true");That property has never done anything in the JDK. It did something in the HJB which is no longer with us ...
    There is no support for UDP proxying in Java.
    but it doesn't work. I get errors on name resolution
    when I try to connect.That's a DNS topology issue, nothing to do with proxying really.

Maybe you are looking for