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

Similar Messages

  • 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

  • Dvdram gt30l read write problems

    long ongoing reading cd roms Kodak Picture cd shows a blank disk dvd+ writing problems please help.

    Hi 
    Since you are facing an issue with Read/Write issue with your DVD Rom please click on the web link given below should be able to help you to resolve the issue on your unit. Kindly select the applicable Operating System (OS).
    CD or DVD Drive Cannot Burn Discs (Windows 8)
    Drive Cannot Write to Writable Discs (Windows 7)
    Drive Cannot Write to Writable Discs (Windows Vista)
    Drive Cannot Write to Writable Discs (Windows 98, ME, XP)
    Let us know how it goes!
    *Although I am an HP employee, I am speaking for myself and not for HP.
    *Make it easier for other people to find solutions, by marking my answer “Accept as Solution” if it solves your problem.
    * Click on "Purple Thumbs up" button to the left side of my post to say thanks!
    Regards
    Ahmed

  • Javacomm read/write problem

    Hello all, i have successfully installed javacomm package in my computer and i can enumerate all available ports. My problem is between the read - write communication. By running the SimpleRead first and then the SimpleWrite i got a "Port Already in use" which sounds normal to me, so i connected 2 pc's with a serial cable and runned one of sun's samples on each.
    Step 1. SimpleRead waits for data on COM1
    Step 2. SimpleWrite(on other pc) sends some data from COM1
    Both COM1's are connected with that serial cable but seems no data coming. Am i doing something wrong? I tried same thing with VirtualPC but still no data arriving.
    Any help appreciated. Thanks

    Hello all, i have successfully installed javacomm
    package in my computer and i can enumerate all
    available ports. My problem is between the read -
    write communication. By running the SimpleRead first
    and then the SimpleWrite i got a "Port Already in
    use" which sounds normal to me, so i connected 2 pc's
    with a serial cable and runned one of sun's samplesAre you using a terminal the opens the port?
    Without any ambiguity whatsoever,
    "Port Already in use" means
    something else has already opened the com port and I can say the
    COMM API. works because I use it all the time with GPRS board.
    ie:
    https://hyperview.dev.java.net/source/browse/hyperview/www/comm/SerialHandler.java?rev=1.2&view=markup
    Crossing pins 2 & 3 will only redirect your output/input
    but will not cause the the port to be in use Jos.
    (T)

  • Read write problem

    I had a code that was working perfectly until recently. Some part of the VI where it reads and write does not work. Does anyone have the patiece to actually go throught the code and help me. I am a beginer with LV.
    When we make an exe using LV 7.1, all the source files are pretty much on the exe, correct? So, if I go and copy that exe elsewwhere, the source files should open correctly, right? I ask this because it seems that the files from vi.lib may have got displaced and hence it does not read/write.
    Help required urgently.

    You didn't post your code for anyone to look at but I'm goint to guess that you did not take into account that paths are a bit different in the development environment and in the run-time. If you use a function like Get Current VI's Path, in development mode, it will return something like c:\folder\example.vi. After the app is built, it will return c:\folder\app.exe\example.vi. So, to get the path to the folder, you need to do an extra strip path. This is an extremely common mistake and there is a knowledge base article (that I don't have the link to offhand) and there have been numerous posts with the exact same question. There are a lot of ways to handle this. The one I usually use is to put in an application.kind property node and wire the output to a case structure. Put the extra Strip Path in the Run Time System case.
    Message Edited by Dennis Knutson on 11-06-2007 08:20 PM
    Attachments:
    Extra Strip Path.PNG ‏4 KB

  • Help with Read/Write File

    hi I was wondering if someone can help me do some read/write file with java. here is what I want to do:
    Read a file and search the whole file for a word such as "throw" and print out the rest of that line to a new file. in the case of "throw", i want to link all thrown exceptions to the file that contained them.
    can someone help me out and let me know what way I can approach in this?
    any help would be greatly appreciated.
    thanks!

    Rough and dirty, here's a class that will read a file and return a resultset:
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.FileChannel;
    import java.util.*;
    import java.text.DateFormat;
    public class Utils{
         File fileName;
         FileOutputStream outputFile;
         boolean closeChannel;
         //Constructor
         public Utils(String directory, String filename){
              String strFileDir = directory;
              String strFileName = filename;          
              File fileDir = new File(strFileDir);
              fileName = new File(fileDir, strFileName);
              // If directory does not exhist, create it.
              if(!fileDir.isDirectory()){
                   if(fileDir.mkdirs()){
                        System.out.println(fileDir + " created.");
                   else{
                        System.out.println(fileDir + " could not be created.");                    
    public ArrayList readText() throws IOException{          
              // Read content of file into a collection
              ArrayList arrayList = new ArrayList();
              try{
                   BufferedReader in = new BufferedReader(new FileReader(fileName));
                   String line;
                   while((line = in.readLine()) != null){
                        arrayList.add(line);
                   in.close();               
              catch (IOException ex){
                   throw ex;
              return arrayList;          
         }And here's how you use the class:
    // Create a new Disk Utilities object.  This can be used for all subsequent read/writes to this file.
              Utils utilTest = new Utils("e:/testing", "Testing.txt");
    // Create a collection to hold the data from the file.
              ArrayList arrayList = new ArrayList();
              try{arrayList = utilTest.readText();}catch(IOException ex){ex.printStackTrace(System.err);}

  • HD read-write problems recording more of 16 audio tracks

    I've a strange problem that i don't have in digital performer with rosetta!
    When i record more of 5-6 track...for example 16...when i stop the registration....logic is blocked for 30-40 seconds....and then it begin to create overview!
    in this time i've see the hd read and write at 5 mb/sec....
    It isn't normal!!! I've tried all the settings of audio driver and buffer....but nothing change
    anybody can help me?!?
    p.s. sorry for my bad english!

    1 : Waht sample Rate are u using -
    2 : I have disk Journaling on and record @ 96KHZ - and can do 64 tracks simoultaneously (split on 4 drives)
    3 : Is your recording drive very fragmented if so defragment it
    4 : Dont EVER record to your system drive - too much activity going on there
    5 : Set your Max Recording time to 10 minutes in the "Set record path" dialog in Logic ( If you have not set the max rec. time Logic will "Freeze" all available space on the disk for the recording and that can lead to problems especially if u aint using a dedicated hard drive to wirte your audio to
    6 : it is very important to have a dedicated drive to record audio to - being an internal SATA or Firewire 400/800 - as long as this drive is being used to record only...This has solved many problems for me...

  • Hard drive read/write problems

    I have three external hard drives connected to my iMac that are always on with the computer. Just recently, I started having trouble with permissions. Every day I have to go into disk utility and click "verify disk" to be able to write to the drive, if I don't do that then I can only read the drive. It's the same with all three of them! This just started a couple of weeks ago. What is wrong?
    Oh! My recollection recalls that a couple of weeks ago upon starting the iMac one morning, one of my hard drive's name, as well as a .iso file that I have on my desktop, were totally wacko. Full of numbers and characters, etc. I'm wondering if my HD problem is caused from this?
    I desperately need some help!

    if running "verify disk" helps at all it's definitely not a permissions problem. it's a file system problem. when system detects a serious file system problem when mounting an external drive it will mount it as a read only file system. run "repair disk", not "verify disk" using disk utility on all the drives involved. see if that helps. and are there any errors when you run it?

  • Need help with read/write to MODBUS RTU registers in Labview 8.0

    I’m trying to write and read the registers in G3800xx016. controlling temperatures and lightning.  Please look at the attached pdf file for this unit..
    I have used Lookout for about three years, and it works fine.. Now I want to expand my system and try to use Labview 8.0
    My temperature register start adress is 100 Hex  (256 dec) I read from Register with Function code 03.
    This register have values from 0-255 witch mean in labview for me as unsigned byte U8
    I read my temperature from the register like this: eks.: 40257 lets say value=5
    Slave    FC       Start Adress     Byte     Value               CRC
    01        03        0100                02        0005                7847   
    This is the status received from the Modbus tester when I use null-modem connection..
    I receive the same value if I use Modscan32
    I have used null-modem cable to read out the values.
    I have also PIR detectors that control movements and light of and on, and I read these starts at 40017.1
    01   03     0010     02    
    The register to switch on and of heating and lights starts at 404097.1  FC16  
    Values mention here is read from Lookout 5.0  
    I have tried examples and read for weeks about this, but everything stops when I try to use Labview 8.0    I can’t read any values from my Master unit, neither write to it, or read any values in Modbus testers when I use null-modem cable.. I have tried different baud rates in my serial connection and it works perfect in Lookout, but Not Labview..
    I have even bought DSC module, but I can’t write to either com ports or Modbus testers..
    Please anybody… is there anybody that can give me help with this??
    Start address for for PIR detectors is 40017.1 (FC03)  and for writing bits for on of to light and heatsystem is 404097.1 (FC16)
    I would be very happy for any idea that can give me some positive results…  Look at the attached pdf file.
    Thanks.. and very best regards from
    Benjii…
    Attachments:
    G3800x016_02-2005_eng.pdf ‏70 KB

    Hi... and thanks for your answer..
    Yes, I have downloaded the NI Modbus drivers.. I have downloaded that one + a lot of other things about Modbus..
    I have also tried communication between lokout and labview true null-modem cable.. and it works..
    I have tried several Modbus examples and I communicate with most of them with null-modem cable.
    I write to the right registers as well, cause I use Modbus scanner to read the information..
    I have used the same settings for serial communication as my Master device use, bust still I can't get any response..
    There was an error message in one of my example from the Modbus INIT module.. Maybe I should try to set up a new connection using VISA ??
    Maybe the problem is to INIT my serial port? I have tried restarting my computer after closing my system..  But still, I have the same problem..
    I hope you can give me any idea...
    Thanks again..  by the way.. is it possible to write and read directly to serial port with the DSC module??  If so.. how?? 
    Very best regards..
    Benjii..

  • Multithread read write problem.

    This is a producer consumer problem in a multi-threaded environment.
    Assume that i have multiple consumer (Multiple read threads) and a
    single producer(write thread).
    I have a common data structure (say an int variable), being read and written into.
    The write to the data sturcture happens occasionally (say at every 2 secs) but read happens contineously.
    Since the read operation is contineous and done by multiple threads, making the read method synchronized will add
    overhead(i.e read operation by one thread should not block the other read threads). But when ever write happens by
    the write thread, that time the read operations should not be allowed.
    Any ideas how to achive this ??

    Clearly the consumer has to wait for a value to become available and then take it's own copy of that value before allowing any other thread to access it. If it doesn't copy the value then only one consumer can act at any time (since if another value could be added while the consumer thread was accessing the common value then the value would change, affecting the consumer at random).
    In general what you're doing is using a queue, even in the special case where the maximum number of items queued is restricted to one the logic is the same.

  • Read Write Problems, Javascript

    Hello,
    I have had problems with a simple procedure. The grand scheme involves a lot more, so my example may seem trivial but this is where I've narrowed the problem down to. I cannot read an image file using the File object and write it back out as an image. Here is my test function, my targetengine for the script is session. When using the BINARY encoding the replicated file is the same size and appears almost identical but it simply won't be recognized as a valid jpg
    function readWrite(){
    var name = "/c/indesign_scripts/Winter.jpg";
    var f = new File(name);
    var encoding = "BINARY";
    if(!File.isEncodingAvailable(encoding))
    alert("You're using an unsupported encoding");
    f.encoding = encoding;
    f.open("r");
    var payload = f.read();
    var f2 = new File("/c/indesign_scripts/Winter-1.jpg");
    f2.open("w");
    var bool = f2.write(payload);
    if(!bool)
    alert(f2.error);
    Thanks in advance for any advice,
    Matt

    You may get a response here, but it will get more attention if you post on the scripting forum down the hall.

  • Windows 7 applicatio​n file read/write problems

    I'm building a few programs using labview 2009 on an XP machine. I can build these programs and have them work fine with any windows XP machine. Recently I've gotten a Windows 7 machine. I've installed the labview runtime, and daq mx without any problems. The programs seem to run fine.
    However when I have to read or write to files nothing happens. . For instance with one program I log data and output that to a TDM file with the other I read that data and do something. I get the dialog to save the file but after I hit save no file is made. Likewise if I bring a premade TDM file from another machine I get the open dialog box but no data is imported. No Errors are reported.
    Trouble shooting steps taken: I've tried running with administrator rights, with XP compatability mode, in the windows XP virtual machine. Has anyone run into something like this?
    Solved!
    Go to Solution.

    Good Morning. I'm having an identicalissue, but I wanst able to figure out this solution. In simialr fashion (LV 2009 on Win7 machine), I've typically written my executables to write data files to c: so when I deploy the software, I dont have to account for different names. On Win7, this is no longer possible. Can somebody please point me towards a way to define a path constant so I can write and read from a file in a known location without the use having to select a path? Sorry, Ive been looking all night for the solution, just havent been able to get it worked out.  (I did instal the USI files with the Installer) I appreciat the thoughts.

  • Blob for binary file, read/write problems

    Hi,
    I am relatively new to this type of development so apologies if this question is a bit basic.
    I am trying to write a binary document (.doc) to a blob and read it back again, constructing the original word file. I have the following code for reading and writing the file:
    private void save_addagreement_Click(object sender, EventArgs e)
    // Save the agreement to the database
    int test_setting = 0;
    // create an OracleConnection object to connect to the
    // database and open the connection
    string constr;
    if (test_setting == 0)
    constr = "User Id=royalty;Password=royalty;data source=xe";
    else
    constr = "User ID=lob_user;Password=lob_password;data source=xe";
    OracleConnection myOracleConnection = new OracleConnection(constr);
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    myOracleCommand.CommandText = "insert into blob_content(id, blob_column) values 2, empty_blob())";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    // step 2: read the row
    OracleTransaction myOracleTransaction = myOracleConnection.BeginTransaction();
    myOracleCommand.CommandText =
    "SELECT id, blob_column FROM blob_content WHERE id = 2";
    myOracleDataReader = myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    Console.WriteLine("myOracleDataReadre[\"id\"] = " + myOracleDataReader["id"]);
    OracleBlob myOracleBlob = myOracleDataReader.GetOracleBlobForUpdate(1);
    Console.WriteLine("OracleBlob = " + myOracleBlob.Length);
    myOracleBlob.Erase();
    FileStream fs = new FileStream(agreement_filename.Text, FileMode.Open, FileAccess.Read);
    Console.WriteLine("Opened " + agreement_filename.Text + " for reading");
    int numBytesRead;
    byte[] byteArray = new byte[fs.Length];
    numBytesRead = fs.Read(byteArray, 0, (Int32)fs.Length);
    Console.WriteLine(numBytesRead + " read from file");
    myOracleBlob.Write(byteArray, 0, byteArray.Length);
    Console.WriteLine(byteArray.Length + " written to blob object");
    Console.WriteLine("Blob Length = " + myOracleBlob.Length);
    fs.Close();
    myOracleDataReader.Close();
    myOracleConnection.Close();
    This gives the following console output:
    myOracleDataReadre["id"] = 2
    OracleBlob = 0
    Opened D:\sample_files\oly_in.doc for reading
    56832 read from file
    56832 written to blob object
    Blob Length = 56832
    My write to file code is:
    private void save_agreement_to_disk_Click(object sender, EventArgs e)
    string filename;
    SaveFileDialog savedoc = new SaveFileDialog();
    if (savedoc.ShowDialog() == DialogResult.OK)
    filename = savedoc.FileName;
    // create an OracleConnection object to connect to the
    // database and open the connection
    OracleConnection myOracleConnection = new OracleConnection("User ID=royalty;Password=royalty");
    myOracleConnection.Open();
    // create an OracleCommand object to hold a SQL statement
    OracleCommand myOracleCommand = myOracleConnection.CreateCommand();
    myOracleCommand.CommandText =
    "SELECT id, blob_column " +
    "FROM blob_content " +
    "WHERE id = 2";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    myOracleDataReader.Read();
    Console.WriteLine("myOracleDataReader[id] = " + myOracleDataReader["id"]);
    //Step 2: Get the LOB locator
    OracleBlob myOracleBlob = myOracleDataReader.GetOracleBlobForUpdate(1);
    Console.WriteLine("Blob size = " + myOracleBlob.Length);
    //Step 3: get the BLOB data using the read() method
    byte[] byteArray = new byte[500];
    int numBytesRead;
    int totalBytes = 0;
    FileStream fs = new FileStream(filename, FileMode.OpenOrCreate, FileAccess.Write);
    while ((numBytesRead = myOracleBlob.Read(byteArray, 0, 500)) > 0)
    totalBytes += numBytesRead;
    fs.Write(byteArray, 0, byteArray.Length);
    Console.WriteLine("numBytes = " + numBytesRead + " totalBytes = " + totalBytes);
    Console.WriteLine((int)fs.Length + " bytes written to file");
    fs.Close();
    myOracleDataReader.Close();
    myOracleConnection.Close();
    This gives the following console output:
    myOracleDataReader[id] = 2
    Blob size = 0
    0 bytes written to file
    If I manually add the blob file using the following:
    DECLARE
    my_blob BLOB;
    BEGIN
    -- load the BLOB
    my_bfile := BFILENAME('SAMPLE_FILES_DIR', 'binaryContent.doc');
    SELECT blob_column
    INTO my_blob
    FROM blob_content
    WHERE id = 1 FOR UPDATE;
    DBMS_LOB.FILEOPEN(my_bfile, dbms_lob.file_readonly);
    DBMS_LOB.LOADFROMFILE(my_blob, my_bfile, DBMS_LOB.GETLENGTH(my_bfile), 1, 1);
    DBMS_LOB.FILECLOSEALL();
    COMMIT;
    END;
    COMMIT;
    The write to file works perfectly. This tells me that there must be something wrong with my code that is writing the blob to the database. I tried where possible to following the Oracle article using large objects in .NET but that (along with most things on the internet) focus on uploading text files.
    Thanks in advance.
    Chris.

    myOracleCommand.CommandText = "insert into blob_content(id, blob_column) values 2, empty_blob())";
    OracleDataReader myOracleDataReader = myOracleCommand.ExecuteReader();
    This looks wrong, you shouldn't be using ExecuteReader unless you expect to get a result back. Try using ExecuteNonQuery to do the insert.

  • Read/Write problems with multiple connections using MySQL & Tomcat

    hello all,
    I am developing a web-based java application that runs on a 4.1 tomcat server and uses MySQL 3.23.52 as db server.
    this program uses hundreds of tables with hundreds of rows each.
    when two or more users are connected, we are experiencing several problems:
    1. when a query is started, they get cross-results that come from both connections.
    2. when inserting/updating (most queries are long and take a few seconds), sometimes data are crossed too, sometimes they are saved incorrectly but get no error message, sometimes they are not saved and get 'null pointer' sqlexception (but tables and queries are correct).
    3. using SHOW PROCESSLIST and SHOW STATUS, we saw that MySQL server hosted no more than 3 max_used_connections, even when my.cnf parameters where set with more. when 3 or more users try to access the database, they get a bad handshake error until other connections are freed.
    any suggestions?
    thanks
    alessandro bonanni
    university of udine

    I am not using a connection pool. I read that when two different connections try to access the same data simultaneously, mysql is not secure. maybe a connection pool could solve that? or maybe is it a mysql limit?
    alessandro

  • Read write problems

    I have a new macbook pro with 4GB ram and a 3.06Ghz core duo processor.
    I use Logic Pro Studio with 2 Motu 896mk3's
    after recording about 13 tracks I am now getting "disk too slow errors" After using activity monitor it doesn't seem to be a cpu or ram issue but disk speed maybe.
    After reading forums it seems like my macbook isnt suited for recording this many tracks.... would a really fast firewire harddrive be better?? if so any recommendations?

    Aaron Wallrich1 wrote:
    I have a new macbook pro with 4GB ram and a 3.06Ghz core duo processor.
    I use Logic Pro Studio with 2 Motu 896mk3's
    after recording about 13 tracks I am now getting "disk too slow errors" After using activity monitor it doesn't seem to be a cpu or ram issue but disk speed maybe.
    Sometimes these messages actually do point right at the problem
    The general rule of thumb is that the startup disk is least suited for working with streaming audio (or video, for that matter). The system (OS X) is also interacting with the startup disk while you're working in Logic, which of course has an adverse effect on playing back/recording of audio files.
    Second argument against using the SU disk for streaming/recording is that the system can sometimes 'take over' the disk for certain background tasks you have no direct control over, and this can in some (rare, but always inconvenient) cases even disrupt or fail a recording session. An external disk is "free" from this system traffic and can dedicate its full speed purely to recording/playing back the audio files that are on it.
    Having said that, if you have a 5400rpm disk, you could improve your track count by ± 30% by replacing it by a 7200rpm disk. Your Mac will become snappier too in certain area's.
    My advice: get a FireWire external disk, and store your Logic projects there. Secondly, if your budget allows it, replace the 5400rpm internal HD with a 7200rpm HD.

Maybe you are looking for