Serial Data Record Timing

I was wondering if I might get some help in debugging some timing issues for my serial data recording.  Currently I am trying to create a loop that records data from a meter that outputs a comma-delimited string every 5 seconds.  I have attached the VI that I am currently trying to debug.
The problem I am facing now is that sometimes I am not catching the correct string.  It is catching either the tail end of a previous print, and then the read buffer is never cleared, so the data needed array cells 5, and 11 are not correct.
I was thinking that somehow I could simply wait on the data to arrive, do the reading etc, then wait 5 sec for the next bit of data -> or simply wait for the next complete string.  If anyone has any suggestions please let me know, and code examples would be great.
Please let me know if you have any questions.
Thanks
Attachments:
test_serial.vi ‏167 KB

Hi Vessel,
I noticed another point: I suppose, your meter is configured to send this string every five seconds. Since the timing of your meter and the PC is not exactly the same, you have some timing interference effects, so that after a while your "Bytes at Port"- node executes, while the meter is sending the data (9600 Baud is not very fast). That's why you get only parts of the string.
A better approach to this problem would be to periodically call the "Bytes at Port"- node until the expected amount of Bytes is given back (if you expect a defined number of bytes). Or you read in all data you receive in a short time loop and check for some end-of-String condition, after this you can parse the String for the coma-separated values.
Perhaps I could help you, maybe you post your solution to the problem,
Dave
Greets, Dave

