Jump to content

df_rob

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by df_rob

  1. Hi James,

     

    Hope you are well! Hopefully you can answer a question I have about your Messaging Library. I'm currently using it to try and implement some TCP communications (using your TCP messenger Library.) One problem I am having is trying to make multiple unique TCP event messengers (upto n), that can be serviced by a registering processes. This means the processes need to be able to register for them at run-time. I dont suppose you have any recommendations on how to acheive this?

     

    EDIT: Looks like I was being really dumb here, I didnt notice the obs registry in the client... solution is clear now, but any recommendations feel free to make them!

     

    Thanks!

  2. Have you turned off auto-scaling?

     

    Thanks, for the reply. It was off, but I have changed a fair bit now in response to the below posts.

     

    Can your display and your eye keep up with updating 1000 times per second a graph with one point? Wouldn't it be more sensible and less cpu & gpu intensive, not to mention timing exact, to update it 5 times per second with 200 new points?

     

    Remember that also Chart History Length gets in the way. Default is 1024 which is much less than 10sec * 1000Hz.

     

    Ah now that I think, for a waveform chart you don't even need to bother setting dynamically x axis limits. Update mode Strip chart does it.

     

     

    Okay you set up your hardware to sample at 1Khz, but then you choose to read it one sample at a time, so you hope to read a sample every ms.  But you also need to do some thread swapping because every iteration you are using property nodes.  Wouldn't it be better to say read n values at once, then wait however long you want, and read how every many samples there are to read?  Change polymorphic type to one channel N samples.

     

    You're going to want to use a waveform graph as well, and keep the history your self.  After you read N samples append them to the previous samples, then if the array size is too large, containing too much time, use array subeset to get the last N samples.

     

    Thanks for the feedback, I believe I have made the recommended changes:

     

    waveform_scaling_v2.jpg

  3. Hi everyone,

     

    I'm having some problems with my waveform charts, I dont quite understand how the below code isnt working (see screenshot). It just flickers... any ideas? The intention of the code is to programatically show the last t seconds worth of data when sampling continously at 1 kHz. Where t is some value defined by the user, however in the screenshot t is a constant set to 10.

     

    Thanks for your time!

     

    waveform_scaling.png

  4. Hi Rob,

    You need to wrap multiple INSERTs into a single transaction with “BEGIN†and “COMMITâ€.   Each transaction requires verified writing to the disk twice, and a hard disk only spins on the the order of once every 10 ms.   You need to buffer your data and do a bulk insert about once a second (place a FOR LOOP between the “Prepare†and “Finalize†subVIs in you code image, and feed in an array of your data clusters).

     

     

    This touches on jollybandit’s question (5): durability against power failure by confirmed writing to disk is time consuming, so you need some kind of tradeoff between immediate saving and delayed buffering.   About one save per second is what I do.

    Thanks alot James! I will try implementing the above.

     

    EDIT: I have just tried this and it works! Thanks, again. I missinterpreted the solution to jollybandits problem.

  5. Dont suppose anyone knows why this INSERT routine is taking so long (38 ms)? My storage loop cant get anywhere near the speed of my DAQ loop and eventually I get a buffer overflow. I believe I am using the BEGIN and COMMIT correctly, the speed of DAQ is 1 kHz so this routine is executed once per cycle.  (see sattached screenshot) Thanks!

     

    SQLite3_DB_Slow.jpg

  6. Hi,

     

    Recently I have been trying to develop a set of classes for data aquisition (as the encapsulation makes other tasks easier) however I keep running into several issues (described below). I was wondering what you guys did for your OO DAQ systems. I've found a few presentations lying around on the net but their implementations do not seem to work when using DAQmx based measurements.

     

    I am trying to measure the inputs from two seperate instruments: (1) Torque Sensor (2) Encoder. Sometimes these instruments might  be using a DAQmx analog input and other times a .DLL.

     

    My original thought was that I would have a parent class called Measurement with several functions (Initalize, Configure, Read Data, Close) that would be over-riden by its children Analog Input (DAQmx) and Digital Input (Seperate .DLL). There then would be (for example) an Analog Input object created called position and a digital Input object called torque. This seemed to look nice on paper, however it didnt work as my DAQs tasks need to be combined (you cant have several tasks on a single device.)

     

    As this didnt work, I approached it with a different setup. This time I had a parent class called Instrument that has two children Torque Sensor and Encoder. Again, things get tricky, as sometimes I might want to use an analog DAQmx task for both the Torque Sensor and Encoder. 

     

    What is your typical OOP class structure like for DAQ?

     

    Thanks!

  7. Hi,

     

    I’m looking to recreate this line of C code in a similar manner in LabVIEW. Any contributions are greatly appreciated, thanks.

     

     

     

    sscanf(aline, "%d%*1c%1c%1c%*1c%2c%*1c%f%f%d%f%f%*1c%5c%*1c%3c%*1c%5c%*1c%5c", &ic,c1,c2,comm,&axial,&radial,&angular,&efbhs, &holdinch,rext,amppercent,testcode,iac)

    below are three sample data strings that this function can read:

     

     

        626        8.45  2.03 226 0.04  0.00           2    13.01   626    627 C      8.47  1.30 293 0.10  0.00  1.00     27            0    628 C      8.48  1.32 296 0.12  0.00  2.00     28   13.01    1

     

    As you can see, in some cases some fields are missing (but still valid). In C this is straight forward to read but in labVIEW I can't seem to account for the cases where the data is not present.
     
    My current work around requires ignoring the errors the labVIEW 'scan string' function is throwing but there must be a valid way to do this in labVIEW!
     
    Usefull Info:
    - Fixed number of fields.
    - Data Not delimited.
    - Data generated from another program so I can't add delimiters.
    - The characters (%c) are being read as strings in my current labVIEW implementation.
     
     
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.