How to syncronize two data acquisition boards?

I would like to know how I can use two Multifunction Boards simultaneously? For example, I had two NI6024 boards and I would like to use 16/DI channels. I want to syncronize them. Thank you.

Youngkey,
You can synchronize the two data acquisition boards, by using the RTSI bus that is part of the architecture of the boards. I am attaching the text of a Knowledge Base which describes how to accomplish this goal:
Title:
Synchronizing data acquisition between two or more MIO-16 series boards
Problem:
How can I synchronize data acquisition between two or more MIO-16 series boards?
Solution:
First, place a special Real-Time System Integration (RTSI) cable on the RTSI connector. Then, determine what trigger pulse signals need to transmitted to the trigger inputs of each MIO-16 series board. The board which sends the trigger signal becomes a 'master' and the board that rec
eives becomes a 'slave'. Finally, start the data acquisition on both boards. Make sure you call the data acquisition functions or VIs on the slave board first to arm the acquisition. Below is a list of necessary function calls.
* In NI-DAQ or LabWindows: Call the function RTSI_Conn for each counter or trigger signal you wish to connect up to a RTSI Trigger Line. Then call the regular functions to perform a data acquisition on both boards. Call the function RTSI_Clear at the end of the program.
* In LabVIEW: Call the RTSI Control VI with control code set to Connect for each counter or trigger signal you wish to connect up to a RTSI Trigger Line. Then call the regular VIs to perform a data acquisition on both boards. Call the RTSI Control VI with Control Code set to Clear at the end of the program.
Hope this information is helpful.
L Aguila
Applications Engineer
National Instruments