Similar Messages

  • [svn:osmf:] 14476: DVR: using Date instead of getInterval to do local recording timing.

    Revision: 14476
    Revision: 14476
    Author:   [email protected]
    Date:     2010-03-01 05:24:17 -0800 (Mon, 01 Mar 2010)
    Log Message:
    DVR: using Date instead of getInterval to do local recording timing.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/net/dvr/DVRCastDVRTrait.as
        osmf/trunk/framework/OSMF/org/osmf/net/dvr/DVRCastNetConnectionFactory.as
        osmf/trunk/framework/OSMF/org/osmf/net/dvr/DVRCastRecordingInfo.as
        osmf/trunk/framework/OSMF/org/osmf/net/dvr/DVRCastTimeTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/net/dvr/TestDVRCastRecordingInfo.as

    Are you trying to record to "live" application which comes with default installation of FMS, if you are doing that then you will get Record.NoAccess as "live" application does not allow recording. Now hopefully you have FMIS and not FMSS. If you are having FMSS, you will just get live & vod apps and both of them you wont be allowed to record.
    Now I will assume you have FMIS :
    Please use other app to record other than "live". Renaming "live" to "live_test" or changing its location wont help, you will still get error.
    In order to record do following things,
    1. Create a folder called "recordApp" - since you are triggering record from client side you dont need any server-side code.
    2. Just change application name in your client connection URL to connect to "recordApp" instead of "live_test"
    3. You dont have to change anything in fms.ini so keep the default as it comes in installation.
    4. As mentioned by JayCharles please use :http://livedocs.adobe.com/flashmediaserver/3.0/docs/help.html?content=03_configtasks_37.ht ml for doing VirtualDirectory settings so that you can record your files in particular directory. (However I would note one thing is that VirtualDirectory feature is more for play than record/ingest)
    5.Give write permissions to your folder where you would be recording.
    please let me know if this does not work

  • While loop and data acquisition timing worries

    Hello everyone, 
    I apologize in advance if this is a silly question, but I could not find the answer around here. 
    I have made a VI to record continuously from 64 analog channels at a 5kHz sampling rate. I then stream this data to a tdms file. The data acquisition and write functions are in a while loop. 
    I the same loop, I have a bunch of other loops, that each run on their own wait timers to help limit the amount of memory they take up. I am now worried that this may somehow affect my data acquisition timing.
    If I put a bunch of timed loops within another loop, does the outer loop run at the same pace as the slowest of the inner loops? And could that mess up my sampling rate?
    I have attached my VI, in case what I just wrote makes no sense at all. 
    Thanks for any tips...
    Attachments:
    Record_M8viaDAQv3.vi ‏237 KB

    Well, looking at your code you will only write to your TDMS file one time. You have multiple infinite loops within the main/outer loop. That means that the main loop will only run a single iteration because it cannot complete an iteration until all code within it completes. With at least two infinite loops inside the loop it will never complete. Not too mention the only way to stop your code is to hit the stop/abort button. NOt a very good way to stop your code. As someone once said using the abort to stop your code is like using a tree to stop your car. It will work but not advised.
    As Ben mentioned try to understand data flow better. You have unnecessary sequence frames in your code where normal data flow will control the execution sequence.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Using Digital I/O to generate serial data stream

    Hello All,
    I am in need to generate a serial data stream. HW I use is MIO-16E-10.
    I am planning to use the digital line out to generate the serial data stream.
    I seems that if I use the wait timer the minimum pulse width I can get is
    1ms. But for my application the pulses have to be shorter than that. I was
    wondering about an alternative way to achive this. Any one who has worked
    with a similar application please help!
    Thanks in advance!
    Anand.

    Anand,
    What you are looking to do is not possible with the digital lines on the board you have.
    Depending on what other connections you have on the board, you could use one of the two analog outputs to generate your required serial data stream using pattern generation. Check the DAQ solution wizard=>Custom DAQ applications=>Analog Output=>Generate continuous sine wave. This example should give you a baseline to get started. Substitute the sine wave generator for your desired digital stream Logic 0 =0V, Logic 1=5V.
    If you need more than 2 lines, or some form of handshaking, I would suggest using the PCI-6534 or (DIO-32-HS as it was previously called) This will give you the ability to generate serial data streams with timing and/or handshaking.

  • Serial data tab page missing during Goods Receipt for Mvt type 501

    I have created and asigned the Seria data profile in plant data/Storage 2 of the material master record. Now i want to do the Goods receipt of this material with Mvtr type 501 w.r.t any documents for 5 no's and want the serial number to be createdment. I also have made relevant settings for automatic serial number and equipemnt number synchr, but wen i m in MIGO--Goods Receipt OtherMvt type 501 and enter, the serial data tab page is missing..
    How can I activate this tab page....Any steps missing....
    Can some one throw lights on this.....
    Refered relevant threads but not much useful to my query....
    Thanks
    Murad Shaikh

    Try 501 with MB1C, OR
    Check through Path SPRO -> Sales and Distribution -> Basic Functions -> Serial Numbers -> Determine Serial Number Profiles -> Select Profile 'MM' & double click on Serializing procedure at left & maintain obligatory(03) for procedure MMSL i.e. Maintain goods receipt and issue doc. Also press F1 in Serial Number Usage to read the usage.

  • Precise time stamping of serial data

    I am having trouble with precise timestamping  of incoming serial data recived on 4 ports using 4 separate threads that continually attempt to read a byte.
    When the expected frame is recieved the data is tagged with a time stamp.
    The issue seems to be windows xp or the serial ports themselves.  I am using an xsens serial to usb, 2 lavaport serial cards and the built in serial port.
    Any suggestions for precise timing?

    there is some hints:
       -for milisecond precise timestamp, you can use GetLocalTime,GetSystemTime or GetTickCount.
        But to achieve true milisecond scale, you need use timeBeginPeriod(1)/timeEndPeriod(1) otherwise you get 10-16ms scale depend on system
        (please read help pages on msdn for timeBeginPeriod function)
       - create your program to not use CPU too much(no pooling,just message and/or sync wait),
         or even better, do not run any other apllication which consume lot of CPU/DISK resources on the same PC
       - for serial communication (but this also depend on baud rate) you can try to set send/receive driver buffer to 1 (from windows device manager)
       - try different serial port card/converter(with different drivers)
       - if still need something to try, set higher process and thread priority (SetPriorityClass,SetThreadPriority)
    After all of this, on windows, there are no precise timing.Even if you do everything you can do, there is still chance to get time gap, but you can detect it (in milisecond precision)

  • Sample rate and data recording rate on NI Elvis

    I am currently working on a project that requires me to record my data at 1ms intervals or less. Currently the lowest timing interval I can record is at 10ms. If I change my wait timer to anything below 10 the recorded data in excel will skip time. For example instead of it starting at 1 ms and counting 2,3,4,5,6...,etc. It is skipping from 2,5,12,19,....,etc. So my question is if it is a limitation that I have reached on the NI Elvis or if it is possibly a problem with how I've created my LabVIEW code. My program from an operational stand point is working great, but it is my data recording that is causing me to not be able to move to my testing phase. Any help on this matter would be greatly appreciated.
    Other information that might be relevant:
    Operating System: Windows 7
    Processor: Intel(R) Xeon(R) CPU E31245 @ 3.00 GHz
    Memory: 12GB
    DirectX Version: 11
    Attachments:
    Count Digital(mod12).vi ‏76 KB

    Hi crashdx,
    So my immediate thought on this issue is that the code inside your primary while loop might be taking too long to process to achieve such a high sample rate. Especially when making calls into external applications (such as Excel) which can take a large amount of itme. 
    There is a very useful debugging tool called the Performance and Memory tool. If you aren't familiar with this tool, it will allow you to see how much memory the various chunks of your code are using and, more importantly here, how much time each subVI is taking to execute. Does the code inside your while loop take longer than 1ms to run? If so, then you will definitely see unwanted logging behavior and will need to change your approach. Would it be possible to collect more than a single sample at a time and perform calculations on a large number of samples at once before writing them to Excel in bigger chunks?
    I've included a link to the LabVIEW helpful detailing the Profile Performance and Memory tool.
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvdialog/profile/
    I would first try and figure out how long it's taking your loop code to execute and go from there.
    I hope this helps!
    Andy C.
    Applications Engineer
    National Instruments

  • DTP Error: Duplicate data record detected

    Hi experts,
    I have a problem with loading data from DataSource to standart DSO.
    In DS there are master data attr. which have a key  containing id_field.
    In End routine I make some operations which multiple lines in result package and fill new date field - defined in DSO ( and also in result_package definition )
    I.E.
    Result_package before End routine:
    __ Id_field ____ attra1 ____  attr_b  ...___   attr_x ____ date_field
       ____1________ a1______ b1_________ x1         
       ____2________ a2______ b2_________ x2       
    Result_package after End routine:
    __ Id_field ____ attra1 ____  attr_b  ..___   attr_x ____ date_field
       ____1________ a1______ b1_________ x1______d1         
       ____2________ a1______ b1_________ x1______d2    
       ____3________ a2______ b2_________ x2______d1         
       ____4________ a2______ b2_________ x2______d2   
    The  date_field (date type)  is in a key fields in DSO
    When I execute DTP I have an error in section Update to DataStore Object: "Duplicate data record detected "
    "During loading, there was a key violation. You tried to save more than one data record with the same semantic key."
    As I know the result_package key contains all fields except fields type i, p, f.
    In simulate mode (debuging) everything is correct and the status is green.
    In DSO I have uncheched checkbox "Unique Data Records"
    Any ideas?
    Thanks in advance.
    MG

    Hi,
          In the end routine, try giving
    DELETE ADJACENT DUPLICATES FROM RESULT_PACKAGE COMPARING  XXX  YYY.
    Here XXX and YYY are keys so that you can eliminate the extra duplicate record.
    Or you can even try giving
        SORT itab_XXX BY field1 field2  field3 ASCENDING.
        DELETE ADJACENT DUPLICATES FROM itab_XXX COMPARING field1 field2  field3.
    this can be given before you loop your internal table (in case you are using internal table and loops)  itab_xxx is the internal table.
    field1, field2 and field 3 may vary depending on your requirement.
    By using the above lines, you can get rid of duplicates coming through the end routine.
    Regards
    Sunil
    Edited by: Sunny84 on Aug 7, 2009 1:13 PM

  • How to restrict number of Data Records from Source system?

    Hi,
    How can I restrict the number of Data records from R3 source system that are being loaded into BI. For example I have 1000 source data records, but only wish to transfer the first 100. How can I achieve this? Is there some option in the DataSource definition or InfoPackage definition?
    Pls help,
    SD

    Hi SD,
    You can surely restrict the number of records, best and simplest way is, check which characteristics are present in selection screen of InfoPackage and check in R3, which characteristics if given a secection could fetch you the desired number of records. Use it as selection in InfoPackage.
    Regards,
    Pankaj

  • How to delete data-records with BI-planning in BEx?

    Hi folks, masters and gurus,
    we just upgraded some of our functions from BPS to BI-Planning.
    Only one thing I could not resolve up to now:
    In BPS (web based) it was easily possible to delete data-records by choosing a radio-button beside the data-entry-field and click the "delete"-button (a red "-") on the top.
    When I tried to find a delete-function in RSPLAN now I only found one that deletes the data, but not the record itself.
    Does anyone know how to build a function that I can use to delete data-records?
    Thx in advance for your help,
    Thomas

    Oh yes ... it´s not necessary as it is easily possible to supress lines with only 0 in it with
    query-properties / rows/coloumns / supressing Zero / activ ...
    Edited by: Thomas Kejik on Jan 19, 2009 9:46 AM

  • How to check data records in R/3 (source system)

    Hello,
    I need to check the data records in R/3 (source system). Is Transaction RSA3 the only option or is there another way. When I use RSA3, all I see is the sandbox and cursor. Nothing seems to happen.
    Pls help.
    SD

    Hi Sebastian,
    To some extent this works out i.e Comparision of Tables in R/3 Vs ODS at BIW.
    Tables in R/3 like VBAK(Order),VBRK(Billing),MKPF(inventory Management) and LIKP(Delivery)
    compare them with the respective Datasource/PSA/ODS
    2LIS_11_VAITM
    2LIS_12_VCITM
    2LIS_13_VDHDR      
    2LIS_03_BF
    in the BIW.
    The Total numbers of Document Numbers ,Quantity or Value should match !!!!!!!!
    Hope it helps !!
    Rgds
    SVU123
    Edited by: svu123 on Mar 3, 2009 1:16 PM

  • How can I copy text from a table in a format that's readable when I paste it into an internet based data recording system?

    I have to fill in forms regarding foster children every week, then export the text to an on-line data recording system for each child. The old pages let me copy (cmdA ) the whole document and past it into where it needs to go.
    The new version includes inverted commas and I have to copy the document headers separately from the information contained in the table. It's a bit of a pain!

    I have to fill in forms regarding foster children every week, then export the text to an on-line data recording system for each child. The old pages let me copy (cmdA ) the whole document and past it into where it needs to go.
    The new version includes inverted commas and I have to copy the document headers separately from the information contained in the table. It's a bit of a pain!

  • Revaluate data record at the time of loading from flat file or BI Cube

    Hello Friends,
    I want to revaluate a data record at time of loading using Transformation or Conversion File, based on some condition.
    Like, I have a rule to identify that a record is supposed to be multiplied by -1 or not.
    For example,
    *if (ID(1:5) = str(00070) then(Record-1)
          ID(1:5) = str(00071) then (Record-2)
    Can you please guide me how can I achieve this by using Transformation file or Conversion file?
    Regards,
    Vishal.

    Hi Nilanjan,
    Thanks for reply.
    I tried the script you suggested in conversion file for Account.
    But It is not working for me.
    Even I tried simple multiplication and also addition in Formula column it is not working.
    External   -->   *
    Internal    -->    *
    Formula   --->  Value * -1
    Above conversion file for Account was not working for me.
    then I tried
    Formula  --> Value + 100
    It also did not work for me.
    Kindly suggest if I am doing anything wrong in above file.
    Thanks,
    Nilanjan.

  • Duplciuate Data record error while reloading a DTP

    I have a DTP created to load etxt datasource and put in the process chain. I have set "delta mode" so that it picks up if additional records are available.
    But, I noiticc that when there are no additional records (for eg: earlier load had 269 records and current load has same 269 records), I am gettign the error - "Duplciate data record" and status is set as "Red". I do not want to see error in this case as it did not find any new records and want the status to be green if there are no new records.
    Could you please suggest what settings will do that.
    Regards
    Raj

    Delta DTP will fetch only unloaded requests ( requests which donot exist in target ) and not additional records.
    Is the text datasource delta enabled ?
    Do you have Infopackage of Update type Delta setup?
    Did you run a Full DTP before Delta DTP?
    Assuming Full Infopackage has loaded 269 records to PSA and the same will be loaded ( if no additional records in source system ) again.
    Req 1 - 269 - Yesterday
    Req 2 - 269  - Today
    Full DTP ran yesterday will load 269 records to target.
    Delta DTP ran today will load Req1 & Req 2 to target ( master data will be overwritten ) - Reason Delta DTP is acting like Init with data transfer.
    You can start off with a Delta DTP instead Full, if Full DTP is ran before a Delta DTP maje sure you delete requests loaded by Full DTP.
    This can be ignored as this is Master Data which wil be overwritten.
    To get rid of error jst Check " Handle Duplicate Records " in  Update Tab of DTP.

  • Error on activation of data records from ODS object

    hi,
    Kindly help with my BW Problem, the error occured on the
    activation of ODS. The error says "<i>Request
    REQU_43MNOPW29W4F5M037J7OAFP52 in ODS ZPUR_O01 must have QM
    status green before it is activated</i>" and "<i>Activation of data
    records from ODS object ZPUR_O01 terminated</i>"
    I tried to check the data in the ODS Object by choosing
    <LS>Administrator Workbench > data targets > context menu on ODS
    Object ZPUR_O01 but the status are green and when i tried to
    activate it the logs says "<i>ODS object ZPUR_O01 was built
    incorrectly. Cannot update request
    REQU_43MODQ3GF69X17B71ZKQMN85I(20,154)
    ODS object ZPUR_O01 was built incorrectly. Cannot update request
    REQU_43MQ8A8F0L1US5COQTUUWX3BA(20,155)
    ODS object ZPUR_O01 was built incorrectly. Cannot update request
    REQU_43MQ8OQQTY21YQ37RMA1WMO06(20,156)
    Data to be activated successfully checked against archiving
    objects                                   
    Activation of data records from ODS object ZPUR_O01 terminated</i>"
    Please help me with this problem.

    Hi Jay
    U need to update these requests to ODS
    REQU_43MODQ3GF69X17B71ZKQMN85I(20,154)
    REQU_43MQ8A8F0L1US5COQTUUWX3BA(20,155)
    REQU_43MQ8OQQTY21YQ37RMA1WMO06(20,156)
    1) delete the current request
    2)Reconstruct the requests above three request
    3)and then Load the current reqest (REQU_43MNOPW29W4F5M037J7OAFP52)
    Then only u will be able to activate the ODS....
    This is an serialization issue...
    hope it helps
    regrds
    AK
    assign points if usefull

