Using TCP or shared variable for data transfer

I am trying to send a large amount of numbers from a real-time module to a host computer.  These numbers have been arranged into a large array, such as an array with 10s of thousands of points.  The time critical portion of getting the information has already been done, so the data transfer back to the host VI is not time critical.  I know I will need to break the large array down into smaller arrays and then reform the large array after all the information has been sent.  I know how to use both TCP and shared variables with FIFO.  What I am unsure of is which one is better to use for this application.  I do not know what the maximum size arrays I can send through either.
Also, from what I have gathered from using LabView is that the sender has to be listening for a connection before the client opens a connection, or else it will throw an error.  When I tried breaking it down into 50 points, if i did not wait long enough in the host VI or if I did not put a long enough wait function in the RT loop, and error would throw, so it would take a long time to transfer the data when it worked properly.
Any help or suggestions is appreciated, thanks.

Regarding the array size question, there is no real limit (other then the amount of memory in your system) to the size of data that you can transfer in a single block using either TCP or the Shared Variable. In your case you can easily transfer an array with 10's of thousands of data points in a single write operation. Both TCP and the Shared Variable will automatically handle breaking up the data for the maximum packet size on Ethernet and then reconstitute the array on the receiving end. In LabVIEW you will simply get back the array as a whole without needing to worrying about how the data is broken into smaller packets on the Ethernet.
I tested the attached example which transfers 400kB per block (50000 Doubles) without any problems. You do need to have the Server (in this case RT) running first before the client (Windows) can connect.
Message Edited by Christian L on 02-09-2007 11:34 AM
Christian Loew, CLA
Principal Systems Engineer, National Instruments
Please tip your answer providers with kudos.
Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
Attachments:
TCP.JPG ‏44 KB