Similar Messages

  • How to Compare two Dates in java

    How to Compare two Date Field after getting the values from jTextField1.getText() and jTextField2.getText().

    Date d1=DateFormat.getDateInstance().parse(yourstring1);
    same for d2
    d1.compareTo(d2);
    could be that i misrememberd the exact naems of some functions or mixed up something in the equence of d1=

  • Hi can anyone explain me how to  syncronize two database using jsp?

    Hi can anyone explain me how to syncronize two database using jsp?

    I thinking than you really need the jsp page for calling the java methods whith sincronize the database.You think wrong.
    You wrote a bad question.What was bad about it?
    You need a java method for sincronize the two databases using a jsp page.No you don't, see my answer.

  • How to compare two dates that should not exceed morethan 3 years

    hi all,
    can you please tell me how to compare two dates( basically dates are string type)
    that should not exceed more than 3 years? in JAVASCRIPT
    Thanks in Advance.

    This is not a JavaScript forum.
    [*Google* JavaScript Forum|http://www.google.co.uk/search?q=JavaScript+Forum&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a]
    Good luck.

  • How to compare two dates to know which one is greater than oher?

    how to compare two dates to know which one is greater than oher?
    Please search before asking basic questions.
    Edited by: Rob Burbank on Mar 27, 2009 9:26 AM

    Hi,
    If thse to date fields are of same type u can directly compare like this.
    regards,
    Bharat.

  • Where are the guidelines for how to interface customized data acquisition equipment to LabVIEW?

    I have a need to do some very specialized data acquisition that may require building special hardware. I would still like to use LabVIEW as the front end and perhaps even carry portions of the interface over into the final product. However, I cannot find the documentation. Where is that kept? I have seen references to a number of generic protocols, without any links back to the details, that may be suitable. The data is high bandwidth, but bursty with sampling rates up to 40 MHz and events that last about 100 milliseconds. Can anyone recommend which of the various methods would best suit this application?
    Solved!
    Go to Solution.

    Once you have figured out your communication bus, it is just a matter of how to format your commands and data.  You will need to do this regardless of programming language you choose.  Formating the data is quite simple in LabVIEW.  You just have to write the data to the right thing.
    Quickly based on the limited parameters you have given us, I would go with an Ethernet connection.  I'm not completely sure if the Ethernet bus will be able to handle your bandwidth, though.  If not, then you will need to go to a PCIe or PXIe connection.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions

  • How to call two data blocks at a time.

    hi all
    i want to call two data blocks at a time on function when button pressed.
    how can I it?
    many thanks

    Many thanks that you people reply,
    I am working in oracle form developer 6i and database 10g.
    I have a form that have three data blocks,
    first block have text boxes and search button,and next two blocks display records on the basis of search criteria that is inserted in the first block and when is clicked on save button.
    the data that is to b displayed is from two different tables.
    i used Go_block('my_block')
    and call other block with the same method.
    kindly guide me how can i do it.
    Thanks in advance

  • How to query two data blocks simultaneously?

    Dear all,
    Need your inputs on the following problem statement...
    Existing Functionality:
    We have two data blocks A (Parent) and B (Child) in a relationship. Both data blocks refer to different tables.
    Data block A is the query data block and for a single record in block A we can have multiple records in block B. Multiple records in block B are shown one at a time after executing a query, this is implemented by using a list item C (belongs to a third block).
    For example
    Let us say block B can have 5 different types of entries for each record in block A. In this case the list item C will have 5 values corresponding to these entries. Once the query is executed, block B will show the default entry for the queried record in block A. To see other entries for the record user can select the required value in list item C and corresponding entry in block B will be fetched.
    Requirement:
    Our requirement now is to enable querying upon both data blocks A and B simultaneously. To implement this I replaced data blocks A and B with a single data block X which is based on the join of the two tables referred by the Data blocks A and B earlier. As the fields should allow insert, update, delete operations we did not use a view here.
    Issue:
    Now the problem is, each record in block A for which block B had multiple entries earlier is now getting listed multiple times because of the join.
    I have tried but could not find any solution for this. I would appreciate if any of you can suggest how we can query both blocks simultaneously without affecting the existing functionality.
    Thanks,
    Amit

    I don't understand your requirement in detail. I try to repeat what i understood so far.
    You have a master-block A based on a table A and a detail-block B based on a table B. So far so good. You can now query based on conditions just the datablock A, because B is a detail and therefore can only be queryied in context of block A.
    Your reuirement is to query on both blocks A and B and find block in B also without giving conditions for the relevant block A.
    Is it that ?
    What i don't understand, what is block C used for?
    An idea for the querying of block B's data: Create Non-database-items items in block A for the search-criteria you need on block B and make them Queryable.
    In the PRE-QUERY-trigger on block A build a WHERE-condition if that search-criteria is entered, something like
    IF :BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B IS NOT NULL THEN
      SET_BLOCK_PROPERTY('BLOCK_A', ONETIME_WHERE, 'WHERE PKVALUE IN (SELECT FKVALUE_TO_A FROM TABLE_B WHERE FIELDVALUE=' ||:BLOCK_A.SEARCH_CRITERIA_FOR_BLOCK_B)');
    END IF;This would query also records to A for which you want to have the B-records. So you could keep block-structure up to master-detail.

  • How to substract two date&time values

    Well,i just need to substract last visited date&time value from systemdate. The last visited date&time(from the filed named SONBULUNMAZAMANI, ) is selected from table (IHALE_KATILIMCILAR ) in the format DD-MM-RRRR HH24:MI and systemdate is in the same format. And i need to get value in minutes. Then i need to check if the value is greater then 20 minutes, finally i will update database and set IHALE_KATILIMCILAR.AKTIF=0. Here is the code i used;
    DECLARE
    MinDiff number;
    DateTime1 ihale_katilimcilar.sonbulunmazamani%TYPE;
    BEGIN
    select t.sonbulunmazamani into DateTime1 from ihale_katilimcilar t where t.ihlkodu=141 and t.ihlaltktgkodu=132 and t.id_iliski=193;
    MinDiff := ABS( TO_DATE( TO_CHAR(SYSDATE, 'DD-MM-RRRR') || TO_CHAR(SYSDATE , 'HH24:MI'), 'DD-MM-RRRR HH24:MI' ) - TO_DATE( TO_CHAR(DateTime1, 'DD-MM-RRRR') || TO_CHAR(DateTime1, 'HH24:MI'), 'DD-MM-RRRR HH24:MI' ) );
    DBMS_OUTPUT.PUT_LINE('Difference is ' || MinDiff);
    END;
    However the result i get is always pointed values such as ,1895833333333333333333333333333333333333. How can i handle this?
    And here is the scripts of table:
    create table IHALE_KATILIMCILAR
    KULADI VARCHAR2(20),
    SONUC NUMBER(1),
    AKTIF NUMBER(1) default 1,
    SRKTKODU VARCHAR2(10) not null,
    SONBULUNMAZAMANI DATE default sysdate,
    SIRA NUMBER(1) default 0,
    MESAJ VARCHAR2(200),
    ID NUMBER(6) not null,
    IHLKODU NUMBER not null,
    IHLALTKTGKODU VARCHAR2(10) not null,
    ID_ILISKI NUMBER,
    IHLSIRA NUMBER(1) default 0,
    CEVAP VARCHAR2(200)
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, 'süre talep 2', 76, 145,
    '135', 345, 0, 'al sna süre 77');
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('20-02-2008 14:49:52', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 77, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 78, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('asd', null, 1, '4444', to_date('19-02-2008 10:29:44', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 79, 145, '135',
    345, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 63, 141, '134',
    191, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('07-03-2008 09:52:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 64, 141, '134', 192,
    0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('06-03-2008 13:28:50', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 61, 145, '135',
    189, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('07-03-2008 11:16:41', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 69, 141, '133',
    197, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 65, 141, '132',
    193, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('07-03-2008 11:16:41', 'dd-mm-yyyy hh24:mi:ss'), 2, null, 66, 141, '132',
    194, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('07-03-2008 09:52:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 67, 141, '132', 195,
    1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEMMM', null, 0, '42', to_date('17-03-2008 09:29:20', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 68, 141, '133',
    196, 0, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('12-03-2008 15:00:58', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 70, 142, '252',
    198, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('10-03-2008 10:08:17', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 71, 142, '252',
    199, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('10-03-2008 10:08:56', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 72, 143, '253',
    200, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('MLK', null, 1, '46', to_date('12-02-2008 13:34:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 73, 143, '253', 201,
    1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('06-03-2008 14:09:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 60, 145, '136',
    188, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KEM.ESM', null, 1, '44', to_date('06-03-2008 13:28:50', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 74, 145, '136',
    202, 1, null);
    insert into IHALE_KATILIMCILAR (KULADI, SONUC, AKTIF, SRKTKODU, SONBULUNMAZAMANI, SIRA, MESAJ, ID, IHLKODU,
    IHLALTKTGKODU, ID_ILISKI, IHLSIRA, CEVAP)
    values ('KE.ES', null, 1, '45', to_date('06-03-2008 14:09:40', 'dd-mm-yyyy hh24:mi:ss'), 0, null, 75, 145, '135',
    203, 0, null);
    Thanks...

    What version of SQLServer do you have? Datediff is not an Oracle built-in function.
    OP:
    THe difference between two dates in Oracle is in days. The decimal portion refers to partial days, so you need to convert that to the required precision. Also, both sysdate and your column are date type, and contain a time portion, so you do not need all the to_date/to_char stuff. Something like:
    SQL> SELECT end_dt, start_dt, (end_dt - start_dt) * 24*60 diff
      2  FROM (SELECT sysdate end_dt, TRUNC(sysdate) start_dt
      3        FROM dual);
    END_DT             START_DT                 DIFF
    17-mar-08 10:39:39 17-mar-08 00:00:00     639.65John

  • How to compare two date Objects

    Hi,
    I have two Calendar Objects, one is coming from client and one is my server time, I need to evaluate that incoming time with server time so that if it is sent before an hour back then i should not do anything on that request Object. I have converted the incoming String into Calendar Object and how can i evaluate these two Calendar Objects including their hours and minutes.
    Thanks in advance
    bajju

    bajjurireddy, ignore Mobiquity's post. It contains no useful information and will only serve to confuse and frustrate you.
    Mobiquity wrote:
    Also make sure that the two date objects are in the same date format..
    public static String DateToDateString(java.util.Date d, String dateFormat)
         throws ParseException {
              SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
              sdf.setLenient(false); // this is required else it will convert
              String dateString = sdf.format(d);
              return dateString;

  • How to externally time data acquisition rate

    I have Lab-PC-1200 card and Labview 5.1. I will like to read the signals from a Hamamatsu linear detector array that has 1024 pixels on it. The trigger (or sample) rate of the detector can be modified over a range covering 1 MHz to 15.625 kHz.
    I use the 'Acquire N Scans ExtScanClk D-Trig.vi' (written by a NI staff member) downloaded from the web. If I set the trigger rate of the detector to 15.625 kHz (the slowest possible), the program runs without any problem. However, if I use a faster trigger rate (say, 31.25 kHz) no data is collected. According to the specs, the maximum data acquisition rate of the Lab-PC-1200 card is supposed to be 100 kS/s. How do I solve this problem?

    I've answered my own question. The solution lies in disabling the internal channel clock and connecting the triggering clock to the EXTCONV* port of Lab-PC-1200 card to fire the channel clock. The scan clock should be timed with an even faster external clock from the detector. Ultimately, it is the channel clock that is important, not the scan clock. The lab-PC card uses the channel clock in conjunction with the number of channels to set up internal gating pulses which of course become the limiting factor. The external triggering clock connected to the channel clock cannot be faster than the speed of the card (in my case, it's 100 kHz).

  • How to get two date difference in Day/hour/min/secs pl

    First of all,
    Hello to All, i am new to Oracle DB, but i have little experience in Other Database such as Sybase, sql server etc
    please kindly help me
    in DoctorChart table i have DocName,Id#,Citcotype,Medtype,AdmitDate,DischargeDate(both admitdate & Discharge date is date formatted columns)
    so how can i get the below differenceTime (which means Dischargedate-Admit Date in below format i.e, Day,Hours,Minutes,Seconds...)
    DoctorName, ID #, Citco type, MEDtype, DifferenceTime
    ========= === ======= ======= ===========
    Dr. KindaEmesko, 20045, Replace OutCard, ICH, 0 day 9 hours 11 minutes
    Dr. KindaEmesko, 20098, Replace OutCard, ICH, 1 day 2 hours 34 minutes
    Dr. KindaEmesko, 20678, Replace OutCard, ICH, 2 day 23 hours 52 minutes
    Dr. KindaEmesko, 20212, Replace OutCard, ICH, 4 day 1 hours 00 minutes
    Dr. KindaEmesko, 20345, Replace OutCard, BED, 3 days 14 hours 15 minutes
    Dr. KindaEmesko, 20678, Replace OutCard, BED, 9 days 21 hours 52 minutes
    Dr. KindaEmesko, 20015, Signature Overlay, Rest, 0 days 3 hours 29 minutes
    Dr. KindaEmesko, 45678, Signature Overlay, Rest, 0 days 1 hours 29 minutes
    Same way how can i get the Average Time for the above result (without ID columns)
    DoctorName, Citco type, MEDtype, Avg DifferenceTime
    ========= === ======= ======= ===========
    Dr. KindaEmesko, Replace OutCard, ICH, 2 day 1 hours 00 minutes
    Dr. KindaEmesko, Replace OutCard, BED, 6 days 17 hours 15 minutes
    Dr. KindaEmesko, Signature Overlay, Rest, 0 days 2 hours 29 minutes
    Please just tell me how to get the two dates difference as day/hour/minute format
    as well as how to get avg ( two dates difference as day/hour/minute format)
    Please Help me
    Thanks in advance

    Well, instead of all these suggested manipulations you can simply use intervals. Oracle uses day as a unit in date arithmetic, so Dischargedate-Admit Date is number od days between two dates. Built-in function numtodsinterval can be used to convert it into interval. For example:
    SQL> with t as (
      2             select trunc(sysdate) - 2 Admit_Date,
      3                    sysdate            Discharge_Date
      4               from dual
      5            )
      6  select  numtodsinterval(Discharge_Date - Admit_Date,'DAY') Hospital_Stay
      7    from  t
      8  /
    HOSPITAL_STAY
    +000000002 00:01:08.000000000
    SQL>  SY.

  • How to calculate two date diff?

    what is the similar function in BIEE? like datediff = date1 - date2 SQL statment in Oracle db,
    i have tried to use minus, it was not works, BIEE does not support minus two date directly?
    thanks a lot!
    Kaymo

    you can use timestampdiff function. The TimestampDiff function returns the total number of specified intervals between two timestamps.
    Syntax:
    TimestampDiff (interval, timestamp-expression1, timestamp-expression2)
    example TimestampDiff (SQL_TSI_DAY, date1, date2) returns the number of days between date1 and date2.
    The specified interval. Valid values are:
    SQL_TSI_SECOND
    SQL_TSI_MINUTE
    SQL_TSI_HOUR
    SQL_TSI_DAY
    SQL_TSI_WEEK
    SQL_TSI_MONTH
    SQL_TSI_QUARTER
    SQL_TSI_YEAR

  • Date operations in java: how to substract two dates

    dear all
    I want to substract two date and return the number of days between them
    and I want to make a method that return the number of monthes between two dates
    please help

    Kayaman wrote:
    Check out the Calendar class.Hello Kayaman,
    From a quick glance at its API, I haven't found it obvious that Calendar could fulfill such need under 10-lines algorithms. As per Joda-time's proponents, it's one of those computation that are unintuitively hard or convoluted using the stock JDK date&time classes.
    If you're comfortable with Calendar, maybe you'd find it interesting to voice your opinion in this other topic: {thread:id=1982257}. Thanks in advance.
    Hello OP,
    apologies for plugging that discussion in your topic. But I do think it's closely related.
    I noticed you marked both replies as helpful. I'd like to know your feedback on those replies: have you tried both approaches, and succeed with one, or both? Have you met difficulties with either?
    Thanks, and good luck anyway.
    J.

  • How to compare two dates

    Hi,
    I have two colums(start date &end date) of data type date in my page and both are optional ones.
    I need to have a validation on those date columns,
    End date should not be greater than Start Date.
    This validation should be triggered once i click on Apply button.
    Pseudo Code:
    If (endate>startdate)
    raise form_trigger_failure;
    Can anyone suggest how/where to implement the code, if possible please provide the sample code.
    Thanks,
    Mahesh

    sorry, I was thinking java and not oaf
    there is similar thing thats done in tutorials exercise create page part2
    this is the code snippet from jdev guide...but you may want to go through the chapter before you put this code in your EO file.
    Step 10.2 Add a validateEndDate() method Add the following new method to your EmployeeEOImpl class. /*
    * Verifies that the employee's End Date is valid.
    * Business Rules:
    * This is an optional value which can be updated at any time.
    * Cannot be earlier than sysdate.
    protected void validateEndDate(Date value)
    // If a value has been set, validate it.
    if (value != null)
    OADBTransaction transaction = getOADBTransaction();
    // Note that we want to truncate these values to allow for the possibility
    // that we're trying to set them to be the same day. Calling // dateValue( ) does not include time. Were we to want the time element,
    // we would call timestampValue(). Finally, you cannot compare
    // oracle.jbo.domain.Date objects directly. Instead, convert the value to
    // a long as shown.
    long sysdate = transaction.getCurrentDBDate().dateValue().getTime();
    long endDate = value.dateValue().getTime();
    if (endDate < sysdate)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "EndDate", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_END_DATE_PAST"); // Message name
    } // end validateEndDate()

Maybe you are looking for