CVI RT (Real Time) - HOST TCP/IP Communication

Hi,
I am using CVI 2012 Real Time with PXI hardware. I am using TCP/IP communication b/n RT and Host. RT is server and Host is client. In my application, after TCP connection is established between client and server, client will send a command , take for example "GET_DATA" to RT, RT has to respond to that by sending that data.
I am successful in
Establishing RT-Host TCP communication ( I am able to see that host is reading the welcome message sent by RT).
Host is sending the command "GET_DATA" to RT.
RT is receiving the "GET_DATA" command from Host.
In TCP server call back function, in TCP_DATAREADY event, i am using ServerTCPRead() to read data from Host. After reading the data, i am comparing the data with expected command and based on that i will be sending the data using ServerTCPWrite().
RT is reading the command from Host, but it is not writing the data to client. I am not sure whether I can use ServerTCPWrite() in TCP Server call back function.
I also tried using multithreaded concept, but not getting success.
Please suggest any solution for this.
Thanks,
Haari

Hey Rashid,
Check out this tutorial with examples and let me know if it helps.
Stephanie O.
DIAdem Product Manager
National Instruments

Similar Messages

  • SetAsyncTimerAttribute ASYNC_ATTR_INTERVAL fails to reset timer on Real-time system

    The interval timer does not get reset when using a timer created in a real-time program (PXI chassis using NewAsyncTimerWithPriority).  It works correctly on a non real-time system (Windows 7 Laptop using NewAsyncTimer).
    Example of problem:
    timer is set to 20 seconds (NewAsyncTimerWithPriority)
    wait 15 seconds
    timer interval is set to 30 seconds (SetAsyncTimerAttribute ASYNC_ATTR_INTERVAL)
    timer fires 5 seconds later instead of 30 seconds
    GetAsyncTimerAttribute returns the correct value as if it worked properly.  Note that the timer fires every 30 seconds after the early firing in step 4.  It appears that changing the interval on a real-time system does not reset the timer as stated in the help file "If the timer has already started, setting ASYNC_ATTR_INTERVAL resets the timer."
    Am I doing something wrong?  Has anyone seen this problem?
    Using: LabWindows/CVI 2012, Real-time module 2012.
    Also installed: LabView 2012, Real-time module 2012, FPGA module 2012.
    Thanks.

    Hi Moxcoak,
    You are right this is a known issue, the async timer does not reset properly in a RT system from CVI. We have already filed a bug report on it (#387902) and I will add your service request to that corrective action report to hopefully push it to be resolved faster. Meanwhile, I will try to find the best workaround for you. One option is to set a flag with the communication thread and check it with another asynchronous thread. I will get back to you with the details on how to implement that, but it would depend on your setup.
    Regards,
    Basil Beirouti
    Applications Engineering
    National Instruments
    Regards,
    Basil
    Applications Engineering
    National Instruments

  • Real Time TCP/IP communication

    Hi,
          I am using the following hardware:
         PXIe-1062Q
         PXIe-8108
         PXI-5600 (02 card for 40MHz Bandwidth)
         PXIe-5641R (both inputs are used; one for each PXI-5600)
         PMA-1115
         Labview 2009
         I am using instrument mode to detect the real time hopping signal and writing it to a spreadsheet.
         My question is that how can I transfer data on LAN in real time to create a waveform in software on a remote computer before writing it to spreadsheet.  I am looking for something like real time TCP/IP communication.I have attached my VI. Kindly guide me that how can I do this?
    Thanks and Regards,
    Rashid
    Solved!
    Go to Solution.
    Attachments:
    FOR.vi ‏54 KB

    Hey Rashid,
    Check out this tutorial with examples and let me know if it helps.
    Stephanie O.
    DIAdem Product Manager
    National Instruments

  • Help needed with CVI real time

    Hi,
    I am new to CVI real time and need help related to this. I will explain my scenario:
    1. I have few configuration files (INI). Need to validate the files (range checking..etc) during start of the application.
    2. When user clicks "START" in the user interface on the host machine, I need to generate outputs (analogs/discretes...) based on the settings in the config file and read some inputs from other instruments. ( I/O tasks like generating outputs/reading inputs i am planning to perform in RT side)
    3. From the user interface,  user can also change the config files. if user changes the files, again file validation needs to be performed. After changing the files, if user clicks START, need to take the newly enetered config files to perfom I/O tasks.
    4. I am NOT using reflective memory for my application.
    I am confused in the following area:
    1. File validation during startup , do i have to perform on both host and RT side?????
    2. if configuration files are changed in the host side by the user, how i have to send this latest file names to RT??? I think i should not send file names, i need to read from the file and its contents i need to pass to RT....Pls correct me , I am not sure about this....
    3. If I have to send file contents to the RT, how I have to do that....means i have to use structures,..???
    Please guide me. Any help would be highly appreciated.
    Regards,
    haari
    Solved!
    Go to Solution.

    Hey haari,
    1. File validation during startup , do I have to perform on both host and RT side?????
    This depends on the full range of responsibility for the INI files. If they are all needed simply to change what the I/O tasks are for, then you would technically only need to validate the INI file contents on the RT side. You could, however, validate on both sides if you wanted to. However, I would probably set it up such that I send a validation command to the target, have the target run a component of the code that validates the INI contents based on how I instructed it, and then return a message that says whether or not it met the requirements I specified. However, if you are concerned with offloading that process to the user desktop (instead weighing down the RT controller performance), you could FTP the file off of the controller and perform the validation process on the host side.
    2. if configuration files are changed in the host side by the user, how i have to send this latest file names to RT??? I think i should not send file names, i need to read from the file and its contents i need to pass to RT....Pls correct me , I am not sure about this....
    You can send them to the target over FTP. This can be done programmatically, through MAX, command window, or a Web browser.
    3. If I have to send file contents to the RT, how I have to do that....means i have to use structures,..???
    This is basically addressed in answer to question two. You would not need another structure in your RT code to handle the FTP receive component as this is handled by the FTP Client/Server communication. However, in the event that you successfully FTP a file to the target, you should likely send a message from the host to the target so that the target can respond accordingly and reload the file, reestablish the I/O values, run an idle procedure, or do whatever you like.
    Hope this helps. Have a great day!
    Tim A.
    National Instruments

  • TCP/IP Connecting with Real Time Controller

    I have a host running Labview on a windows XP and a realtime embedded controller on a pxi chassis that acts as the server.  When the realtime is started it automatically goes into listen mode and listens for a connection from the host.  The host opens a connection.  After a valid connection is open the Real-Time side goes into a TCP_Read and the host can then send commands that the real time processes and sends to the FPGA on the pxi-chassis. 
    Now the problem I'm having is how to handle the case when a TCP connection is lost.  I can have the TCP_Read on the real-time error on a time out and then go into a listen mode but this isn't very logical because then the host will have to reconnect each time a time out occurs.  So if I make the TCP_Read timeout be infinite and if the connection is lost (let's say I unplug the ethernet cable and re-plug it back in) then I cannot recover from this and the Real-time will need to be re-booted.
    I've tried to send the Real-time into listen mode if the error code is other than a timeout error (code 56) and have it go back to TCP_read mode if it is a timeout error.  But if the connection is lost by means of a physical way (such as me pulling the ethernet wire and plugging it back in) then the Real-Time never sees that the connection is invalid.  The host on the other hand can detect it bc it will get an error when it's trying to write?
    So my is:
    Is there any way to prevent an infinite loop that needs a reboot and at the same time prevent the host from reconnecting every time there is a timeout?

    Hi SJeane,
    I apologize for taking so long to respond, but I wanted to test this on my end.  In doing so, I realized that using the RT Reboot Controller.vi after the connection is lost does not work because the message to reboot cannot be relayed to the target without communication!  Thus, to solve this problem, we have to approach it a different way.  You mentioned that you tried programmatically clearing errors, but did you try to reestablish connection after clearing the errors?  I tested this on my end with a FieldPoint controller, and the attached VIs resumed operation even after unplugging/replugging the Ethernet cable (no reboot).  Will this solution work for you?
    Peter K.
    National Instruments
    Attachments:
    Reestablish.zip ‏39 KB

  • I need to host a Shared PDF on SharePoint. If it is on SharePoint can only one person comment at a time? I know documents have to be checked out when using SharePoint. I need multiple users to be able to comment in real time and see comments in real time.

    I need to host a Shared PDF on SharePoint 2010. If it is on SharePoint can only one person comment at a time? I know documents have to be checked out when using SharePoint. I need multiple users to be able to comment in real time and see comments in real time. Is this possible?

    try here:
    http://www.bbb.org
    File a complaint with them. Verizon will call you to fix the blunder.
    But remember it is always up to the customer to insure what they are getting and what it costs. Don't trust the word of a sales person who makes their living on getting that sale. Lies, deceit or false promises will be and have been used by sales people for thousands of years.
    Good Luck

  • Real time Java Communication

    I need help on developing a elearning application that enables real time communication. Can anyone help me on how to start to who can help me?

    Hi,
    I pretty new in Java. My understanding of both of the applications is very vague. Can you help me over here? Are those yahoo games considered stand alone?
    Currently i have developed a GUI, bascically an interface for users to communicate. However, that is only a dummy without any event driven. I was wondering what is needed to allow users to communicate real time. For eg...chat function like icq or audio coomunication like video conferencing. Thanks! Pls advise.

  • Real Time Communication

    HI Gurus,
    Can any one tell me what is  REAL TIME COMMUNICATION.
    Also I request information / details on RTCIS.
    Regards
    Ajoy

    Hi Ajoy,
    1.1 Application Scenarios for Real Time Communications
    There are two classes of applications: client and server. Client class applications have one real-time client per computer, such as the traditional instant messenger (IM) application. Server class applications typically act on behalf of multiple users or communicate with many hundreds of users simultaneously. Server class applications are often based around intelligent applications that interact with users. These applications can be divided into two categories: notification Apps that send information to a client and interactive Apps that accept and respond to a client. A third type of server class applications, Web-based clients, interacts with users through a Web server.
    1.2 Notification Applications
    Notification Apps are real-time applications that send information to multiple clients from a centralized server (see Figure 1). The one-way transmission means that clients cannot communicate directly with the notification App. Instead, clients must choose which events they wish to receive by using some other technique, such as a Web application.
    One example of a notification App is an application that notifies all of the users of a particular e-mail server that the server is about to go offline. Another useful notification App would send alerts in cases of severe weather.
    1.3 Interactive Apps
    Interactive Apps are applications that allow multiple clients to communicate with a central server in real-time, as Figure 2 shows. They are different from notification bots in that interactive bots support two-way communications with a client. Using this approach, you can build an application that interacts with users in real-time. Within this scenario, there are two main sub-scenarios. The first provides a user with information and waits for the user to respond, such as an application that notifies users about changes in stock prices and then gives the user the option to buy or sell. The second waits for the user to request a session with the App and then responds to requests that the user supplies, such as a calendar application that allows a user to schedule meetings and other events while receiving reminders just prior to the meeting or event.
    1.4 Web-Based Clients
    Web-based clients provide the same basic functionality as the traditional IM client through a Web interface, thus allowing the widest possible audience to use the application, as Figure 3 illustrates. It also has the side effect of eliminating the need for a user to download local software, which reduces user concerns about the download containing a potential virus. These types of clients are useful to organizations that wish to provide a Web-based front end to their internal IM system. For example, a company might wish to use a Web-based IM client to connect customers with a support group. Doing so maximizes the number of customers that can connect with the support group.
    Real Time Communications Data Flow
    It's critical that organizations planning large deployments of real-time communications applications ensure that those applications can scale to meet the desired goals. The RTC Client API is very efficient for client class applications for which each client runs on its own computer. To build a scalable RTC Client API application that services multiple clients with a single computer, you need to ensure that the application is scalable when you design it.
    The Real-time Communications (RTC) Client API is a set of COM interfaces and methods designed to create PC-PC, PC-phone, phone-phone audio/video calls, or text-only Instant Messaging (IM) sessions over the Internet. Application sharing and whiteboard (An application that displays a window for two users to exchange information) can also be added to PC-PC sessions. Presence information is used to track the location of buddies (or contacts) for communication purposes. This information is available through the RTC Client API on a SIP registrar server.
    The RTC Client API:
    1.Supports multiparty phone-phone calls
    2.Uses SIP-based signaling and presence communications
    3.Integrates with the Microsoft Office RTC proxy and registrar server
    4.Supports provisioning with ITSPs or third-party corporate-deployed servers
    5.Integrates signals over IP and PSTN networks
    I hope this will be useful for you.
    Thanks,
    Swamy Kunche

  • TCP/IP communication with remote host

    Hey guys,I wrote a class for TCP/IP communication with remote host.I am trying to use this class in following way:Its not working.One thing I am not sure about if I can give IP address of the machine while creating a socket.Please take a look at my program and let me know where i am doing wrong.Help me!
    CommunicationAgent commAgent;
    commAgent= new TCPIPCommAgent();
    writer = commAgent.getWriter("CASS");
    /* Send GC request message to CASS */
    writer.print(searchduedateRequestMsg);
    /* Get reader object to read TCP IP response from CASS */
    reader = commAgent.getReader("CASS");
    /* Read response message */
    String respMsg = reader.readLine();
    if(respMsg!=null)
    System.out.println("Search due date Response from CASS is:" +respMsg);
    else
    System.out.println("Error in reading search due date response");
    and here is my class responsible for TCP/IP communication:
    * Created on Jul 15, 2004
    * To change the template for this generated file go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    package com.prtc.commif.framework;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintStream;
    import java.net.Socket;
    import java.net.UnknownHostException;
    import java.util.Properties;
    import com.prtc.commif.framework.interfaces.CommunicationAgent;
    import com.prtc.commif.util.InputResources;
    * @author spolireddy
    * To change the template for this generated type comment go to
    * Window>Preferences>Java>Code Generation>Code and Comments
    public class TCPIPCommAgent implements CommunicationAgent
    public BufferedReader getReader(String system)
    InputResources inputResources = new InputResources();
    Properties props=inputResources.getProperties(system + ".properties");
    Socket socket=null;
    BufferedReader in=null;
    //Get this from the properties
    String hostName = "113.132.192.21";
    //Get this from the properties
    int port = 10103;
    try
    socket = new Socket(hostName, port);
    in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    catch (UnknownHostException e)
    System.err.println("Unable to identify the Host: " + hostName + ":" + port);
    System.exit(1);
    catch (IOException e)
    System.err.println("Couldn't get I/O for the connection to: "     + hostName + ":" + port);
    System.exit(1);
    return in;
    public PrintStream getWriter(String system)
    InputResources inputResources = new InputResources();
    Properties props=inputResources.getProperties(system + ".properties");
    Socket socket=null;
    PrintStream out=null;
    //Get this from the properties file
    String hostName = "113.132.192.21";
    //Get this from the properties file
    int port = 10103;
    try
    socket = new Socket(hostName, port);
    out = new PrintStream(socket.getOutputStream(), true);
    catch (UnknownHostException e)
    System.err.println("Unable to identify the Host: " + hostName + ":" + port);
    System.exit(1);
    catch (IOException e)
    System.err.println("Couldn't get I/O for the connection to: "     + hostName + ":" + port);
    System.exit(1);
    return out;

    Hi,
    Yes, you can specify ip-address as host-address.
    What do you expect the class to do? Why does reader and writer both open sockets?
    What happens when you run the program?
    /Kaj

  • How to programmatically set the real-time CVI startup DLL?

    Dear NI Support Engineer:
    I'm part of a team of software engineers working on a real-time aerospace app at Honeywell (Coon Rapids, MN campus).  We're using LabWindows/CVI 9.0 and three LabView 8.6 real-time modules.
    Up until now, we've been using the CVI debugger to launch our real-time apps or just copying the app DLL to C:\ni-rt\cvi on the real-time box and setting it as the default startup DLL.
    What we need to do now is create our own directory structure at the root of C: on the real-time box (which, by the way, is using the Reliant file system).
    In fact, we have created directory ug7500 at the root of C: on the realtime box, and two subdirectories (one for data and one for results) directly under directory ug7500.  We'd like to place all of our app DLLs in the ug7500 directory and have the ability to change the default startup DLL programmatically.
    We've been using your LabWindows/CVI Real-time File Copy Utility to set the startup DLL whenever we're not using the debugger.  That was just fine for the first stage of our development.
    At this stage, however, we need be able to set the startup DLL programmatically.  We have not been able to find out how to do this from reading the real-time module documentation.
    Can you either point us at some documentation on programmatically setting the default startup DLL, or e-mail us the instructions, or give us a phone call and explain what steps we must take.
    Thank you very much.
    Vic
    763-957-4168

    Hello All,
    For the reference of anyone else trying to do this, you can modify the INI file to change the startup DLL. Using the INI instrument that ships with CVI (C:\Program Files\National Instruments\CVI90\toolslib\toolbox), you can find the StartupDLLs tag and replace the last value with your startup DLL, such as:
    #include "inifile.h"
    #include <cvirte.h>
    static int status;
    static IniText myINIFile;
    int main (int argc, char *argv[])
     if (InitCVIRTE (0, argv, 0) == 0)
      return -1;    /* out of memory */
     myINIFile = Ini_New (0);
     status = Ini_ReadFromFile (myINIFile, "c:\\ni-rt.ini");
     status = Ini_PutRawString (myINIFile, "LVRT", "StartupDLLs", "c:\\NI-RT\\system\\cvi_lvrt.dll;c:\\ni-rt\\system\\nidevldp.dll;nisysapirpc.dll;niorbp.dll;c:\\ni-rt\\system\\mxsemb.dll;c:\\ni-rt\\system\\nipxism.dll;c:\\NI-RT\\cvi\\myStartup.dll;");
     status = Ini_WriteToFile (myINIFile, "c:\\ni-rt.ini");
     return 0;
    Right now, there are some caveates with using CVI 9.0 to manipulate an INI file to be used on an RT target. The INI functions currently add line breaks automatically for large tag values and adds quotes around the values. For many INI files this is ok (such as TestStand INI files), but it will not work on an RT target. To remove these features, modify the following lines of the inifile.c file located in the same directory as the INI instrument:
    1. On line 38, change the default value of INI_NUM_CHARS_PER_LINE from 80 to a large number such as 8000.
    2. Comment out line 953 (newEntry->addMarkerQuotes = addMarkerQuotes;
    Now you should be able to programmatically change the INI file of your target machine and, therefore, change the startup DLLs.

  • How can I check if a file exists in CVI Real Time?

    It would also be nice if the help file designated whether functions were supported in real time or now.
    I tried this:
        if(GetFileAttrs (DataFileName,NULL,NULL,NULL,NULL) == -1)
    Michael Chadwell
    Department of Engine and Vehicle R&D
    Southwest Research Institute
    Solved!
    Go to Solution.

    You can check if a file exists in CVI Real-Time using GetFileInfo function.
    The CVI help provides a list of functions available on CVI Real-Time here: CVI Real-Time Functions
    National Instruments
    Product Support Engineer

  • Is video conferencing and real-time communication available in an on-premise Sharepoint 2013 Server farm?

    Hello Community
        In a Sharepoint 2013 Server on-premise server farm
    is there a way to provide video conferencing and a form of
    real-time communication even taking into consideration
    using Yammer?
        Thank you
        Shabeaut

    Hello Alex Brassington
        Is there a way to embed/make accessible Lync server's audio/video conferencing functionality
    into a SharePoint 2013 Server farm intranet site?
        Shabeaut

  • CRIO and ni 9234 modules not working or communicating through fpga with accelerometers, fpga connected to real time application which is also connected to shared variables linked to modbus slave

    Hi,
    I have a compact rio which has a 4 way chassis attached to that chassis is three ni9234 modules they are linked using fpga to a real time application then using shared variables in the low speed loop that are linked to a modbus slave to communicate with dcs, the ni 9234's have accelerometers connected to them with iepe ac coupled option on the c modules, my problem is the real time application seems to be running okay even when power loss occurs it restarts with no problem and the fpga writes to the portable hard drive bin files fine but without a accelerometer connected I get low noise readings as soon as I connect a accelerometer to any one of the 10 outputs it just goes to a fixed number (0.03125) as soon as disconnect it again it reverts back to reading noise, I have run a scan on the modules and only get a spike when I connect or disconnect the accelerometer, I have tested the voltage at the pins of the module and I get 22 volts dc which makes it more likely that the hardware is not the problem but a software is maybe causing this to hang-up, I attach project and files for your perusal. I also carried out a new project which in scan mode directly linked the module input to shared variable and the same scenerio again. Help would be much appretiated. 
    Many thanks
    Jason
    Solved!
    Go to Solution.
    Attachments:
    logger 2plusmodbus2.zip ‏679 KB

    Whren using waveform acquisition with the 9234s we recommend the following FPGA and RT template.
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/209114
    it can be extended as a data logger with:
    http://zone.ni.com/devzone/cda/epd/p/id/6388
    or using shared variables combined with scan engine
    http://zone.ni.com/devzone/cda/tut/p/id/9851
    The FPGA in all of these, as well as the RT framework have been used successfully by 1000s of users.  I would recommend giving these a try. 
    Preston Johnson
    Principal Sales Engineer
    Condition Monitoring Systems
    Vibration Analyst III - www.vibinst.org, www.mobiusinstitute.com
    National Instruments
    [email protected]
    www.ni.com/mcm
    www.ni.com/soundandvibration
    www.ni.com/biganalogdata
    512-683-5444

  • 2 AIR applications directly communicating with each other in real time

    Building a installation that requires 2 different kiosks to communicate with each other. I'd like to use Adobe AIR to create the individual applications.
    My question is
    Is it possible for 2 separate AIR applications to DIRECTLY communicate with each other in real time, without any server to act as mediator?
    Ideally the only data that would be transferred would be json based.

    Not sure whether this helps; http://www.adobe.com/devnet/air/flex/articles/creating_socket_server.html

  • Real-Time Module architecture

    Hi, (I use LV RT DSC 8.2.1)
    I want to learn how to use the Real-Time Module.
      I have process that is running at a Real Time compact Field Point Target.
    The process should be controlled and monitored by the Target but the triggering of the process should be available at the Host.
    I also want to view the Process progression at the Host screen.
      As far as I understand it I have several options :
    Create a RT FIFO buffer and send the process data to that buffer, and then, use 'TCP Write' to send the buffer data to the Ethernet Network, where it is available to any Host PC at the Ethernet Network to view (by using TCP Read)
    Create a Variable in the Project, and enable his RT FIFO at his properties.
    Control the process at the Target with Shared Variables and read them at the Host.
      Option 3 is the option I have been using so far, ignoring the RT property of the controllers, what are the advantages of using RT module ?
    and when should I consider using them ?
      What is the difference between 1 and 2 and what are their advantages ?
      What important things do I need to consider when I use RT Module  (just several tips if possible) ?
       Sincerely Yours,  Amitai Abramson.

    Hi Amitai,
    You could go through this link to know more about RT FIFO and its use. http://zone.ni.com/devzone/cda/tut/p/id/3934
    and this for communication wizard http://zone.ni.com/devzone/cda/tut/p/id/4676
    Message Edited by mallyaprs on 04-30-2009 03:53 AM
    -Mallya
    " Appreciate and motivate those who help"

Maybe you are looking for

  • Looking to record 3 XLR Mics

    I've been doing my homework on bringing in three separate voice tracks into GB, since that allows for greater post-production flexibility. However, it looks like all the manufacturers are all about 2 mic inputs. Crap! Based on some snooping around he

  • Update options in ui

    hi jdev people., here am using jdev11.1.1.5.0 adfbc. i had af: table in my ui. it had some createinsert,commit,delete operation. what i need? i want to some update operation(button) in my ui. for the purpose updating the existing records. how can i p

  • MAintain Quotation

    hi all While maintaining Quotation conditions system is showing me only price and discount,,,, i want to capture may packing forwarding conditions also in ths  step..... is there ne other setting to incorporate that.... sap mm

  • How to visit my application?

    i am new to oracle product. i deploy a application to application server, this is the summry information: Web Application: D:\jason\jsr168app\jsr168app.war application name: jsr168app Map to URL: /jsr168app can you tell me what is the full url? Is it

  • How to make JScrollpane not to fetch data while scrollbar is adjusting?

    how to make JScrollpane not to fetch data while scrollbar is adjusting? Hi, I need to make the jscrollpane get data only when the scrollbar stops scrolling. for instance if I hold the scrollbar's thumb and drag it to pass 1000 records, I want the vie