Write time difference to spreadsheet

Hello!
I am having trouble writing the time difference between my set of six swiches to a spreadsheet. I would like only six values to appear on the spreadsheet, the differences between the start and stop of each respective set of switches. I have tried what I normally do when I write to a spreadsheet but was running into issues...
Thanks for your help!
Solved!
Go to Solution.
Attachments:
twelve_working_switches.vi ‏34 KB

Blizabeth,
I believe that we can assume that all switches start in the same configuration and therefore have the same start time, no?  That is the call to the Get Date/Time in Seconds.vi at the beginning (only one needed).  Then, we are simply looking for when the value changes for each individual switch.  The time difference is recorded in the array of 6 doubles.  If you need to, you can basically duplicate this for the second set of channels as none of the code changes.
I suggest strongly that you consider reading up on Labview and reviewing the examples that are provided in the LV shipment.  Johnson and Jenning's book Labview: Graphical Programming is an excellent start.  However, I believe that you may be having issues that might be best resolved by going over books on some of the fundamental aspects of programming.  I am not trying to be difficult, but as for(imstuck) pointed out, I believe that I probably gave you the solution.  Try going through it over the next day or so and see if you are still having trouble understanding how to apply this.  If you still are, then we most likely have an issue with 1) the communication of the requirements of you project or 2) a simple misunderstanding about how exactly to use Labview.  
I am sorry, I know this doesn't help in the near term, but I think that spending a little time understanding the problem and the solution both for(imstuck) and I proposed (which are essentially the same) will help you immensely .  
Peace, Matt 
Matt Richardson
Certified LabVIEW Developer
MSR Consulting, LLC