Similar Messages

  • Use of Shared Variables for data transfer from a RT traget to a desktop application

    Hi,
    I want to adopt the shared variables to share data in an existing distributed application comparable with the T3 Benchmark configuration in this document:
    [1] http://zone.ni.com/devzone/conceptd.nsf/webmain/5B4C3CC1B2AD10BA862570F2007569EF
    The current implementation uses a well tuned solution with RT FIFOs and TCP/IP communication with a desktop-PC which monitors and stores the data.
    The desktop application runs with a much slower execution rate than the TCL. So the TCP/IP packets are used to buffer the data with a package size dependent on the data send rate.
    To use the shared variables instead of this RT FIFO + TCP/IP implementation I need to read the shared vairable buffer at once each time the desktop application reads the shared variable.
    But according to this quotation from [1]:
    "With buffering, you can account for temporary fluctuations between read/write rates of a variable. Readers that occasionally read a variable slower than the writer can miss some updates."
    this seems to be impossible. Am I right?
    Are there any suggestions to circumvent this problem? Or are shared variables not made to share data between unsynchronized processes without data loss?
    Regards Till

    You can use the error-cluster to detect the end of your queue. The erroroutput of the shared variable will return a -2220 Warning, if it reads a value it has read already before. I attached a modified example and saved it for 8.2 I hope you can open it.
    Attachments:
    readbuffered82.zip ‏51 KB

  • Using Nokia 1200 CA45 connection for data transfer

    I have a USB CA45 connector but am unable to connect my 1200 to PC for data transfer. Is this simply because this entry level phone is not able to connect to PC. If so why does it have a CA45 connector installed?
    Any help or advice appreciated
    ottoman62

    About my problem above, i followed the process below which is written in the user guide :
    "So that you can use a connection by cable, a pilot of cable of data USB must be installed on your PC. You can use the Transfert functionality of data without installing of pilot of cable of data USB. Select Menu > Connectiv. > Câble USB. You can connect your apparatus to a compatible PC using a cable of data USB.
    Connect the cable of data USB on the basis of the apparatus. To
    change the type of equipment that you normally connect to your
    apparatus using the cable of data, support on the joystick. [...]
    Transfer of data - Reach data such as audio or photo files on your computer and transfer them since this one by using a connection by cable of data. To use the Transfer mode of data, take care not to select the type of connection USB in
    the parameters Manage connections of Nokia PC Continuation. Insert a memory board in your apparatus, connect this one to a compatible computer using the cable of data USB and, when the apparatus you request to indicate the mode used, select Transfert of data. In this mode, your apparatus plays the part of peripheral of storage of mass and, on your computer, it seems a removable hard disk."
    The USB cable used is a Nokia device.

  • Is there any support for data transfer compression in oracle XE?

    Hi
    Thank you for reading my post.
    I am wondering whether it is possible to ask database and JDBC driver to use some sort of compression for data transfer?
    I want to reduce the network workload as much as possible.
    Thanks

    AFAIK, Not directly from Oracle.

  • Need to build communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer

    Hi - I would like to build the logic in which it should accomodate the communication redundancy using serial RS-232 for Data Transfer b/w Host and RT irrespective of TCP/IP Data Transfer.
    I want to do data transfer b/w host and RT through RS232 VISA portal whenever TCP/IP ethernet cable has been unplugged from the controller continuosly , it should keep on checking for TCP/IP link re-establishing also , when ever the tcp/ip link established again that time the communication should be using in that link only. This is accomplished by deploying the RT vi as execuatbale file. I made some logic regards to the above said logic , bur it was not working as much I expected.
    I request you to go through the attached two VI's and let me know , what I did wrong in that,
    Please do the needful.
    Attachments:
    TCP_Serial_Host.vi ‏33 KB
    TCP_Serial_RT.vi ‏41 KB

    even i am new to this topic and i am trying to get familiar with these protocols
    refer to tcp server/client examples in labview examples

  • HT5287 If DVD Movies, Audio CD's and even burning CD and DVD's are not supported, what is the point of DVD & CD Sharing then? Wouldn't it just be better to remote in or use a thumb drive if it's only able to be used for data transfer?

    If DVD Movies, Audio CD's and even burning CD and DVD's are not supported, what is the point of DVD & CD Sharing then? Wouldn't it just be better to remote in or use a thumb drive if it's only able to be used for data transfer?
    Or am I missing the bigger picture?

    As long as you have a Superdrive or an external burner/drive, burning, watching, installing, etc. from CD or DVD will work just fine. And so will sharing.

  • Advantages of using BAPI over LSMW for data transfer

    Hellow,
    Can anybody please give an input for advantages of using BAPIs in data transfer compare to LSMW. If we use BAPI for data transfer of master and transaction data how it is more usefull compare to LSMWs developed.
    Thanks in advance
    Raghav

    Hi Raghavendra,
    Refer the links..may help.....
    [http://www.*******************/search?q=BAPIandLSMW+comparision]
    [http://www.*******************/search?q=bapi]
    Regards,
    Mdi.Deeba

  • Modbus Ethernet read and write to a Eurotherm 6180XIO Modbus server using LV8.2 shared variables

    I am having EXTREME difficulty trying to establish communications with a Modbus device using LV8.2 shared variables.  The device is a Eurotherm 6180XIO Datalogger configured as a Modbus master.  The PC and a cFP-1804 are slaves.  All IP addresses are set correctly.  This approach using shared variables would seem simple, but I can't find any examples or proper guidance on how to get it working.  I am trying to avoid having to mess around with TCP/IP, OPC, or any other old-fashioned method.
    I have read many threads on related topics but none directly apply to this situation.  I have created a library containing a Modbus I/O server and shared variables bound to read and write holding registers.  I have followed all recommended tips for creating such variables but I can neither read or write data.  All data types are U16 due to Modbus protocol limitations.  I have also applied the LV x10 factor in the most significant digit in the register offset (6 digits instead of 5).
    I have a cFP-1804 on the same network which reads into the datalogger OK.  The registers I use are 31000 (for CH0 on module 0, 31002 for CH1, etc) and the data can be read as FLOAT32.  I have updated the firmwate on the 1804 to the latest level.  I cannot even get shared variables to read SGL values.  Using registers 301001 for CH0 and 301002 for CH1 I can only read U16 values, and not a 2-word SGL.
    Third party Modbus simulation software is able to write to and read from registers very easily, but not LabVIEW.
    Some questions are:
    - do I use a Modbus master or slave as an I/O server in the library as a target for binding the shared variables?
    - is there some other wierd translation in register offsets between LabVIEW and traditional Modbus?
    - is this actually possible using shared variables or am I wasting my time?

    Sending the whole 60-character string using a string or array would be the most efficient.  I have tried both methods, and these only cause the datalogger to flag a message log but no text is displayed.
    For a string variable, I have used the following binding "My Computer\Modbus Test.lvlib\ModbusServer6180\442305", where ModbusServer6180 is a Modbus I/O server configured with the logger IP address, and 42304 is the register offset at the start of the text block in the logger.  I need to write to 30 consecutive registers starting with this one.  I am not using buffering and have not enabled single writer.
    Can anyone confirm whether this method should work in 8.2?
    Does the string need a special termination character?

  • Shared Variables for Real-TIme Robot Control

    I'm really stuck in my efforts to use LV real-time in my hardware control application. I have a 6-axis industrial robot arm that I must control programmatically from my PC. To do this I've developed a dynamic link library of functions for various robot control commands that I can call using Code Interface Nodes in LV (using 8.5). This has worked great, that is, until I tried to port parts of the application to a real-time controller. As it turns out, because the robot control dll is linked with and relies so heavily upon several Windows libraries, it is not compatible with use on a RT target, as verified by the the "DLL Checker" application I downloaded from the NI site. When the robot is not actually executing movements, I am constantly reading/writing analog and digital I/O from various sensors, etc.....
    This seemed to suggest that I should simply segregate my robot commands from the I/O activities, using my host PC for the former, and my deterministic RT loop on the target machine for the latter. I set up a Robot Controller Server (RCS) vi running on my host PC that is continuously looking for (in a timed loop) a flag (a boolean) to initiate a robot movement command. Because several parameters are used to specify the robot movement, I created a custom control cluster (which includes the boolean variable) that I then used to make a Network Shared Variable that can be updated by either the RT target or the host PC running the RCS. I chose NOT to use buffering, and FIFO is not available with shared variables based on custom controls.
    Here's sequence of events I'd like to accomplish:
    1) on my host PC I deploy the RCS, which continuously pools a boolean variable in the control cluster that would indicate the robot should move. The shared variable cluster is initialized in the RBS and the timed loop begins.
    2) I deploy the RT vi, which should set the boolean flag in the control cluster, then update the shared variable cluster.
    3) an instance of the control cluster node in the RCS should update, thereby initiating a sequence of events in a case structure. (this happens on some occassions, but very few)
    4) robot movement commands are executed, after which the boolean in the control cluster is set back to its original value.
    5) the RT vi (which is polling in a loop) should see this latest change in the boolean as a loop stop condition and continue with the RT vi execution.
    With the robot controller running in a timed loop, it occassionally "sees" and responds to a change of value in members of the shared variable cluster, but most times it does not. Furthermore, when the robot controller vi tries to trigger that the movement has completed by changing a boolean in the control cluster, the RT vi never sees it and does not respond.
    1) Bad or inappropriate use of network shared variables?
    2) a racing issue?
    3) slow network?
    4) should I buffer the control cluster?
    5) a limitation of a custom control?
    6) too many readers/writers?
    7) should I change some control cluster nodes to relative, rather than absolute?
    8) why can't I "compile" my RT vi into an executable?
    Any help would be greatly appreciated. Unfortunately, I'm writing this from home and cannot attach vi files or pictures, but would be happy to do so at work tomorrow. I'm counting on the collective genius in the universe of LV users and veterans to save my bacon.....
    David

    Hi David,
    I'm curious why you decided to build a CIN instead of developing the code in
    LabVIEW.  Is there some functionality that that LabVIEW couldn't
    provide?  Can you provide some more information about the LabVIEW
    Real-Time target you're using?  What type of IO are you using?
    It is impossible to get LabVIEW Real-Time performance on a desktop PC running
    an OS other than LabVIEW Real-Time.  Even running a timed loop in LabVIEW
    for Windows won't guarantee a jitter free application.  Also, no TCP based
    network communication can be deterministic.  This means Network Shared
    Variables are also not deterministic (they use a TCP for data transport) and I
    advise against using them as a means to send time critical control data between
    a Windows host and a LabVIEW Real-Time application.
    In general, I would architect most LabVIEW-based control applications as
    follows:
    - Write all control logic and IO operations in LabVIEW Real-Time.  The
    LabVIEW Real-Time application would accept set points and/or commands from the
    'host' (desktop PC).  The Real-Time controller should be capable of
    running independently or automatically shutting down safely if communication to
    the PC is lost.
    - Write a front-end user interface in LabVIEW that runs on the desktop
    PC.  Use Shared Variables with the RT-FIFO option enabled to send new set
    points and/or commands to the LabVIEW Real-Time target.
    Shared variable buffering and RT-FIFOs can be a little confusing.  Granted
    not all control applications are the same, but I generally recommend against
    using buffering in control applications and in LabVIEW Real-Time applications
    recommend using the RT-FIFO option.  Here's why:  Imagine you have a
    Real-Time application with two timed loops.  Time-loop 'A' calculates the
    time critical control parameters that get written to hardware output in
    timed-loop 'B'.  Loop 'A' writes the outputs to a RT-FIFO enabled variable
    with a RT-FIFO length of 50.  Loop 'B' reads the outputs from the shared
    variable, but for some reason, if loop 'B' gets behind then the shared variable
    RT-FIFO will now contain several extra elements.  Unless loop 'b' runs
    extra fast to empty the RT-FIFO, loop 'B' will now start outputting values that
    it should have output on previous cycles.  The actual desired behavior is
    that loop 'B' should output the most recent control settings, which means you
    should turn off buffering and set the RT-FIFO length to 1.
    There is also a clear distinction between buffering and the RT-FIFO
    option.  The RT-FIFO option is used to add a non-blocking layer between
    network communication and time-critical code in LabVIEW Real-Time
    applications.  It also provides a safe mechanism to share data between two
    loops running in a Real-Time application without introducing unnecessary
    jitter.  Network buffering is a feature that allows a client to receive
    data change updates from the server even if the client is reading the variable
    slower than the server is writing to it.  In the example I presented above
    you don't need to enable networking because the shared variable is used
    entirely within the Real-Time application.  However, it would be
    appropriate to send control set points from a Windows PC to the Real-Time
    application using network published shared variables with the RT-FIFO option
    enabled.  If it is critical that the Real-Time application executed all
    commands in the sequence they were sent then you could enable an appropriate
    buffer.  If the control application only needs the latest set point
    setting from the Windows host then you can safely disable network buffering
    (but you should still enable the RT-FIFO option with a length of 1 element.)
    Network buffering is especially good if the writer is 'bursty' and the reading
    rate is relatively constant. In the robot application I can imagine buffering
    would be useful if you wanted to send a sequence of timed movements to the
    Real-Time controller using a cluster of timestamp and set point.  In this
    case, you may write the sequence values to the variable very quickly, but the
    Real-Time controller would read the set points out as it proceeded through the movements.
    The following document presents a good overview of shared variable
    options:  http://zone.ni.com/devzone/cda/tut/p/id/4679
    -Nick
    LabVIEW R&D
    ~~

  • What is the best way to create shared variable for multiple PXI(Real-Time) to GUI PC?

    What is the best way to create shared variable for multiple Real time (PXI) to GUI PC? I have 16 Nos of PXI system in network and 1 nos of GUI PC. I want to send command to all the PXI system with using single variable from GUI PC(Like Start Data acquisition, Stop data Acquisition) and I also want data from each PXI system to GUI PC display purpose. Can anybody suggest me best performance system configuration. Where to create variable?(Host PC or at  individual PXI system).

    Dear Ravens,
    I want to control real-time application from host(Command from GUI PC to PXI).Host PC should have access to all 16 sets PXI's variable. During communication failure with PXI, Host will stop data display for particular station.
    Ravens Fan wrote:
    Either.  For the best performance, you need to determine what that means.  Is it more important for each PXI machine to have access to the shared variable, or for the host PC to have access to all 16 sets of variables?  If you have slowdown or issue with the network communication, what kinds of problems would it cause for each machine?
    You want to located the shared variable library on whatever machine is more critical.  That is probably each PXI machine, but only you know your application.
    Ravens Fan wrote:
    Either.  For the best performance, you need to determine what that means.  Is it more important for each PXI machine to have access to the shared variable, or for the host PC to have access to all 16 sets of variables?  If you have slowdown or issue with the network communication, what kinds of problems would it cause for each machine?
    You want to located the shared variable library on whatever machine is more critical.  That is probably each PXI machine, but only you know your application.

  • Establish a connection through RF modem's on client & server side & to set up PPP communication for data transfer

    hi
    can any1 over here help me out in how to establish connection between 2 RF modem's for data transfer , between client & server USing LABVIEW?
    I want to establish a connection between 2 PC's through  RF modem on client & server side & to set up PPP communication for data transfer.
    (I have tried data transfer through RS-232 using TCP/IP whn the 2 PC's are connected over ethernet... which is working.
    I also tried connecting loopback cable between 2 PC's COM port & geting data transfer using VIsa configure serial port & other visa functions  ... which is working)
    can u guide me how to establish connection between 2 RF modem's using LABview?
    & how does the data transfer take place between 2 RF modems through RS-232?
    is it using TCP/IP?
    If you got any links to go abt this issue do send me related links .. or any examples .....
    I am currently using Labview version 8.
    Waiting in anticipation.. reply ASAP..
    thanking you
    Regards
    Yogan..

    Howdy yogan,
    Maybe you could clarify a few things for me, and we'll see how we can help ya. TCP/IP protocol occurs through an ethernet connection; RS-232 communication occurs through an RS-232 serial connection, typically through a cable that has a DB9 connector on both ends. Do you mean that the RF modems in question have the option to communicate via RS-232 and/or via TCP/IP ethernet? Specific information like the manufacturer of your RF modems, the model number of your RF modems, and how you connect the modems to the PC would enable us to give you more efficient support.
    You can check our Instrument Driver Network (IDNet) to see if a plug-and-play/IVI driver already exists for your RF modem. (You'll need to know its manufacturer and model number.) In the case that you do find an IDNet driver for your modem, you can use this KnowledgeBase article for instructions on how to use the driver.
    Another excellent resource to consider is the NI Example Finder. You can access this within LabVIEW by navigating to Help»Find Examples and then searching for serial or TCP/IP examples.
    Message Edited by pBerg on 03-10-2008 04:35 PM
    Warm regards,
    pBerg

  • JPA - Best Practice For Data Transfer?

    I've been considering an alternative method for data transfer between applications, by using Serialized or Encoded to File JPA Entities. (either Binary or XML)
    I know this procedure may have several draw backs as compared to traditional exported SQL queries or data manipulation statements, however, I want to know if anyone has considered or used this process for data transfer?
    The process would be to
    - query the database and load the JPA Entities
    - Serialize or Encode them to file
    - zip up the entire folder with the JPA entities
    - transfer the data to destination machine
    - extract the data to a temp directory
    - reload the JPA entities by de-serializing and persisting them to the database
    The reason I'm considering this process, is basically because I have a desktop application (manages member records, names, dates, contributions, etc) used by different organisations in different locations (which are not related except by purpose ie clubs or churches) and would like to have a simple way of transporting all data associated with a single profile (information about a member of the organisation) from one location to another in a simple way, ie users interact only with the application without the need for any database management tool or such.
    I'm also considering this because it is not easy to generate an SQL Script file without using a dedicated Database Management Tool, which I do not want the application users to have to learn how to use.
    I would appreciate ANY suggestions and probable alternative solutions for this problem. FYI: I'm using a Java DB database.
    ICE

    jschell wrote:
    In summary you are moving data from one database to another. True
    You only discussed flow one way. Well the process is meant to be bi-directional. Basically what I envision would to have something like:
    - the user goes to File -> Export Profile...
    - then selects one or more profiles to export
    - the export process completes and the zip archive is created and transfered (copied, mailed, etc) to the destination location
    then on the destination pc
    - the user goes to File -> Import Profile
    - selects the profile package
    - the app extracts, processes and imports the data (JPA serialized for example)
    Flow both ways is significantly more complicated in general.Well if well done it shouldn't be
    And what does this have to do with users creating anything?Well as shown above the user would be generating the Zip Archive (assuming that is the final format)
    Does this make the problem clearer?
    ICE

  • The i pod module for data transfer

    Recently i put i pod into enable disk use function so i could use the i pod for data transfer i went into MY computer then located the i pod service module i went to put it onto my desktop but it said module is being used by another program but it isnt atall. When i put in data like my spreadsheets onto the module dragging them it doesnt appear on the i pod module in the i tunes why is that? What do i have to do to make sure i can see that the data is recieved onto the i pod thanks mr roberts

    Hi,
      Retrieve data file from presentation server(Upload from PC)
    DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'. 
    DATA: begin of it_datatab occurs 0,
      row(500) type c,
    end of it_datatab.
      CALL FUNCTION <b>'GUI_UPLOAD'</b>
           EXPORTING
                filename        = i_file
                filetype        = 'ASC'
           TABLES
                data_tab        = it_datatab  "ITBL_IN_RECORD[]
           EXCEPTIONS
                file_open_error = 1
                OTHERS          = 2.
    Pls reward points.
    Regards,
    Ameet

  • E-Rec: XI for data transfer

    Hello Experts,
    I am working on an implementation project where SAP E-Rec is on different box. We are on EhP5. We have XI for data transfer between both the systems (ECC and E-Rec). Now, when we use RFC to connect these systems, we use PA48 in ECC to hire candidates as employees which in turn pulls data from T752F table. Now as we are using XI, how/where does data flow?
    Also, please guide in case candidate is a rehire, how and where to capture his previous perr number to validate candidate is actually an old employee? Instead of T752F, which table is populated which creates an entry in HR admin's UWL. Please help understand.
    Thanks and regards,
    E-Rec Beginner!

    Hello,
    Please have a look at the attachment of note 997181 where the HR integration process is explained.
    Regards
    Nicole

  • Control parameters for data transfer

    Hi!
    There are no data in SBIW source system - General Settings - Maintain Control Parameters for Data Transfer.
    How does it have an influence on loading data?

    Hi,
    Maximum size of a data packet in kilo bytes
    The individual records are sent in packages of varying sizes in the data transfer to the Business Information Warehouse. Using these parameters you determine the maximum size of such a package and therefore how much of the main memory may be used for the creation of the data package. SAP recommends a data package size between 10 and 50 MB.
    Frequency with which status Idocs are sent
    With this frequency you establish how many data IDocs should be sent in an Info IDoc.
    Standard settings
    Frequency 1 means, for example, that there is an Info IDoc for every data IDoc. In general, you should choose a frequency between 5 and 10 but not greater than 20.
    Recommendation
    The larger the packet size for a data IDoc, the smaller you should set the frequency. By doing this, you make it possible to get information on the respective data load status in relatively short time periods when uploading data.
    Maximum number of parallel processes for data transfer
    Select a number greater than 0.
    Parallel processes can be set from the SAP core release 3.1I onwards.
    These parameters are, therefore, ignored in releases before 3.1I.
    However, there is a possibility of importing the SAP release 3.1I into earlier releases.
    The more parallel processes that can run the better the performance of your system will be. However, you must bear in mind the number of available dialog processes here.
    It will be fine and more effective if you use sap recomended values in those respective fields

Maybe you are looking for