Data socket open?

I have one computer with a data socket that I write some waveforms to
at ~ 1Hz.  I have another computer that reads out that data, and
logs it.  My problem is that sometimes, I have to stop the vi on
the data socket server machine, at which point, the second machine
running the "data socket read vi" stops and gives an error, since the
datasocket no longer exists.  Is there some way for the reader
machine to test to see if the datasocket exists, and if not, I'll just
write zeros or keep testing until it's open again?  I don't want
to have to go over to the other machine and restart the vi every time
this happens.
thanks.
Jesse Wodin

Hello,
One way to do it would be to simply check for that error in your loop.  If it occurs, you know the connection was lost, otherwise you're receiving data!
Will this work for your application?
Thank you,
JLS
Best,
JLS
Sixclear

Similar Messages

  • What is the purpose of open/close connection data socket?

    Hello everyone,
    I am writing and reading values in OPC Server through data socket. What is the purpose of open/close connection data socket when writing /reading a value?  Without the open/close connection element, it still work correctly. I am writing values in the server thru event stucture.I do not need any buffered reading or writing. What will happen if I didnt not use the open/close connection? Maybe it may cause some problems in my program which i didnt realise? 
    And I have attached an example of my program. Thanks
    Yehchia
    Attachments:
    Test Event.vi ‏11 KB

    Hi YehChia,
    I was talking about something like that:
    1. Not good. since with every iteration the DS connection needs to be opened and closed.
    2. Good. Since you open the connection only once then do the reads and close it afterwords.
    Christian

  • Data socket problems with LVRT 8.2

     I am in the process of migrating to LV 8.2 from LV7.1.1. My system has 18 RT targets which send data to a Host PC through data socket (DS). The Host PC runs LV on Windows XP Pro.  With LV7.1.1 on both host and RT targets DS works perfectly. The RT targets update the host every 500 ms.
    I've taken a three-step process in the migration. First tests were done with the host migrated to LV8.2 while keeping the RTs at LV7.1.1. Result: the system worked perfect. Then I changed one RT to 8.2 keeping the rest the rest at LV7.1.1. Result: DS timed out before all the data could be sent to Host. Finally, all RTs were migrated to LVRT 8.2. Result: Only about 5 out of the 18 RTs report to the Host before DS times out. However, if only one RT target is used, i.e., the other 17 RTs are diasbled, communication is very fast. Is there a special setting that I need to make? Btw, the roughly 5 RTs that report vary randomly from test to test, i.e., there is no bias towards any particular RTs.
    I am using the same source code developed under LV7.1.1, so the only changes made are the ones that take place when one opens LV7.1.1 code in LV8.2. Some VIs get converted in the process.
    Any ideas?
    Chatonda Mtika
    Algis Corp
    Vancouver, Canada

    Ben,
    I must say I am very surprised by Nadim's email. His point, which I must say I don't agree with, was made quite clear to me yesterday during a conference call between my team and the NI team comprising Chris, Nadim, and Avinash. So I don't know what purpose this morning's email is supposed to serve. Be that as it may, I think NI has gotten it wrong here. I do not think it should be one or the other. The discussion forum is a much wider forum comprised of people with varying experiences - not just NI employees. That is precisely why I posted my problem to the forum: to tap into the vast experiences of the discussants. But when I did not get any responses after I had posted answers to Nadim's questions, I decided to make a formal service request to NI, all perfectly legal. So I was really surprised when I was being blamed for tying up NI resources on one problem. I believe the resource allocation issue should be NI's to solve, not mine. I have no way of knowing that NI had formally assigned somebody to my problem. What if nobody from NI responds, am I allowed to make a service request to NI? My feeling is that NI's logic is flawed here, assuming Nadim's views are NI's views.
    Thanks,
    Chatonda Mtika
    Algis Corporation
    Vancouver, Canada

  • Data socket port

    I want to serve data sockets over the internet. I can get them to work over our local network (all the computers are 192.168.1.100, etc), but they're not working beyond our local network. Do I need to forward port requests on our router to enable this (we just have a simple DSL modem and a router)? In Labview, looked under Tools >> Options >> Vi Server Configuration and see Port 3363 listed. Is this the port that data sockets work on? If so, do I just need to configure the router to forward port 3363 requests to my computer that is running the data socket server?
    Alex

    Hi Alex,
    It sounds like you have the right idea. Datasocket uses port 3015, so you should be able to forward requests to this port to a certain local IP address. The links below might be of some help to you:
    Error 63 When Using DataSocket
    http://digital.ni.com/public.nsf/websearch/CE62D869535D602F86256D330060F5F1?OpenDocument
    What Ports Do I Need to Open on My Firewall for National Instruments Software Products?
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/fe6a63983ac8289e86256b22005a067a?OpenDocument
    Hope this helps,
    Travis H.
    LabVIEW R&D
    National Instruments

  • Data Socket related Crash

    Greetings,
    I have an LV 8.6 HMI that performs Data Socket reads
    from Network Shared Variables. I am finding that it works well until I
    try to shut down and close all the DS references. I can usually get
    away with this
    once, but if I try to restart the application I often
    will not be able to reopen the DS reference and it will always crash
    when I try to shutdown again. I have narrowed it down to just DS opens
    and closes
    and the problem persists. Attached is the error message
    that pops up when LV crashes, not much to go on but any ideas would be
    greatly appreciated.
    Attachments:
    DS Related Error.PNG ‏10 KB

    Hello,
    Which version of Windows are using? There are some cases in the past with NT that relate to this error because windows was updated. A Microsoft KB explains that here.
    This also may be an issue with the Shared Variable Engine having a conflict with the firewall or antivirus software. You may need to go through this document to configure your windows firewall if you already have not.
    National Instruments
    RIO Embedded Hardware PSE
    CompactRIO Developers Guide

  • Data Socket fails if built in DLL and called by Labview

    I've placed a Data Socket Connection Open in a SubVi and tested this by running the VI. -> No Problems.
    Then i've compiled a DLL from this Vi and started it from Visual C. -> No problems
    Now, i've included this DLL in another VI and started this.  Now i receive an Error.
    All Information is hardcoded in the DLL so there are no possiblities with parametrization.
    Does anyone have an Idea regarding this?
    Best regards
    Hacky

    Hello Carsten_S.....
    my collegue, who found this behaviour made a little package to
    show the environment. Since he uses a camera system there is no
    possibility to get it running. But it should be easy to create a LV based
    server.
    Our Environment is:
    LV 7.1
    Windows XPSR2
    Regards, Hacky
    Attachments:
    DLL.zip ‏76 KB

  • Connecting to a data socket

    If a machine opens a socket connection to me, how to I get data from it. I have the IP of the machine and the socket number. Do I just give the IP number to Data Socket Read and the listen for data?
    Thanks

    Hi Exo,
    "You can only use DataSocket as a client on Linux, Solaris and Macintosh.  This
    means that from a non-Windows machine you can publish to and read from a
    DataSocket Server, but the server itself must be running on a Windows machine.  The DataSocket Server application is built on Windows-based ActiveX
    technology and so is only available for Windows environments."  This is from KnowledgeBase 29A9RA8V.
    In the LabVIEW Example Finder >> Communicating with External Applications >> OLE for Process Control (OPC) >> open the Browse to OPC Item example.  The example will build the URL to the OPC server item if it is available on the network.  You can also see How Do I Use OPC in LabVIEW?  I hope this helps.

  • Why can't I read what I have written to the data socket server?

    Hi,
    I have a problem with DataSocket: I open a socket and in a cycle I read from the socket and write a boolean "TRUE" to the socket. But reading from the socket I always get a "FALSE" value back.
    Monitoring the socket from a second VI where a boolean control is connected to the data socket shows that the "TRUE" value that I write is accepted on the DS-Server.
    Is this a bug or do I miss something?
    Regards
    Tobias
    Attachments:
    readwriteDS.zip ‏17 KB

    hi there
    i'd recommend to use two connections for read and write access (see attachment). The ReadWrite mode does not work properly with DS. you can establish the connections at startup of your app and use them until you are done. when using the URL as a input the server must check for a open connection or create one in each cycle.
    best regards
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"
    Attachments:
    set_flag_v2_LV7.1.vi ‏43 KB

  • Default Timeout on Data Socket

    In my application, I am communicating with a PLC thru RS Linx utilizing a data socket. I can successfully open the socket, write the value and update using the following:
    DS_Open with  DSConst_Write option
    DS_SetDataValue and then DS_Update
    For robustness, I want to be able to alert the operator if the ethernet cable attaching the PC to PLC is unplugged, most likely or some other portion of the process has failed, less likely once setup.
    I do have a solution to the above, but what I have found is that if during the execution of my program I disconnect the cable,  DS_Update does give me an error indicating that sometheing is wrong, but my code hangs the thread for an indeterminate amount of time at least 1 second either through the execution of the DS_SetDataValue cmd or DS_Update. Both commands don't have a timeout associated with them, but is there some default timeout that is used.
    As a work around, my thought is that I if available I could use feedback from a callback if fast enough which can detect when a network cable has been disconnected to avoid this indeterminate timeout by avoiding any set or update commands when the cable is not connected.

    Hi testguy,
    Have you tried some of the other data socket functions? DS_IsConnected or DS_GetStatus may be able to tell the status of the connection a little faster; you could run one of those before the DS_Update so it doesn't hang. The full list of data socket functions can be seen here .
    There are also some other communication protocols that do allow timeout configuration, like telnet, TCP, and UDP.
    Hope this helps!
    -Alexandra
    National Instruments
    Applications Engineer

  • Dynamically create Variant Data Socket items with multiple writers

    I want to use variant or cluster items with data socket connection. I want to allow multiple writers.
    So far I can create these items dynamically but not set them to allow multiple writers.
    For numeric, string, and Boolean items I can set these properties by predefining them in the data socket server manager. I could not predefine a variant or cluster in the manager.
    I realize I can flatten to string the item needed but would prefer to do this in the cluster or variant formats.
    Any suggestions?

    unclebump wrote:
    Could you accomplish this using a functional global architecture??
    An interesting concept which might work and did just open up a new host of possibilities!
    When I get the time I might give this a try. I just did a quick test in another program.
    Through VI server I opened a reference to a remote machine. I then created strictly typed reference to a “functional global vi” that I knew would be in memory. It reads the functional global just fine!
    Thanks for the suggestion.
    Here is the work around I used for the data socket program.
    Here is the original problem.
    I needed to know on the server side when a new value was written to the message cluster, which consisted of a string and a variant. Checking the string portion of the cluster let me know what command to send the device being controlled on the server machine. The variant is used to hold the various parameters that accompanied the command. Since the same command type could be sent several times I needed to reset the string control after the server read the command. This required writing to the data socket from the client & server machine (multiple writers). Also since the client could be any PC in the subnet I needed to allow all these machines to have write access.
    I solved this by using a second data socket item for the new message flag. This item is a string value that could be pre-defined and set to allow multiple writers. I then used the cluster item to handle the commands and wrote to the string item a signal that a new command was ready. The server then recognizes a new command is ready, reads the command, and then flags the string message received.
    Thanks again for those who took the time to answer this.
    Randall

  • Data socket. how to implement this?

    I need to write to a data socket server using a program that scans a multiple channel data logger. Up to 2 scans can be enabled and the scans run at selectable times and on selectable channels. For example, scan 1 might scan channels 0 to 19 at a two second interval and scan 2 might scan channels 20 - 99 at a 10 second interval. I would like to know the best way to implement the ds server so each scan will write it's own data at different times and they will not overwrite or otherwise interfer with one another. Possible?  Various seperate programs will access this data from the server and update their front panels as the new data is written to the ds server.  In the above example, my reader program which executes every 50 ms would update channels 0-19 every 2 seconds and channels 20-99 every 10 seconds.  Is it possible to open two ds servers using one for each scan? I've played with that without success.  I looked at the data socket server manager but couldn't determine if changing it would address my problem.  I'm using LV8.5.1 and the programs will be compiled to executables for running on multiple computers in the lab.  Thanks for any advice.  Hope this makes sense. 

    Hi Mike,
    You only have one DataSocket server available to you at a time.  You can write to a server from multiple locations, but you cannot have multiple servers.  You should be able to implement your idea in your code by alternating between write locations.  You would have to stagger the scans so that they don't overlap however.  Here are a couple of links that you might find useful:
    Configuring a DataSocket Server
    http://zone.ni.com/devzone/cda/tut/p/id/3123
    Can Multiple DataSocket Writers Connect to the Same Item?
    http://digital.ni.com/public.nsf/websearch/A8AC9A7​51404BAB18625672400630A3D?OpenDocument
    Nick Keel 
    Applications Engineering 
    National Instruments
    Nick Keel
    Product Manager - NI VeriStand and Model Interface Toolkit
    National Instruments

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • Extract Data with OPEN HUB to a Logical Filename

    Hi Experts,
    Can anybody help me in sending the link for How to guide...Extract Data with OPEN HUB to a Logical Filename?
    Thanks in advance.
    BWUser

    Hi,
    check this links...
    http://searchcrm.techtarget.com/generic/0,295582,sid21_gci1224995,00.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e698aa90-0201-0010-7982-b498e02af76b
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1570a990-0201-0010-1280-bcc9c10c99ee
    hope this may help you ..
    Regards,
    shikha

  • Can I send data from a PC to another PC using Data Socket Servers?

    I need to send an array to a computer. Both computers use LabVIEW. The computer that writes the information also runs the Data Socket Server. What I want to do is read that array from another computer via internet. So the main issue is: Can I read from a Data Socket Server via internet?
    I'm writting the array using the dstp where I'm supposed to type the URL.

    Integrating the Internet into Your Measurement System – DataSocket™ Technical Overview
    Found using a simple search.

  • To view the data in open hub destination

    Hi all,
    Can anyone help me out how to check the data in open hub destination file.
    These are the details:
    Destination: File
    Type of file : Logical file
    Application Server file name : XXXXXXX
    If it was file name, i know it has to be checked in AL11 with directory name and file name.
    Here its a logical file name. Which is the directory corresponding to this?
    Thanks,
    tinkugeo

    Hi,
    Question: "Are all the logical files are saved in the home directory DIR_HOME?
                      Please correct me if I am wrong"
    Ans: When you create an Open hub destination using Physical file, the file will get created in DIR_HOME directory (by default) in AL11
    And for locating the physical path in AL11. Go through the below link. it gives ans to all your ques
    http://bx.businessweek.com/sap/view?url=http%3A%2F%2Fweblogs.sdn.sap.com%2Fpub%2Fwlg%2F17370
    Edited by: kumkum basu on May 20, 2010 8:20 AM

Maybe you are looking for