Similar Messages

  • Write elapsed time to a spreadsheet in hours:minutes:seconds format

    Hi everyone,
    I've been trying to write an elapsed time to a spreadsheet file in an hours:minutes:seconds format, but the time is displayed in a floating point value of seconds..
    how can I write to a spreadsheet in an hours:minutes:seconds format.
    Thank you,
    James-

    I often use a subVI that converts Seconds to Hours, Minutes and Seconds. Use the Quotient and Remainder function to divide your elapsed time by 3600, 60 and 1. You can then convert those values to a modified string and use the Write to Spreadsheet File.
    As Dennis said, newer versions of LabVIEW's Write to Spreadsheet File.VI can handle arrays of Double, Integer or String automatically, and in older versions, the Write to Spreadsheet File.VI can be modified and copied to handle strings.
    Hope this helps.
    (Written in 8.5)
    Message Edited by LabViewGuruWannabe on 01-18-2008 09:28 PM
    Attachments:
    TimeToSpreadsheet.vi ‏26 KB
    SecondstoHMS.png ‏32 KB

  • How to write a query to get the time difference of two varchar type time columns

    Hi,
    I want to get the time difference between the two varchar type columns.please see the attached image for more details:
    My requirement is like:
    timestarted
    timeended
    timediff
    9:00:00
    10:00:00
    1:00
    9:15
    9:30:00
    0:15

    Storing time alone as VARCHAR2 value is a incorrect design. Always store it as DATE or TIMESTAMP.
    If you already have a messed up design and cant change it, then you need to convert your VARCHAR2 time into a DATE or TIMESTAMP and find the difference. I have converted it to TIMESTAMP and obtained the difference as INTERVAL.
    SQL> with t
      2  as
      3  (
      4  select '09:00:00' timestarted, '10:00:00' timeended from dual
      5  union all
      6  select '09:15:00' timestarted, '09:30:00' timeended from dual
      7  )
      8  select timestarted
      9       , timeended
    10       , (timeended - timestarted) day to second diff
    11    from (
    12          select to_timestamp('01011900' || timeended, 'ddmmyyyyhh24:mi:ss') timeended
    13               , to_timestamp('01011900' || timestarted, 'ddmmyyyyhh24:mi:ss') timestarted
    14            from t
    15         );
    TIMESTARTED                                        TIMEENDED                                          DIFF
    01-JAN-00 09.00.00.000000000 AM                    01-JAN-00 10.00.00.000000000 AM                    +00 01:00:00.000000
    01-JAN-00 09.15.00.000000000 AM                    01-JAN-00 09.30.00.000000000 AM                    +00 00:15:00.000000
    SQL>

  • Write time stamp and Voltage to text file

    I am a novice 2011 LabVIEW user and am trying to build a program that will write TIME in one column and VOLTAGE in another to a text file for later interpretation with MATLAB. I started to add elements to an existing code, which I downloaded from the examples forum, because it works well for my purposes of sending a finite square signal. The code that I started modifying is attached to this thread. If somebody wants to take the time to provide me with an example of how I can do this with my existing code, it would be greatly appreciated. I learn better from example.
    Regards,
    Sean. 
    Attachments:
    Voltage - Generate and Write.vi ‏99 KB

    This is a pretty simple set of code that every 5 seconds writes to a csv file that is stored in the location shown in the code. In order to apply something similar to your code simply run the data that you wish to store into the concatenate strings in the form of a string and it should be fine. 
    Although after looking over your code a second time you should probably take a look at the convert "Array to Spreadsheet string" function, all you would have to feed it is an array of times and measurements at the completion of your program and feed it into a file and it should do everything for you.
    Attachments:
    Write to File.vi ‏20 KB

  • Time difference between physical and logical standby

    Hi,
    I have just been tasked on getting some info and setting up dataguard for some users for read-only/reporting purpose.
    The 3 questions I am being asked are:
    1. What is the time difference in applying changes from primary to physical standby compare to logical standby
    2. What is the overhead maintenance of having a standby database?
    3.What latency is involved?
    I will be glad to have your input on this.
    Thanks

    Hi,
    Physical Standy where its a read only DB.
    Logs are applied.
    Logical Standy where it can be Read / Write DB and the logs are applied in terms of SQL Statements.
    Thanks & Regards,
    Pavan Kumar N

  • Time difference

    Gurus,
    I need to write ABAP code in my transformation which will calculate the time difference in seconds.
    I have a start date,start time and end date,end time.I need to calculate the difference in seconds.
    Can any one give me the ABAP code.I am using BI 7.
    Regards,
    Sunita

    Hi,
    Can you please elaborate??
    what time units does your start time has??
    Is it in hours?minutes? or seconds?
    first calcuate days difference:
    In the routine include all the four fileds: Start date, start time, end date, end time.
    I pressume them as P,Q,R and S respectively.
    use FM  : HR_99S_INTERVAL_BETWEEN_DATES to calculate the difference of days between the two dates
    after u get the days difference multiply with 2460*60.
    and if u can tell me the format of the start times and end times then i can write the code for the difference as well

  • Date formats-time difference

    Hi,
    Any function module which can give the date and time difference if i input the date and time in the following format
    20090322       (date)
    20090321       (date)
    040004 (time)
    040000 (time)
    I had checked the other FM's but those are not in synch with the date format I am giving.Do anyone here know about a FM which can give the time difference even if we input the date and time in the above format.
    Format is the problem I am facing.
    Thanks,

    Hi Folks,
    I just want to avoid all the below computations and expecting to get the result irrespective of whichever the date format is,ie a function module which gives me the time difference irrespective of the date format that is fed as input.Seems it is not possible.
    data:date1(08) type C value '20090322',
         date2(08) type c value '20090322',
         time1(08) type c value '060648',
         time2(08) type c value '062403',
         date3(08) type C,
         date4(08) type c,
         time3(08) type c,
         time4(08) type c,
         temp1(08) type C,
         temp2(08) type c,
         temp3(08) type c,
         temp4(08) type c,
         temp5(08) type C,
         temp6(08) type c,
         temp7(08) type c,
         temp8(08) type c,
         temp9(08) type c,
         temp10(08) type c,
         temp11(08) type c,
         temp12(08) type c,
         gpdt type d,
         gptm type t,
         smsdt type d,
         smstm type t,
         e_tdiff type cva_time,
         v_diff type cva_time,
         e_days type i.
    temp1 = date1+0(4). "year
    temp2 = date1+4(2)."month
    temp3 = date1+6(2). "date
    temp4 = time1+0(2)."hrs
    temp5 = time1+2(2)."mins
    temp6 = time1+4(2)."secs
    temp7 = date2+0(4). "year
    temp8 = date2+4(2)."month
    temp9 = date2+6(2). "date
    temp10 = time2+0(2)."hrs
    temp11 = time2+2(2)."mins
    temp12 = time2+4(2)."secs
    concatenate: temp3  temp2  temp1 into gpdt,
                  temp9  temp8  temp7 into smsdt,
                  temp4  temp5  temp6 into gptm,
                  temp10  temp11  temp12 into smstm.
    CALL FUNCTION 'SCOV_TIME_DIFF'
      EXPORTING
        im_date1                    = gpdt
        im_date2                    = smsdt
        im_time1                    = gptm
        im_time2                    = smstm
    IMPORTING
       EX_DAYS                     = e_days
       EX_TIME                     = e_tdiff
    * EXCEPTIONS
    *   START_LARGER_THAN_END       = 1
    *   OTHERS                      = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    write:/ e_tdiff,
            e_days.
    Thanks,

  • How to calculate the % of time difference between different state

    Hi there,
    The below query returns the follwoign outptut. I need to calculate the % of time period that a specific state ( state ex: open or closed or all report )exists.
    I have to find the time difference between the 2 states . How could I do that ?
    The first row shows null for the previous state . How could get actual previous state for the first row?
      SELECT si.station_name,
                    vppstation.avi_control_state_code.STATE_SHORT_NAME,
                    ash.state_id ,
                    lag(ash.state_id) over (order by ash.STATE_EFF_DATE desc) previous_state,
                    TO_NUMBER(TO_CHAR(ash.state_eff_date, 'SSSSS')) "periods in sec",
                    TO_CHAR(ash.state_eff_date, 'dd-mon-yyyy hh24:mi:ss am') "Date"
               from vppstation.avi_state_history ash
    left outer join vppstation.avi_control_state_code
                 on ash.state_id = vppstation.avi_control_state_code.state_id
    LEFT OUTER JOIN vpproadside.stations_installed si  
                 ON ash.station_id = si.station_id               
              where ash.state_eff_date >= to_date('28/02/2010', 'dd/mm/yyyy')
                and ash.state_eff_date <= to_date('03/03/2010', 'dd/mm/yyyy') ;
           group by si.station_name
                         ash.state_id
           order by ash.state_eff_date asc ;
    STATION_NAME                   STATE_SHORT_NAME STATE_ID               PREVIOUS_STATE         periods in sec         Date                   
    IRDNCST02                      Open             1                    NULL                  85166                  01-mar-2010 23:39:26 pm
    IRDNCST02                      All Report       3                      1                      85159                  01-mar-2010 23:39:19 pm
    IRDNCMT01                      Closed           2                      3                      81376                  01-mar-2010 22:36:16 pm
    IRDNCST02                      Open             1                      2                      78723                  01-mar-2010 21:52:03 pm
    IRDNCST02                      All Report       3                      1                      76023                  01-mar-2010 21:07:03 pm
    IRDNCMT01                      Open             1                      3                      55922                  01-mar-2010 15:32:02 pm
    IRDNCMT01                      Closed           2                      1                      54931                  01-mar-2010 15:15:31 pm
    IRDNCHA01                      Closed           2                      2                      41291                  01-mar-2010 11:28:11 am
    IRDNCAS01                      Open             1                      2                      38847                  01-mar-2010 10:47:27 am
    IRDNCAS01                      All Report       3                      1                      37947                  01-mar-2010 10:32:27 am
    IRDNCST02                      Open             1                      3                      35332                  01-mar-2010 09:48:52 am
    IRDNCST02                      All Report       3                      1                      32632                  01-mar-2010 09:03:52 am
    IRDNCST02                      Open             1                      3                      31502                  01-mar-2010 08:45:02 am
    IRDNCST02                      All Report       3                      1                      28802                  01-mar-2010 08:00:02 am
    IRDNCHI01                      Open             1                      3                      25368                  01-mar-2010 07:02:48 am
    IRDNCHI02                      Open             1                      1                      23939                  01-mar-2010 06:38:59 am
    IRDNCMT01                      Open             1                      1                      20696                  01-mar-2010 05:44:56 am
    IRDNCCH02                      Open             1                      1                      13452                  01-mar-2010 03:44:12 am
    Edited by: Indhu Ram on Mar 11, 2010 1:34 PM
    Edited by: Indhu Ram on Mar 11, 2010 2:20 PM

    If you look at the table which is output of the given query , there is column called "STATE_ID" It shows the current state ie open or closed or all report.
    The column 'PREVIOUS_STATE' shows the state before the current state. .In the table in 2nd row in previous_state column there is state_id = 1 (open)which is the state before 'all report state'

  • How to measure time difference between zero crossing of a sine wave and rise time of a pulse on a same graph?

    I have a 50Hz sine wave and a pulse signal on a same graph. The phase difference between two is between 0-90 degrees.
    Now I need to calculate the time difference between (when the sine wave crosses zero volts) and (when the pulse rises). The frequency will stay approximately same for both signals.
    The application is for a three phase generator. In simple words, when the time difference between the zero-crossing of sine wave and the pulse rises increases, that means that the load on the generator has increases.
    I am a beginner user of LabView (version 9, 2009), maybe it is a very simple problem but I've been pulling my hair out for the last few days and coudln't figure anything out. Any help would be greatly appreciated. I am using DAQ USB-6008 to measure these voltages and pulse from the generator and a sensor
    I have attached a jpg (a graph that i just made with excel to explain). The time 't' is what I am trying to measure
    Cheers
    Awais 
    Message Edited by awais.h on 03-30-2010 11:20 PM
    Message Edited by awais.h on 03-30-2010 11:21 PM
    Solved!
    Go to Solution.

    Hi
    Thanks for the code but I'm afraid it won't work. Like you said the probability of choosing a value that is on both graphs may not happen. This is something that I would like the code to do automatically.
    But I did use the previous code posted and made some modifications to it and it seems to work perfectly. Now the next thing is to be able to get just that one value that tells you the first time difference.
    Here is what I get using that code.
    As you can see from the t Values. I only need the one that is highlighted. If there is a way to filter out the rest it would be great.
    I was thinking of a while loop and as soon as the value is higher than 3E-5 it would store the number and stop the loop, but I'm not too familiar with arrays in labview.
    Here is the the code modified.
    As you can see, it wasn't that big of a modification and it still is your code.
    I will keep trying.
    Thanks for the help
    Attachments:
    FinalShockSpeed.vi ‏55 KB

  • Lost connection detection time difference

    Having a problem understanding why a broken JDBC connection is detected under Windows much quicker than it is under Linux.
    I have an process that opens a connection to MSSQL using JDBC, a Stored Procedure is then executed and the result set
    processed, this execute step is repeated every 60 seconds or so. If any exception is thrown then resources are closed, sleep
    for 60 seconds, the connection is reopened (if fails then sleeps and repeats), once reopened the process continues. There is logging throughout
    the above steps.
    On Windows Vista 64bit Sun Java platform the process runs fine, if I deliberately break the connection (stop MSSQL service), the process
    logs a problems within 60 seconds and starts handling the error, when the MSSQL comes back then within 60 seonds the connection is remade
    and the process continues as expected.
    Under Ubuntu 10 64bit both Sun and OpenJDK the process runs fine, until the connectionis broken, as it takes about 17 minutes for the exception to be thrown
    for the broken connection (stopped MSSQL) to be detected, as opposed to under Windows taking seconds. Once detected then the process works as expected, retrying
    and reconnecting as it should.
    The libs and code used are the same the only difference between the windows and linux versions are the logging path parameter, have tried with different versions of Java
    and with different MSSQL JDBC drivers.
    What could be the reason for the time difference in the lost connection detection between Windows and Linux? Any help tips would be most welcome.
    Thanks.

    The connection is only made once and used throughout, it is only closed if there is a problem. This runs absolutely fine with logging for weeks, the execute and processing take millisecondsIt is pointless to keep the connection in that situation. Create it every time.
    Doing that might even fix your problem. But regardless you should still not keep it.
    Have jujst checked the timings and if the db connection is broken the on Linux (Ubuntu) the exception generated by step 4. takes up to 15 minutes 35 seconds to move on to step 7. on Windows though it is instant, there is a log message output prior to the execute statement this outputs then the exeception logged.You have an existing connection.
    Then you attempt a request which I am guess takes 17 minutes to timeout. (That happens because you are testing by stopping the server.)
    That is the problem.
    First verify the connection url. It might have timeout values in it.
    If not then the next most likely cause is that someone changed the OS (not java) TCP timeout values. Bad idea if they did. And the only way to fix is to change them back to something reasonable. You can code around this by using two threads. One that sets a timer and the other that runs the request. If the timer fires then attempt to cancel the request (see the jdbc api.)

  • On RAID 10 - How to relieve Log Writer Slow Write Time Trace Files

    We have a DELL 8 CPU 5460 3.16Ghz Xeon with Dell Open Manage RAID 10 array
    Oracle 10g 10.2.0.4 on RedHat EL 5 with
    filesystemio_options='' (DEFAULT)
    disk_asynch_io='TRUE' ( NOT DEFAULT)
    Running 2 instances 64 bit 10g 10.2.0.4 with an app that does a lot of row updates and uses BLOBs heavily.
    Our storage (RAID 10) is presented through a single mount point.
    I periodically see these messages in a lgwr trc file as follows
    Warning: log write time 560ms, size 5549KB
    *** 2010-02-25 17:22:24.574
    Warning: log write time 650ms, size 6759KB
    *** 2010-02-25 17:22:25.103
    Warning: log write time 510ms, size 73KB
    *** 2010-02-25 20:33:00.015
    Warning: log write time 540ms, size 318KB
    *** 2010-02-25 20:35:17.956
    Warning: log write time 800ms, size 5KB
    Note that most of these are larger chunks of data.
    Our log wait histogram is as follows:
    106 log file parallel write 1 465780158
    106 log file parallel write 2 5111874
    106 log file parallel write 4 5957262
    106 log file parallel write 8 2171240
    106 log file parallel write 16 1576186
    106 log file parallel write 32 1129199
    106 log file parallel write 64 852217
    106 log file parallel write 128 2092462
    106 log file parallel write 256 508494
    106 log file parallel write 512 109449
    106 log file parallel write 1024 55441
    106 log file parallel write 2048 11403
    106 log file parallel write 4096 1197
    106 log file parallel write 8192 29
    106 log file parallel write 16384 5
    In discussions with the group that builds and maintains the systems (DBA's do not) we have asked for more spindles / hba's / mount points to address this issue. We have been advised that since the RAID 10 spreads the I/Os across multiple drives this is not going to affect the situation.
    Our thoughts are that multiple HBAs going to separate RAID 10 devices would help relieve the pressure.
    Thank you.

    Is this an internal RAID array? Is it composed of SCSI (SAS) or SATA drives? How many drives are in the array?
    Does the RAID controller have a built in battery backed cache (some of Dell's RAID controllers have 128MB, 256MB, or 512MB of battery backed cache). If the RAID controller has a battery backed cache, consider disabling the caching of all read operations, and set the write policy to write-back (see: http://support.dell.com/support/edocs/software/svradmin/5.1/en/omss_ug/html/cntrls.html ).
    Charles Hooper
    Co-author of "Expert Oracle Practices: Oracle Database Administration from the Oak Table"
    http://hoopercharles.wordpress.com/
    IT Manager/Oracle DBA
    K&M Machine-Fabricating, Inc.

  • How to find out time difference between 2 consecutive characters coming in

    Hi
    Data is coming on serial port and m taking this data in a input stream.I need to know the time difdference between consecutive characters.Any ideas?

    What do you mean? If you meassure the time between two characters, you want to calculate how accurate it is? First you would need to find out how accurate the System.currentTimeMillis is on the platform you run on. That may be easy
    long start = System.currentTimeMillis();
    long end;
    while ((end = System.currentTimeMills()) == start);
    long delta = end - start;But sometimes (on win98) it reports 50, other times 60. So its not quite accurate. But you could redo that test a couple of times and take the avg or the max.
    Then if you get a time difference of 0ms between two characters, you know it will be somewhere 0 and 60ms. If you get 60ms between two characters, you know it will be somewhere between 0 and 120 ms. It's +/- delta seconds accurate.
    Would this be a way to calculate the percentage accuracy: 100.0-100.0*delta/(time+delta)
    Still better to meassure the time over more than just 2 characters unless it is a very slow stream.

  • Execution time difference between SELECT & UPDATE statement in JDBC Sender.

    Hi Experts,
    In my scenario, I have used the JDBC Sender Adapter with the SELECT and UPDATE statement.
    Now the problem is in between the execution of Select and update statement, few more entries are coming in the same DB Table.
    So result of this is updation take place for those entries which are not even picked up by the select statement.
    Can we avoid this execution time difference between the SELECT & UPDATE statemet on JDBC Sender side???
    Thanks & Regards
    Jagesh

    Hi
    Use serializable option in additional parameters, now all new entries would also be updated.

  • How to find the date and time difference in InfoPath 2013?

    Hi All,
    My date and time format is like: 2013-12-24T10:47:38 and have three fields Start date, End date and Actual time taken.
    If start date and end date filled then actual time taken field should automatically should fill, for example 2 days 12 hours 48 min 3 sec.
    How to achieve this?

    Hi Sam,
     I believe we had discussed the same issue in the below thread. Can you please refer the below one?
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
    If it's not helping you please let us know
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to get exact date and time difference?

    Hi,
    When i am using the below sql statement:
    SELECT (TO_DATE('7/27/2006 05:00:15 PM','MM/DD/YYYY HH:MI:SS PM') - to_Date('7/27/2006 8:30:13 AM','MM/DD/YYYY HH:MI:SS AM')) * 24 hours FROM DUAL;
    the output is:
    Hours
    8.50055555555556
    But Actually it is 8.30
    So how can i get exact days and time difference between two dates in Oracle?
    Thanks....
    Regards,
    Suman Sakinala
    Edited by: SSN on Sep 19, 2008 1:27 AM

    Or more clearly (this time I have my date_from and date_to the right way around hehe!)
    SQL> ed
    Wrote file afiedt.buf
      1  WITH t as (select TO_DATE('7/27/2006 05:00:15 PM','MM/DD/YYYY HH:MI:SS PM') as dt_to,
      2                    TO_DATE('7/27/2006 08:30:13 AM','MM/DD/YYYY HH:MI:SS AM') as dt_from FROM DUAL)
      3      ,d as (select (dt_to-dt_from)*24 as diff_hrs from t)
      4  -- end of dates
      5  SELECT TRUNC(diff_hrs) as hours
      6        ,TRUNC(((diff_hrs) - TRUNC(diff_hrs))*60) as mins
      7        ,TRUNC(((((diff_hrs) - TRUNC(diff_hrs))*60) - TRUNC(((diff_hrs) - TRUNC(diff_hrs))*60))*60) as secs
      8* FROM d
    SQL> /
         HOURS       MINS       SECS
             8         30          2
    SQL>

Maybe you are looking for

  • Crystal report error in SAP

    I have linked my first Crystal report into SAP (2007A), but when I try to run it I get an error.  Msg header "SAP Crystal AddOn"....Could not load file or assembly 'CrystalDecisions.Windows.Forms, Version = 12.0.2000.0, Culture=neutral, PublicKeyToke

  • Error logging in on my new ipad - HELP!!!!

    HI! I just got my ipad, and IM trying to log it in to connect to itunes etc. when I log in, I use my applie ID and my password and then I get this error - For your security, your APple ID login must be an email address.... Well, my ID is not an email

  • FM for creating Condition Records

    Is there FM for creating Condition Records for output type like transaction VV11 (Create Output - Condition Records: Sales)

  • AHHHH...

    ok so i just got a mac mini, i used my old ipod as a hard drive. i transfered songs over to new mac, and all my play counts are gone.... this majorly ***** because, some of my songs have 100 plus plays on them and my top 25 played songs are gone now.

  • Thread Pool Executor ( Runnable Class Executing another Runnable Class )

    Hi Folks, I have my main class called ThreadPoolExecutorUser. I have two Runnable classes called XYZ and ABC in ThreadPoolExecutorUser class I execute the Runnable class XYZ. Which inturn executes Runnable class ABC. The problem is that the Runnable