OPC datasocket write problem

I have a main while loop (10sec timer)with heavy image analysis, and another while loop(0.1sec timer) that simply writes the resulting single number from the first loop into a OPC server via datasocket write function.
While it does work, the resulting datalog shows random 0's or huge numbers included once in a while.
(almost everytime the main loop is processing)
It seems like when the main loop is ongoing the second loop stutters and misfires.  
How can I keep my data stream clean of these errors?
Thanks

This may be the same question that simyfren was getting at, but how are you communicating between the two loops?
I'm also a little confused about why you're writing values to the server every 100 ms when your processing loop is running every second. My interpretation of your description is that each time the main (10 sec) loop executes, it's producing one data point, and then the secondary loop writes that value to the server. If that's the case, then why are you writing to the server every 100 ms? Do you want values to be repeated? Or is the main loop actually producing several different values, all of which you're writing to the server?
Does your main loop take the full 10 seconds to execute, or does it execute in less time and you just want to run it every 10 seconds?
Also, if you post a screen shot of your VI, it may give us and any other members of the community more insight into what you're doing so we can provide you with more specific tips.
Regards,
Ryan K.

Similar Messages

  • Has anyone else ever had a problem where you had to perform 2 datasocket writes before the datasocket read would pick up the change?

    I have a local VI that is simply a control that writes to the datasocket server whenever the control value changes.(the dataitem on the server is permanent - its initialized and never released by the server)
    In the same local VI I have a datasocket read polling a different dataitem on the server.
    The remote machine has a VI that reads the permanent dataitem on the server once per second.
    For some reason, after adding the local VI mentioned above, the remote VI stopped picking up the first change in the permanent variable.
    I'd start both the local and remote VIs...
    Then change the local control and the remote V
    I would not update - as if the datasocket write(upon adjusting the control) did not take place. So I'd change the control value again - this time the remote VI would update to this new value. And from here on out - the remote VI would update correctly. This problem only occurs when the local VI is first started up.
    What in the heck is going on?

    dingler44 wrote:
    >
    > Has anyone else ever had a problem where you had to perform 2
    > datasocket writes before the datasocket read would pick up the change?
    >
    > I have a local VI that is simply a control that writes to the
    > datasocket server whenever the control value changes.(the dataitem on
    > the server is permanent - its initialized and never released by the
    > server)
    > In the same local VI I have a datasocket read polling a different
    > dataitem on the server.
    > The remote machine has a VI that reads the permanent dataitem on the
    > server once per second.
    > For some reason, after adding the local VI mentioned above, the
    > remote VI stopped picking up the first change in the permanent
    > variable.
    > I'd start both the local and remote VIs...
    > Then change the local control and the remote VI would not update -
    > as if the datasocket write(upon adjusting the control) did not take
    > place. So I'd change the control value again - this time the remote
    > VI would update to this new value. And from here on out - the remote
    > VI would update correctly. This problem only occurs when the local VI
    > is first started up.
    >
    > What in the heck is going on?
    Gorka is right, this came up on Info-LV a few days ago. Someone
    described a similar problem. I replied that I had seen similar
    behaviour, reported it to NI, and they verified a bug. There is no fix
    yet, but they are aware of it and will fix it. No anticipated release
    date for the fix.
    Regards,
    Dave Thomson
    David Thomson 303-499-1973 (voice and fax)
    Original Code Consulting [email protected]
    www.originalcode.com
    National Instruments Alliance Program Member
    Research Scientist 303-497-3470 (voice)
    NOAA Aeronomy Laboratory 303-497-5373 (fax)
    Boulder, Colorado [email protected]

  • Datasocket writes to FP1600 are unreliable

    I am trying to control digital outputs on an FP1600 from an FP2000. I can't use the FieldPoint vis, and am forced to use datasocket writes. I have attached 2 files. The vi named "FP1600 write test.vi" illustrates the problem. If you watch the state of the digital output in FieldPoint Explorer and run the vi, you can see that the datasocket write does not change the value. If you run the vi in debug mode (turn on the light bulb), it usually works!! After making any changes to the vi that force a re-compile, it usually works the first time, with the run button active for a noticeable period of time. After that the vi finishes instantly, but doesn't change the value of the output. The second vi in the attached zip file, "FP1
    600 R and W test.vi", tries to read the value first, then write it. It is set to wait 500 msec for an updated value on the read, and it should always time out, since nobody is updating the value. The first execution works, but successive executions finish instantly, with no 500 msec delay, no timeout indication, and no setting of the value. Somehow the datasocket transactions are just not taking place. What gives here?
    Attachments:
    FP1600_Problems.zip ‏21 KB

    Richard,
    With LabVIEW 6.x, the first run of an instance of the Datasocket Write function does not always produce the desired results when writing to FieldPoint. The current workaround is to run the function twice instead of once for the first run of every iteration. I have created a VI that will do this for boolean values; just insert this VI into your diagram in place of any datasocket write functions.
    Regards
    Michael Shasteen
    Applications Engineering
    National Instruments
    www.ni.com/ask
    Attachments:
    FieldPoint_Network_Write_(Bool).vi ‏36 KB

  • DataSocket Read problem

    Hi all,
    When I use the new condensed "DataSocket Read" vi in Labview 6i (which is
    unfortunately not editable and is supposed to replace old vi's like "open
    connection", "update", "close" and so on) a single time to read automat
    words through an OPC server, the vi returns "zeros" all the way. The only
    solution I found to read the right datas is to place the "DataSocket Read"
    in a "While Loop" which loops until datas are different from zeros, which
    is very inconvenient and time consuming. I tried diffferent settings with
    "DataSocket Read" (wait for update, timeout) but the problem remains.
    Have you also faced the same problem ? Is there a solution ? Thanks for your
    assistance.
    Gaël RENEVIER
    Responsable Maintenance & Développement
    Tél : 04 74 82 20 08
    Fax : 04 74 82 24 92
    e-mail : [email protected]

    This is a problem with the 6i data socket routines ... use the old routines
    from the data socket examples (with the open,update, close drivers), and it
    works fine.
    Dave Gianetto
    http://www.gianetto.org
    > From: [email protected]
    > Organization: UUNET
    > Newsgroups: comp.lang.labview
    > Date: Tue, 21 Nov 2000 16:05:38 +0100
    > Subject: DataSocket Read problem
    >
    > Hi all,
    >
    > When I use the new condensed "DataSocket Read" vi in Labview 6i (which is
    > unfortunately not editable and is supposed to replace old vi's like "open
    > connection", "update", "close" and so on) a single time to read automat
    > words through an OPC server, the vi returns "zeros" all the way. The only
    > solution I found to read the right datas is to place the "DataSocket Read"
    > in a "W
    hile Loop" which loops until datas are different from zeros, which
    > is very inconvenient and time consuming. I tried diffferent settings with
    > "DataSocket Read" (wait for update, timeout) but the problem remains.
    >
    > Have you also faced the same problem ? Is there a solution ? Thanks for your
    > assistance.
    >
    >
    > Gaël RENEVIER
    > Responsable Maintenance & Développement
    > Tél : 04 74 82 20 08
    > Fax : 04 74 82 24 92
    > e-mail : [email protected]
    >
    >

  • Error 63 occurred at DataSocket Write in getWavelength_v80 EDITED.vi, help? please!

    Hey guys, I am new to LabView and I have thought myself everything that I know.  I am an undergraduate student at NC A&T.
    Okay so I took a peice of code that I acquired from Bristol, and it's for a Bristol Wavemeter V1.22.  I first edited it to get a graph in there to show the data, and get a slope and Y intercept.  Now I am trying to connect it to a computer that controls a COntinuum ND6000.  We have existing code for the ND6000 that lets the two computers connect.  I took the code out of there that was the part that connects them and now when I wired everything up, I get the "Error 63 occurred at DataSocket Write in getWavelength_v80 EDITED.vi" error message.  it states; Possible reason(s):
    LabVIEW:  Serial port receive buffer overflow.
    =========================
    LabVIEW:  The network connection was refused by the server. For TCP/IP, make sure the server is running and listening on the port you are trying to use. Firewalls can also cause a server to refuse a connection. For VI Server, make sure you have enabled VI Server from Tools>>Options>>VI Server:Configuration."
    I tried making sure everything in the configuration was correct and it all is.  Can you guys please help me?
    Thank you. 
    I have attached the folder that it is located in because you do have to have the library function.  The file is located in the Bristol Wavelength Meter V1.22\Programming Interface\LabVIEW example I.
    Thank you again!
    Solved!
    Go to Solution.
    Attachments:
    6.jpg ‏153 KB
    7.jpg ‏112 KB

    So I went through and realized that I had the wrong port typed in by 1 number, I changed that and put in the correct port for the TCP address.  Now when I run it I get this error message 66....
    "LabVIEW:  The network connection was closed by the peer. If you are using the Open VI Reference function on a remote VI Server connection, verify that the machine is allowed access by selecting Tools>>Options>>VI Server:Machine Access on the server side."
    Any help?? I checked the Server Machine access and all of them are set to allow.

  • Datasocket ActiveX problem

    I have an issue with the standard Datasocket VI's that come with Labview 8.2.1. Datasocket has an ActiveX component which should theoretically act the same as the canned VI's. I wanted to test the ActiveX functionality so that a fellow programmer could pass/receive data from my Labview program into his Visual C++ program. I will use the Datasocket Read/Write vi's and he could use the ActiveX components in C++.
    I'm using the 'DS 3D Graph Reader.vi' and 'DS 3D Graph Writer.vi' from the examples as the base to test out ActiveX. I spent most of a day trying to get the reader portion to read the standard output of the Writer. I kept ending up with an array of the correct size with all zeros instead of the data. If I switched the reader back to the canned vi, it worked fine. No matter how I configured the ActiveX settings, I could not read the data.
    Then I modified the Writer to use ActiveX to write data to the server instead of the Datasocket Write vi. Once I did this, I can read the data using either ActiveX or the standard Datasocket Read vi.
    What I can't figure out is why the write portion makes a difference. This is my first time using Datasocket, but not ActiveX, which I've used to communicate with Windows components and devices many times in the past. The documentation included with the Datasocket ActiveX is pretty sketchy and missing several settings which are available (the Sync settings and the Buffered settings).
    I've attached the vi's I modified to try out. Make sure to start the Writer first.
    Thanks in advance!
    Tom
    Attachments:
    DS 3D Graph Reader.vi ‏54 KB
    DS 3D Graph Writer.vi ‏49 KB

    Thanks, guys.
    No joy, unfortunately.
    I tried 'Datasocket Open' outside the loop and then closing it when quitting, but I'm still having the same issue: an ActiveX read cannot see the data, but a DS Read can.
    I've attached the new 'DS 3D Graph Writer' vi and the 2 subvi's, though Labview should have been able to find them - they're from the standard example vi.
    I don't see how to configure the Datasocket Server. Diagnostics lets me see the 3dgraph folder with the 'data' item in it, but not modify it's characteristics in any way.
    Any other suggestions?
    Attachments:
    DS 3D Graph Writer.vi ‏52 KB
    create waveform.vi ‏30 KB
    Launch DS Server if Local URL.vi ‏30 KB

  • Read/write problem with Datasockets.

    Hi, I'm a newcomer to Labview, and I'm having a problem with Datasockets. When trying to create a 'Publish & Subscribe' socket between two machines it only works on one, the one whose dstp address is the local machine, the other being incapable of writing to this 'host' and displaying red LEDs, although it is reading from the host. Also I've only managed to set up these read/write connections using the right-click options, how is it done programatically? Any clarification on the issue (whether directly connected or not :-) would be appreciated. Many thanks,
    Tom

    Hi Lector!
    This is normal behavior for DataSocket. You want to run a DataSocket server on both machines. Although you can SUBSCRIBE to a DS server anywhere on the network, you can only publish to your local server. We do a LOT of Datasocket work here, and this has never been a problem. It's a real security bonus, as well.
    It's a good idea to split all your read and write functions. Although some front panel objects (knobs, particularly) can be controls and indicators simultaneaously, it's good practice, for a number of reasons, to NOT use both functions. I build "dummy" front panels for all my VI's which I distribute to all my colleagues who need to work with a remote instrument.
    You cannot really appreciate DataSocket, till you've tried to rem
    otely control something with PC Anywhere over a slow network! A bit of practice, and you'll wonder how you ever did anything without DataSocket. I'd be glad to work with you on any particulars. Good Luck!
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • Datasocket write and close / remote OPC server / PC freeze when no connection

    [Labview 8.21, Windows XP SP2]
    Hello
    I am getting data from a remote OPC server using the Datasocket techniques. Depending on the DS family of routine that I use the behavior is different when the OPC server shuts down or Ethernet link is cut.
    In the NOK application attached, as soon as the link to the OPC server is cut the application and the whole Labview environment gets stalled, either in the DS Write or in the DS Close icon. Never in the DS Read icon.
    Also the Timeout to read or write does not work in neither application. Whatever the number I set it will never be taken into account.
    Is there some sort of 'miracle' setting in the Labview.ini file that can make the NOK application to work correctly and step out of the DS Write or Close vi when such link cut occur? More generally could someone explain why the behavior is different between the two applications, if there are new Datasocket routines that would handle these kind of communication in a clean way?
    Thanks
    Christophe
    Attachments:
    Datasocket - OK version.vi ‏19 KB
    Datasocket - NOK version.vi ‏19 KB

    I am desesperate. The Datasocket - OK version.vi 19 KB that seemed to work so well (no freeze at all) creates a huge memory leakage as you can see in the attached file. I am only reading a tag (local OPC tag, not even remote tag on another PC's OPC server) and the word document attached shows the issue:
    After 15-20min during which no increase of memory is noticed (first picture) the situation starts to worsen. In 12 hours (about 7200 read operations) it reaches a consumption of 65Mb ! (to read everytime the same OPC tag). Something that I never noticed with the Datasocket - NOK version.vi 19 KB that had the freezing issue...
    I really do not know what to do.
    Thanks for your prompt feedback
    Christophe
    Attachments:
    Benchmark Datasokets.vi ‏38 KB
    Benchmark Datasocket Memory Consumption.doc ‏392 KB

  • Help! - Datasocket read/write problem

    Here are two basic read/write datasocket vis... that do not work properly.
    Start the DS engine, run both vis, modify the string array in read.vi or resize the write.vi window and you will see that the indicator display in write.vi is wrong.
    Can anybody tell me why?
    Thanks a lot for your help.
    MichelC
    Attachments:
    Datasocket.zip ‏19 KB

    From what I see, the elements being written and read are not synched to the same iteration number, and thus are not array-indexed the same, therefore, you'll have a difference in the array index # for what was written and what was read. In other words, the DSS-read is not always at the same iteration # (index #) as the DSS-write when the write and read occur.
    However, with that thought, you could remove all looping and simply DSS-write the whole array to your DSS-read. Then you keep the indexing equal on both ends. When you send and receive a whole array, no looping is needed, so the process also is quicker.
    Well, that's how I see it, good luck with it, Doug

  • Reading arrays of double from S7 with OPC & Datasocket

    Hi friends:
    We are developing an application with a S7-315-2DP PLC and a PC with a PCI1500PFB. We use the OPC server from Applicom. We read the data very quickly with the datasocket (arrays of boolean, arrays of doubles ...and so on, and a very big amount of data over 100 ms) but when we try to write arrays datasocket faield and we have to write item on item and the speed decrease. For intance, if we try to write doubles ( 50 items) the refresh period is over 5 seconds ( some times more since we launch the data and we read the same data on the PC). Perhaps we failed configuring the OPC but there isn´t many things to configure, perhaps the problem is the board configuration .. I don´t know.
    We
    try to find some examples that write an array of doubles on one time but..
    Thank you for yours answers.
    Javi

    Hi Javi,
    I'm not aware of any known issues writing to the Applicom OPC server. In LabVIEW there isn't anything special you need to configure to be able to write arrays of doubles through DataSocket. You can test this by using the DataSocket Server Manager, make a new member that is an array of doubles, and try reading and writing to that member. You may also want to check to make sure the data member the OPC server is expecting is an arry of doubles and not an array of singles or integers.

  • OPC DataSocket error 42 in writing negative values

    I was playing around with OPC and using the DataSocket pallete. Although I've used it reliably for a while and am content, I was baffled by one error. I was hoping someone could explain why this error occurs or how to solve it.
    In the NI Distributed System Manager I've created an Shared Variable of the type single, with Read/Write access.
    Problem
    When writing a value less or equal to 0 to an OPC URL, I get an error 42. When using the equivalent PSP URL, I don't get it.
    Using this VI snippet code.
    I get these paths and errors:
    This error 42 comes for all values below zero and for zero. For all positive values I don't get this error. What's the reason for this behaviour? In my humble opinion this is not wanted behaviour, as OPC tags should accept the whole value range of the single.

    White spaces are allowed in OPC URLs, so that cannot be the issue.
    I've tested with another LV2013 computer and NI Distributed System Manager 2013 and got the same errors. However, when I tested it on a LV2012 and NI DSM 2012 it was all working. Quite strange.
    Now I'm wondering if it's something local or that the bug was introduced in the 2013 distribution and if it has been solved in the 2014 version ...
    Could someone test it on LV2013 and/or LV2014, just to check if the problem occurs for other installations in LV2013 and if the problem has been solved in LV2014? Please indicate LV version and DSM version.

  • Lookout opc or link problems

    I am using Lookout 6.0.2 on a new Win XP desktop.  The Lookout OPC client object is used for communications via Rockwell Software RSLinx's (Professional Rev 2.43.01.23) OPC server to ControlLogix PLC's over ethernet.  In other words, the Lookout communicates with RSLinx by OPC, and the RSLinx communicates with PLC's by ControlNet.
    We have 3 Lookout processes, one which is the "server" process, and contains the OPC Client object. The other 2 process files are "client" processes, and reference the OPC Client object  by symbolic link.
    We have many Lookout switches in the "client" processes, that are remoted to a tag in the ControlLogix PLC using symbolic link. A typical link for a remoted switch is:
    ..\..\[Link_to_Drivers]\OPCclient1.PLC_12.Online.SWITCH_TAGNAME
    OR   IF USING ABSOLUTE REFERENCE:   \\ComputerName\ProcessName\[Link_to_Drivers]\OPCclient1.PLC_12.Online.SWITCH_TAGNAME
    In this  way, the Lookout switch object has a read/write link.
    The problem is this:  Periodically the write link will stop working.  When this happens, all the Lookout switches and even the Lookout pots will lose ability to write to PLC, but the read links are still working. We can read the data and the switch positions, but the changing setpoints with the pots and operating equipment with the switches is then impossible.  This "lock up" can be fixed by closing down all the Lookout processes (but not Lookout), and then restarting the Lookout processes.
    This problem is intermittant and not repeatable.  Does anyone have idea how to troubleshoot this problem, or have an way to isolate and fix this problem? Thanks!

    This problem is fixed by lookout 6.0.2 updates. It can be downloaded from http://joule.ni.com/nidu/cds/view/p/id/506/lang/en
    You need first to login MyNI, and then download lo602_updates.zip. Unzip it and copy all files to lookout folder.
    This update is applied to Lookout 6.0.2 server system. You don't need to copy these files to client system.
    Ryan Shi
    National Instruments

  • Datasocket write error when launching an application

    I have invested a lot of time in an applications that uses a number(>100) datasocket connections to exchange data between an application and plug in modules(called vis). I have two errors relating to the datasocket server for this application: 1.) When the server is started for the 1st time by calling the datasocket server control vi inside my code, I run a write function inside a loop for 10 iterations at 10ms intervals. No matter how I modify the number of iterations and frequency, the write function occasionally errors on first start up., and 2.) When I run the application using the Labview runtime engine(version 6.0.3) I see the same problem in addition to datasocket reads and writes not updating correctly. They do
    not error but they do not exchange the correct data like they do when the full version of labview is installed on the machine.
    Has anyone seen these problems before? Your help will be greatly appreciated.
    Thank You,
    Mike W

    The export/import option for 3.0.7 are somewhat little brittle .
    What I can suggest you is to upgrade your existing 3.0.7 to 3.0.9 atleast (if not 9.0.2) .
    This version has got lot of new features which you are looking into.

  • First datasocket write slow on localhost with XP SP2

    Hi there,
    i've got the following problem:
    I use datasocket to share information between 2 labview applikations.
    This applications run fine using win2k.
    Now i transfered these applications to Win XP SP2.
    (I found, that there is a problem with the local host adress space in win XP and installed update kb884020 from MS homepage.)
    If i try to write an item for the first time, it takes several seconds to write it. (dstp://localhost/set_plc or dstp://127.0.0.1/set_plc) (several seconds for EACH item)
    If i change the adress to the local IP, everything works immediately (dstp://192.168.101.73/set_plc for example)
    Does someone have a similar problem? Did someone find a solution for that?
    Details:
    Windows XP professional SP 2 (+ kb884020)
    Dell PowerEdge 1800 Dual Xeon 3.6, 2Gb RAM
    no firewall installed, XP firewall disabled
    No DNS server entered (there was a DNS server entered before)
    Labview 7.1
    Datasocket 4.3.0
    Every hint is appreciated, thanks in advance
    Rainer

    Jochen,
    thanks for your suggestions.
    I allready thought about the DNS settings.
    But as i mentioned, there are no entries for a DNS Server.
    The IP Adress is fixed, no DHCP Server is used.
    If the DNA settings are responsible for this behavior, shouldn't the adress be resolved after the first successful access of one DataSocket Item and the following accesses must be fast?
    Best regards,
    Rainer
    P.S.: Due to the fact that i'm responsible for the PC the software is running on, there's no administrator i could ask (except myself).
    Attachments:
    dns.jpg ‏34 KB

  • How to build a working executable of the DataSocket writer example VI

    I'm trying to build an executable of the "DS Writer.vi" example.  The first problem was that the "DataSocket Server Control.vi" was not distributed with my build/install script.  I fixed that (thanks Dennis) but now I get the following error message.
    LabVIEW:  (Hex 0x626) Cannot open a VI with separated compiled code in a Run Time Engine that has no access to the VIObjCache.
    There is a solution to that (http://forums.ni.com/t5/LabVIEW/Getting-LabVIEW-load-error-code-59-using-LabVIEW-2010-with-a-Run/td-...), but it involves changing a property of a VI in the DataSocket library (if I understand that correctly).  I'm reluctant to make a change to a standard NI library as it could cause maintenance problems in the future (other developers not having the same change, or updating LabVIEW versions).
    Has anyone successfully built an executable using DataSocket?  If so, can you offer any advice?  I'm using LabVIEW 2011.
    Thanks, Mark
    Solved!
    Go to Solution.

    Thanks Nathan.  I was able to build and deploy an executable with DataSocket.  The last hurdle was to "Uncheck the 'Separate compiled code from source file' option in VI Properties" for the "DataSocket Server Control.vi".  The only problem with that solution is that I now have a customized DataSocket library.  I think one solution might be to copy that VI or the library into my project folder so that the solution is transferrable to others in the future.  I would like to hear how other LabVIEW developers deal with customized libraries, either by strictly avoiding that, maintaining their own copies, or some other solution.  But that is probably a topic for a new thread.

Maybe you are looking for

  • Mac's using a Windows Print Server

    I am an administrator for a dual-platform school district (elementary and middle schools). We run both AD & OD, and all of our Mac's are bound to both AD & OD. Our users authenticate to Active Directory. My issue is printing from our Mac's (MacBooks

  • Can't download files from iCloud to PC

    Whenever I get an attachment sent to my iCloud account, I cannot download the files to my computer. Every time I click on the attachment, nothing happens. The file just does not download! I am using Firefox and have a windows 7 PC ... Please help.

  • Column data formatting in OBIEE ANSWERS

    Hi, I have a requirement of putting '-' whenever column value is NULL. I am doing this ANSWERS. I am doing this by using the below. IFNULL(CAST("COLUMN NAME" AS CHAR),'-'). It is correctly replacing by '-' whenever data is NULL but it is also overrid

  • Configuration - Bank chains?

    Hi Friends, Iam working for US client, I want to make the International payments from 1 Bank to another Bank, for example US to France, for this I have to do Bank chain configuration. (Q1) Configuration for Bank Chains step by step flow? (Q2) What is

  • BPEL Process not Loading in Console

    Dear All, I am new to SOA Admin. In my BPEL console the process does not seem to load and hence can not be tested. It's visible with a Warning sign on the left and on initiating, this is the error that I get initiate BPEL An Error Occured : 0 What ca