Maybe you are looking for

  • Unable to open encrypted pages with 11.0.02 on Win7 IE10 system fully updated.

    Just get blank screen with "X" in upper left. Have searched this forum and tried all suggestions including: Cleared and reset all IE10 settings - no luck Disabled and enabled Adobe add-ins - no luck Right click on link and 'save as' or 'open' and oth

  • If i know class name ,can i find out application set name in CRM for PCUI

    Hello, i found the class name in debugging..it is cl_crm_bsp_frame_sres now i want to make it as z class to make the changes to the methods. for that i need to know the application set name or zname... so that i can modify the configure settings by g

  • LSO Offline player error

    HI, when trying to open a course in lso with offline player , the following error occurs: Could anyone help me solve this pls. Downloading resources failed com.sap.hcm.ls.offline.manager.store.OfflineStoreException: Downloading resources failed at co

  • Replace portmap with rpcbind?

    Are there any plans to replace portmap with rpcbind?. Reason being that portmap doesn't support IPv6 where as rpcbind does. Thanks for any replies.

  • Spit water on macbook pro what should i do?

    I spit on my mbp and i dont know what to do. It turned off right after i spit water on it i tried to dabb it off but it turned off . It hasnt been on since. Its been off for about 5 days i also read online that if i hold the control command and power