Sine, Square & Sawtooth sweep generation with variable duty cycle/rise time & fall time

Dear All !
I request and need some candid advices on the subject issue keeping in view the following notes:
1) I am a novice in LabView.
2) I was an average Electronics Engineering graduate who graduated about 9 years ago and since then I have not been involved in Electronics Engineering.
I have undertaken a task or generation of Sine, Square and Saw Tooth wave forms. All these waveforms are to be frequency swept form 1 Hz to 100 kHz. The amplitude of all these waveforms should be able to be adjusted. The duty cycle of Square Wave should also be adjustable (or better be able to be swept). Likewise the rise time and fall time of sawtooth wave should also be adjustable (or better be able to be swept).
I am considering  other options as well but wanna try it on LabView.
I wish to ask that is it possible to execute this task in Labview 7.0? If possible then considering the para 1 & 2 above, is it possible for me to finish this task in 15-20 days if I work on this for about 3 hours a day? If not then what can be reasonable estimate?
I will be extremely grateful if you people can offer advice on whole project or part(s) of it.
Thanking you in advance and requesting urgent response(s).
Solved!
Go to Solution.

Check this thread.
I did some similar coding, it might be usefull to you.
http://forums.ni.com/ni/board/message?board.id=170​&thread.id=493477&view=by_date_ascending&page=1
I am using ver 9.0 though.
If you work 3hr /day for 2 weeks you might as well finish book basics 1& 2 and than can do whan you need in a breeze, couple of hours.
Good luck

Similar Messages

  • Generating square wave with variable duty cycle

    We like to generate a square wave with variable duty cycle using LabView 6.1 and SCB-68 and this duty cycle comes from some PID controller programmed by LabView by reading a voltage and feeding back this square wave

    the story begins with some one called separately excited DC motor
    this thing sometimes changes its speed
    so we are trying to keep a constant speed
    irrespective of the load no matter how it changes
    this comes by reading the voltage out from
    the tackometer which represents the speed as voltage
    then comparing this with a reference set by the labview program
    the labview program will send a control signal to some chopper circuit
    which is connected to the field of the motor which controls the speed
    we are tending to make the labview program as pid controller
    that will generate our beatiful square wave with some duty cycle
    which will vary to increase or decrease the voltage across the field
    we tried "Real-Time PID Control.vi" example and other examples
    and we are discussing different solutions for this duty cycle thing
    but till now no output
    this is our whole story with this DC motor thing

  • Finite pulse-trai​n generation with variable time lapses with NiDAQmx

    Being a newby in Labview and NiDAQmx, I find it tedious to program the application I need to drive my experiment : I want to generate a finite pulse train, with variable delays between two consecutive pulses. These delays are known before the experiment starts, summurized in a table (element 0 decribes the time lapse between pulse 0 and 1, element 1 between pulse 1 and 2 ...). I would like to use NiDAQmx to program this. I had in mind the following scheme : two counters, first one counting time between pulses, the second one generating the pulse once "counter one" has finished his job. What I don't figure out is how to reprogram "counter one"'s register, without introducing unwanted delays in the time
    sequence of my finite pulse train. I am using a 6052E DAQ, and I want to generate delays in a same pulse train ranging from 1 microsecond up to 20 seconds.
    Thank you for ANY help :-)

    Hello !
    Well, I will try to be more precise while answering your questions. But first let me thank you very much for your help : your comments, questions and remarks are very helpful to help me shape my project, as you shed light on particular problems I strictly had no idea before !
    1) I can certainly get on well with digital output as my flash device is triggered by TTL signals.
    2) The lighting device is home-made, and I think it will be better for my needs to produce light throughout the duration of the input at the “on” level. In any case it will be driven by TTL-like signals. The intensity is manually set, so no analog control is required.
    3) I will use Labview to collect the experimental data. The signal will be sampled during the light pulse : the rising edge of the TTL-like output signal will trigger both the lighting device and the data acquisition, the latter being stopped on the falling edge. The light emitted by the lighting device is called a “probe” for the following reasons : the photons are absorbed by the photosynthetic sample and “immediately” re-emitted at a longer wavelength. A photodiode acts as a signal transducer, and I monitor the intensity of this fluorescence. Knowing precisely when light pulses occurred after the initial start excitation (which is also a brief pulse of light but of a much greater intensity than the “probe” light) and the intensity of light emitted during theses pulses, I can reconstruct the kinetic of fluorescence decay. This kinetic reflects the behaviour of my biological sample. Thus no continuous acquisition is required as between two light pulses there is nothing to monitor. And all the half-time reaction are timed relative to the same “start” excitation as they reflect a jump sequence of an electron extracted by the “start” excitation : first jumps are quick ones (half-time in the 10 �s range) and last jumps are slow ones (half-time in the 1 s range). With respect to these kinetics, I would like a 1 �s precision. If not achievable, I could skip the quickest jump (but it would be a pity) and focus on the second one which has a 10 ms half-time reaction and a 100 �s precision would then be enough. But as we say in French : “Qui peut le plus, peut le moins !” (roughly meaning that when you can achieve the best, you easily can do the least). This precision relates to the position of one flash with respect to the others. I don’t need to be very precise on the duration of each individual light pulse : a typical value is 100 �s duration, but I can get on well with 90 �s or 110 �s, my data being an average of the light intensity emitted during the light pulse). All I want to know precisely is when it is fired.
    4) Concerning the hardware, I already have a NI 6052E DAQ board, and unfortunately my laboratory cannot allow me to spend more money on this. I also have a fast acquisition board (IMTEC T3012) I intended to use to acquire my photodiode signal in place of the 6052E A/D converter. It has an old Labview driver, and I managed to upgrade it to suit my needs. It has an onboard segmented memory and can keep track precisely (it has a 60 MHz sample clock) of a trigger event. I am wondering if I can overcome the timing precision issue with this board, knowing that I strictly don’t care that flash n�1 is triggered at (t0 + 10 �s) or (t0 + 11 �s), provided that I know it, allowing me to place precisely my data point on the time scale. I can program the number of memory segments (i.e. the number of light pulses) and each one is filled with data coming from the photodiode upon receiving the rising edge triggering the light pulse. The precise date at which each triggered is received is stored in the board memory, allowing time reconstruction.
    I do hope this is much clearer than my previous attempts ! Believe me, it is quite hard to leave biology for a while and enter the cryptic world of data acquisition !
    Gritche

  • Frquency & Duty cycle Value changes- every time

    Hello all
     im using pcie 6320 to measure the frequency and the duty cycle of a signal.i have attached my vi & the data measured for reference.The values highlighted in red ,is my actual frequency and duty cycle but values changes for every 1 sec.Please correct me if i have any mistake.
    Solved!
    Go to Solution.
    Attachments:
    measure frquency-duty.vi ‏54 KB
    HZ-DUTY.JPG ‏37 KB

    You'll need to enable digital filtering--insert the following property node into your code (call the property node before starting the task):
    Try a "Min Pulse Width" of a few us and increase it if you still are picking up incorrect readings.
    The errant numbers are coming from false edges being picked up during transitions, enabling digital filtering will cause the DAQ device to ignore any transitions with a pulse width of less than the set value.  Your 475 Hz 72% duty cycle signal should have a high time of about 1.52 ms and a low time of about .59 ms):
    656 Hz = ~1/(high time)
    1718 Hz = ~1/(low time)
    MHz values = multiple edges picked up during a single transition.
    Best Regards,
    John Passiak

  • Filename generation with variable substitution.

    Hi,
    I am currently working on a senerio in which file is receiver.The requirement is to generate file at target with the file name as message id.How can i use VARIABLE SUBSTITUTION and acheive this.
    (Add message id in configuration should not be done.)

    Hello shruthi,
                  Please try this for the filename creation,
    1. Create a UDF in the message mapping named getFileName, select only one input (to pass the messageid) and paste this coding there;
    /* getFileName User Defined  Function
    // function to create name of output file
    String filename;
    filename = strFile;
    try {
    // initialize DynamicConfiguration for create file with given name
    DynamicConfiguration conf = (DynamicConfiguration) container
           .getTransformationParameters()
           .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    //create file with the specified name 
    conf.put(key, filename);
    } catch (Exception ex) {
    return filename;
    2. In the target structure header field perform this mapping,
    Messageid -> getfFileName UDF -> Target Structure Headerfield
    3. Then in the Integration directory under the target tab
    check the Use - adapter specific message attributes and File Name
    Please follow the steps and let me know if u still face the same problem.

  • How do I set up analog 0-10 VDC output pulses with varying duty cycles?

    I am trying to control a 400 watt laser so that it can pulse on and off within a few milliseconds. The laser controller reads a 0-10 VDC signal, with 0V being 0 watts and 10V being 400 watts. I am using a PCI-6221 DAQ and LabVIEW 8.0.
    It seems that all of the examples have square waves that are symmetric about the 0 volt range. I need a square wave that goes from 0-10VDC with different on/off timespans. I would like to have something as follows:
    1) 0 seconds = laser off
    2) .001 to .002 seconds = laser on at full power
    3) .002 to .009 seconds = laser off
    4) Repeat steps 2-3 500 times
    Any ideas?
    Michael Fidler

    Michael, 
    I ran your code, but was unable to reproduce the problem you are
    seeing. I measured the signal in two fashions’. I brought the signal back into
    the card (LabVIEW_Square Wave.JPG) and into a benchtop scope (Benchtop
    scope_Square Wave.jpg).
    I would like to ask that you run the attached code twice. The
    first time, please run it with the analog input as ‘Dev1/_ao0_vs_aognd’. This
    take the analog output and compares it with the cards AO ground, therefore eliminating
    the need for external connections and simply doing internal routing. The second
    time, please run it with the analog input as “Dev1/ai1”, and wire your AO
    channel to an AI channel. These tests are to ensure that there is not a stray
    capacitance in your scope, the probe, etc. Let me know the results (pictures
    are always great)
    David L.
    Systems Engineering
    National Instruments
    Attachments:
    Cont Gen Voltage Wfm-Int Clk_Test VI (8.2).vi ‏64 KB
    Benchtop scope_Square Wave.jpg ‏38 KB
    LabVIEW_Square Wave.JPG ‏36 KB

  • Calculate Square wave Duty Cycle

    Hello everyone,
    I'm acquiring (with USB-6212) a square wave, "100Hz" with variable duty cycle - which can be 20%, 50% or 80% - for matters of decodification; the acquisition frequency is set to 4k. Actually, I said the frequency is 100Hz, because I get a rising edge every 10ms, but the length of the high level is defined by the communication protocol and that is what I called duty cycle (even though this does not match the exact definition of this property)
    Since I need to decode the information contained by the wave, it's necessary for me to be able to tell what the duty cycle is. I've acomplished this so far by taking the derivative of the signal, then calculating peaks and valleys index in the waveform and finally subtracting them, as shown below.
    It works ok almost the whole opeartion, however, the acquisition is not 100% exact. Sometimes I get the signal in the picture A, that is ideal for what I intended.
    Other times, the signal is like B and the derivative amplitude does not cross my threshold, even though there is a rising edge there. I could lower my threshold to 2, for instance, but then I'd get vulnerable to the signal in picture C, which would accuse 2 peaks, instead of just one.
    Anyone have an idea on how to work around this or any other method more reliable than taking the derivative of the signal?
    Solved!
    Go to Solution.

    Well, we can only answer question based on the information supplied!  The LabVIEW Mind Reading Toolkit is still in development.
    Your application is one where parallel loops may be valuable.  In the acquisition loop you read data from the data acquistion device at a rate which optimizes the DAQ perfomance (the >= 2k points you mentioned).  The data is transferred to an analysis loop via a queue. In the anaylsis loop you can put the data into a shift register.  When more data is available from the Acquisition loop, dequeue it and append it to the data in the shift register.  The Duty Cycle section will find two consecutive rising edges and the falling edge between them ( the 10 ms segment).  It calculates the duty cycle for that segment. Then it uses the second of the rising edges as the first rising edge for the next segment.  Repeat until duty cycles have been determined for all segments.
    There are a lot of details which can be imprortant in a process like this. Many of them are dependent on other things you have not specified.  What will be done with the duty cycle values? Is the raw data to be displayed? Saved to file? Discarded after the duty cycle is measured?  How long will the process continue?  How much data can accumulate?
    Lynn

  • Duty cycle two AO signals with a square wave

    Hello,
    I am running two devices with sending two AO signals (sine wave) out simultanously in my code. I need to duty cycle my signals. in other words, I want to turn ON and OFF the devices continously.In order to do that, I am using a square wave generator with 50% duty cycle. The devices should be running when the square wave has positive values and should be OFF when it is negative. 
    The code almost does that, but it does not seem to be as fast as it is supposed to, based on the square wave's frequency. I was wondering if anyone can help me with this problem. In addition, I am not sure if this is the best method to do that, please let me know if there is a better way. I also attached the VI .
    Thanks,
    Pooya
    Solved!
    Go to Solution.
    Attachments:
    2AOsignal_dutycycle.vi ‏47 KB

    I am using NI-PCI 6071E with BNC 2120as an interface. I am not sure if the problem is the hardware limits. Attahced please find the subvis which I used in my main VI. 
    one of the which has a for loop (duty_cycle.vi) works just fine and the other one (duty_cycle(new).vi), which is the one I am using in my VI, does not. Any thoughts?
    Attachments:
    duty_cycle (New).vi ‏23 KB
    duty_cycle.vi ‏25 KB

  • Cell Offload will Happen for pl/sql Block with variables

    Hello Experts,
    i am working on procedures on exadata now. i was confused with cell offload in exadata. somehow offload is not happening when i ran the sql statement in in pl/sql block with variables.
    here are my findings.
    when i ran insert into from select with values at toad, my query response time is very good. the total process is completed in less than a minute.
    i checked offload is happening.
    same sql statement is placed in plsql block with variable, procedure is taking lot of time and it is not completing. this case offload is not happening.
    is it true, if i use variables in pl/sql block will not use cell offload and smart scan?
    if yes, what is the work around.
    Thanks
    #! Pavan

    Hello Marc,
    Thanks for quick response.
    when i ran the query with literals in toad session i am getting response.
    when i run it with pl/sql block , block is not completing at all.
    here is the plsql block:
    My Apologies for sending big code,with out proper format.
    DECLARE
    P_BUSINESS_DATE DATE;
    P_BATCH_ID NUMBER;
    UTC_OFFSET NUMBER;
    BEGIN
    P_BUSINESS_DATE := to_date('02/01/2012', 'MM/DD/YYYY');
    P_BATCH_ID := 1;
    UTC_OFFSET := 0;
    INSERT /*+ APPEND */ INTO UPL_CLIENT_tbl
    ( reportdate,
    LastName,
    FirstName,
    MiddleInitial,
    AccountNumber,
    Address,
    City,
    State,
    Zip,
    HomePhone,
    WorkPhone,
    BirthDate,
    Age,
    Sex,
    NumberOfChildren,
    Occupation,
    LeadSource,
    Consultant,
    ProgramDirector,
    CallTaker,
    LeadDate,
    FirstVisitDate,
    LastVisitDate,
    BillType,
    ClientType,
    PreviousClientType,
    AppointmentDate,
    DoctorLetterRequired,
    OneYearPermStabilizationDate,
    UnlimitedPermStabilizationDate,
    MaritalStatus,
    ReferrerName,
    ReferrerCentreID,
    CentreID,
    PaymentDateOne,
    PaymentAmountOne,
    PaymentDateTwo,
    PaymentAmountTwo,
    PaymentDateThree,
    PaymentAmountThree,
    PaymentDateFour,
    PaymentAmountFour,
    LibraryPurchased,
    BalanceDue,
    FoodNSFBalance,
    ProductNSFBalance,
    ProgramNSFBalance,
    StartWeight,
    CurrentWeight,
    GoalWeight,
    Height,
    DateGoalWeightAchieved,
    DateSuccessPlusPurchased,
    ReturnToActiveDate,
    VersionNumber,
    HalfWayDate,
    LastLSCDate,
    LastUpdatedDate,
    VitaminWaiverSigned,
    LastSupplementPurchaseDate,
    LastSupplementCodePurchased,
    LastTotalSupplementSupplyCycle,
    LastAddtlSupplPurchaseDate,
    LastAddtlSupplCodePurchased,
    LastAddtlSupplSupplyCycle,
    DiabetesClient,
    DietControlled,
    TakingOralMed,
    TakingInsulin,
    EmailId,
    CTADate,
    RWLDate,
    Address2)
    (SELECT /*+ full(S_CONTACT) full(REFERRER) full(Consultant) full(ProgramDirector) full(CallTaker) full(S_CONTACT_X) full(a) full(a2) full (a3) */ distinct p_business_date reportdate,
    SUBSTR(S_CONTACT.LAST_NAME,1,25) AS LastName,
    SUBSTR(S_CONTACT.FST_NAME,1,25) AS FirstName,
    SUBSTR(S_CONTACT.MID_NAME,1,1) AS MiddleInitial,
    S_CONTACT.X_JC_ACNT_NUM + 900000000 AS AccountNumber,
    SUBSTR(S_ADDR_PER.ADDR,1,40) AS ADDRESS,
    SUBSTR(S_ADDR_PER.CITY,1,20) AS City,
    S_ADDR_PER.STATE AS State,
    SUBSTR(S_ADDR_PER.ZIPCODE,1,15) AS Zip,
    SUBSTR(REPLACE(S_CONTACT.HOME_PH_NUM,'-',''),1,10) AS HomePhone,
    SUBSTR(REPLACE(S_CONTACT.WORK_PH_NUM,'-',''),1,10) AS WorkPhone,
    S_CONTACT.BIRTH_DT AS BirthDate,
    CASE WHEN FLOOR((p_business_date - S_CONTACT.BIRTH_DT)/360) < 0 THEN NULL ELSE FLOOR((p_business_date - S_CONTACT.BIRTH_DT)/360) END AS AGE,
    S_CONTACT.SEX_MF AS SEX,
    NULL AS NumberOfChildren,
    S_CONTACT_X.ATTRIB_34 AS OCCUPATION,
    CASE WHEN SUBSTR(S_CONTACT_X.ATTRIB_37,1,4)='Othe' THEN 'Othr'
    WHEN SUBSTR(S_CONTACT_X.ATTRIB_37,1,4)='Inte' THEN 'Intr'
    WHEN SUBSTR(S_CONTACT_X.ATTRIB_37,1,4)='Prin' THEN 'News'
    WHEN SUBSTR(S_CONTACT_X.ATTRIB_37,1,4)='Gues' THEN 'Gst'
    ELSE SUBSTR(S_CONTACT_X.ATTRIB_37,1,4) END AS LeadSource,
    SUBSTR(Consultant.EMP_NUM,1,10) AS CONSULTANT,
    ProgramDirector.EMP_NUM AS ProgramDirector,
    CallTaker.EMP_NUM CallTaker,
    S_CONTACT.X_LEAD_DT AS LeadDate,
    LEAST(nvl(S_CONTACT.X_LAST_CONSULTATION_DATE,O.FirstPurchaseDate ), nvl(O.FirstPurchaseDate,S_CONTACT.X_LAST_CONSULTATION_DATE+1) ) AS FirstVisitDate, --X_LAST_CONSULTATION_DATE stores the performed date or the legacy client firstvisitdate
    GREATEST(nvl(S_CONTACT_XM.X_CONSULTATION_DT ,S_CONTACT_X.ATTRIB_29), nvl(S_CONTACT_X.ATTRIB_29, S_CONTACT_XM.X_CONSULTATION_DT-1) ) AS LastVisitDate,
    CASE WHEN S_CONTACT.X_INSTALLMENT_BALANCE > 0 THEN 'B' ELSE NULL END AS BillType,
    ct.current_client_type ClientType,
    SUBSTR(ct.saved_client_type,1,1) PreviousClientType,
    S_CONTACT.LAST_CREDIT_DT AS AppointmentDate,
    CASE WHEN a.X_DR_LETTER_STATUS IS NOT NULL THEN 'Y' ELSE 'N' END AS DoctorLetterRequired,
    NULL AS OneYearPermStabilizationDate,
    DECODE(S_PROD_INT.X_PROGRAM_CLASSIFICATION,'Premium',a.START_DT ,NULL) AS UnlimitedPermStabilizationDate,
    SUBSTR(S_CONTACT.MARITAL_STAT_CD,1,1) AS MaritalStatus,
    SUBSTR(REFERRER.FST_NAME ||' '|| REFERRER.LAST_NAME,1,34) AS ReferrerName,
    ORGEXT_REF.LOC AS ReferrerCentreID,
    S_ORG_EXT.LOC AS CentreID,
    NULL AS PaymentDateOne,
    NULL AS PaymentAmountOne,
    NULL AS PaymentDateTwo,
    NULL AS PaymentAmountTwo,
    NULL AS PaymentDateThree,
    NULL AS PaymentAmountThree,
    NULL AS PaymentDateFour,
    NULL AS PaymentAmountFour,
    NULL AS LibraryPurchased,
    nvl(S_CONTACT.X_INSTALLMENT_BALANCE,0) + nvl(S_CONTACT.X_PREPAID_BALANCE,0) AS BalanceDue, -- Changed operation from (-) prepaid to (+) prepaid since the sign was flipped in OLTP.
    NULL AS FoodNSFBalance,
    NULL AS ProductNSFBalance,
    NULL AS ProgramNSFBalance,
    a2.X_START_WEIGHT AS StartWeight,
    a2.X_CURRENT_WEIGHT AS CurrentWeight,
    a2.X_GOAL_WEIGHT AS GoalWeight,
    a3.X_HEIGHT AS Height,
    a2.X_FAXSENT_DATETIME DateGoalWeightAchieved,
    DECODE(S_PROD_INT.X_PROGRAM_CLASSIFICATION,'Premium',a.START_DT,NULL) AS DateSuccessPlusPurchased,
    CASE WHEN A2.ARCHIVE_FLG = 'N' THEN a2.START_DT ELSE NULL END AS ReturnToActiveDate,
    600 VersionNumber,
    a2.X_FAXRECV_DATETIME AS HalfWayDate,
    NULL AS LastLSCDate,
    TRUNC(S_CONTACT.LAST_UPD-UTC_OFFSET/24) AS LastUpdatedDate,
    NULL AS VitaminWaiverSigned,
    LastSupplementPurchaseDate,
    LastSupplementCodePurchased,
    LastTotalSupplementSupplyCycle,
    LastAddtlSupplPurchaseDate,
    LastAddtlSupplCodePurchased,
    LastAddtlSupplSupplyCycle,
    CASE WHEN (a.X_DIABETES_NO_MEDS_FLG='Y' OR a.X_DIABETES_ORAL_MEDS_FLG = 'Y' OR a.X_DIABETES_ON_INSULIN_FLG = 'Y') THEN 'Y' ELSE 'N' END AS DiabetesClient,
    DECODE(a.X_DIABETES_NO_MEDS_FLG,'Y','Y','N') AS DietControlled,
    a.X_DIABETES_ORAL_MEDS_FLG AS TakingOralMed,
    a.X_DIABETES_ON_INSULIN_FLG AS TakingInsulin,
    S_CONTACT.EMAIL_ADDR AS EmailId,
    NULL CTADATE,
    NULL RWLDATE,
    SUBSTR(S_ADDR_PER.ADDR_LINE_2,1,40) AS Address2
    FROM S_CONTACT,
    S_CONTACT REFERRER,
    S_CONTACT Consultant,
    S_CONTACT ProgramDirector,
    S_CONTACT CallTaker,
    S_CONTACT_X,
    (SELECT /*+ parallel full(S_CONTACT_XM) */ PAR_ROW_ID, attrib_05, MAX(X_CONSULTATION_DT) AS X_CONSULTATION_DT FROM S_CONTACT_XM
    WHERE (S_CONTACT_XM.last_upd_by < '1-14WD'
    or S_CONTACT_XM.last_upd_by > '1-14WD')
    AND S_CONTACT_XM.ATTRIB_05 IN (SELECT row_id FROM S_ORG_EXT WHERE S_ORG_EXT.ACCNT_TYPE_CD IN ('Corporate Centre','Franchise Centre')) LOC IN (SELECT centreid FROM UPL_LIVE_CENTRES WHERE LIVE = 'Y' AND BATCHID = p_batch_id)) where S_ORG_EXT.ACCNT_TYPE_CD IN ('Corporate Centre','Franchise Centre')) --
    GROUP BY PAR_ROW_ID, attrib_05) S_CONTACT_XM,
    (SELECT CONTACT_ID, ACCNT_ID,
    MAX(LastSupplementPurchaseDate) AS LastSupplementPurchaseDate,
    MAX(LastSupplementCodePurchased) AS LastSupplementCodePurchased,
    MAX(LastTotalSupplementSupplyCycle) AS LastTotalSupplementSupplyCycle,
    MAX(LastAddtlSupplPurchaseDate) AS LastAddtlSupplPurchaseDate,
    MAX(LastAddtlSupplCodePurchased) AS LastAddtlSupplCodePurchased,
    MAX(LastAddtlSupplSupplyCycle) AS LastAddtlSupplSupplyCycle,
    MIN(FirstPurchaseDate) AS FirstPurchaseDate,
    MAX(LastPurchaseDate) AS LastPurchaseDate
              FROM (
              SELECT /*+ parallel full(S_ORDER) full(S_ORDER_XM) */ S_ORDER.CONTACT_ID AS CONTACT_ID,S_ORDER.ACCNT_ID,
    NULL AS LastSupplementPurchaseDate,
    NULL AS LastSupplementCodePurchased,
    NULL AS LastTotalSupplementSupplyCycle,
    NULL AS LastAddtlSupplPurchaseDate,
    NULL AS LastAddtlSupplCodePurchased,
    NULL AS LastAddtlSupplSupplyCycle,
    (S_ORDER_XM.X_BUSINESS_DATE) FirstPurchaseDate,
    (S_ORDER_XM.X_BUSINESS_DATE) LastPurchaseDate
              FROM S_ORDER,S_ORDER_XM
              WHERE S_ORDER.ROW_ID = S_ORDER_XM.PAR_ROW_ID
              AND S_ORDER.STATUS_CD IN ('Complete', 'Submitted', 'Ready')
              AND TRUNC(S_ORDER_XM.X_BUSINESS_DATE - UTC_OFFSET/24) <= (p_business_date)
              --GROUP BY S_ORDER.CONTACT_ID
              UNION ALL
              SELECT /*+ parallel full(S_ORDER) full (S_ORDER_ITEM) */ S_ORDER.CONTACT_ID AS CONTACT_ID,S_ORDER.ACCNT_ID,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '931' THEN S_ORDER.CREATED ELSE NULL END) AS LastSupplementPurchaseDate,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '931' THEN 931 ELSE NULL END) AS LastSupplementCodePurchased,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '931' THEN 7 ELSE NULL END) AS LastTotalSupplementSupplyCycle,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '920' THEN S_ORDER.CREATED ELSE NULL END) AS LastAddtlSupplPurchaseDate,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '920' THEN 920 ELSE NULL END) AS LastAddtlSupplCodePurchased,
              (CASE WHEN SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) = '920' THEN 28 ELSE NULL END) AS LastAddtlSupplSupplyCycle,
              NULL FirstPurchaseDate,
              NULL LastPurchaseDate
              FROM S_ORDER,S_ORDER_ITEM, S_PROD_INT
              WHERE S_ORDER_ITEM.PROD_ID = S_PROD_INT.ROW_ID
                   AND S_ORDER.ROW_ID = S_ORDER_ITEM.ORDER_ID
                   AND S_ORDER_ITEM.qty_req <> 0
                   AND s_order.created_by <> '1-14WD'
                   AND S_ORDER_ITEM.PAR_ORDER_ITEM_ID is null
                   AND (S_ORDER_ITEM.PAR_ORDER_ITEM_ID is null
                   OR EXISTS (select 1 from S_ORDER_ITEM i2,s_prod_int p
    where i2.row_id = S_ORDER_ITEM.PAR_ORDER_ITEM_ID
    and SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) IN ('931','920')
    and i2.prod_id = p.row_id
                   AND S_ORDER.status_cd in ('Complete', 'Submitted', 'Ready')
                   and SUBSTR(SUBSTR(S_PROD_INT.PART_NUM,1,INSTR(S_PROD_INT.PART_NUM,'-',1,1)-1),2,4) IN ('931','920')
    GROUP BY CONTACT_ID,ACCNT_ID) O,
    S_CONTACT_TNTX,
    S_ORG_EXT,
    S_ORG_EXT ORGEXT_REF,
    S_ADDR_PER,
    S_ASSET a,
    S_PROD_INT,
    S_ASSET a2,
    S_ASSET a3,
    UPL_CLIENT_TYPES ct,
    (select /*+ parallel */ o.contact_id, o.accnt_id
    from S_ORDER o, S_ORDER_XM oxm
    where o.row_id = oxm.par_row_id
    and trunc(oxm.X_BUSINESS_DATE - (UTC_OFFSET/24)) = trunc(p_business_date)
    group by o.contact_id, o.accnt_id) oxm2
    WHERE S_CONTACT.ROW_ID = S_CONTACT_X.PAR_ROW_ID
    AND S_CONTACT_X.ROW_ID = S_CONTACT_XM.PAR_ROW_ID (+)
    AND (S_ORG_EXT.ROW_ID = S_CONTACT.PR_DEPT_OU_ID
    OR S_ORG_EXT.ROW_ID = oxm2.accnt_id
    OR S_ORG_EXT.ROW_ID = S_CONTACT_XM.attrib_05)
    AND ORGEXT_REF.ROW_ID(+) = REFERRER.PR_DEPT_OU_ID
    AND S_CONTACT.CON_ASST_PER_ID = Consultant.ROW_ID
    AND S_ORG_EXT.X_DIRECTOR_ID = ProgramDirector.ROW_ID (+)
    AND S_CONTACT.CREATED_BY = CallTaker.ROW_ID
    AND S_CONTACT.ROW_ID = a.PR_CON_ID (+)
    AND S_CONTACT.PR_PER_ADDR_ID = S_ADDR_PER.ROW_ID (+)
    AND S_CONTACT_TNTX.PAR_ROW_ID (+) = S_CONTACT.ROW_ID
    AND REFERRER.ROW_ID(+) = S_CONTACT_TNTX.REFERRED_BY_ID
    AND a.PROD_ID = S_PROD_INT.ROW_ID (+)
    AND O.CONTACT_ID (+) = S_CONTACT.ROW_ID
    AND a.STATUS_CD (+) = 'Active'
    AND a.TYPE_CD (+) ='Program'
    AND S_CONTACT.ROW_ID = a2.PR_CON_ID (+)
    AND a2.STATUS_CD (+) = 'Active'
    AND a2.TYPE_CD (+) = 'Lifecycle'
    AND a3.PR_CON_ID(+) = S_CONTACT.ROW_ID
    AND a3.STATUS_CD (+) = 'Active'
    AND a3.TYPE_CD (+) = 'HealthSheet'
    AND S_CONTACT.X_JC_ACNT_NUM = ct.CLIENT_NUMBER (+)
    --AND S_ORG_EXT.LOC NOT LIKE 'F%'
    AND S_ORG_EXT.ACCNT_TYPE_CD NOT IN 'Division'
    --AND S_ORG_EXT.Loc in (select to_char(centreid) from UPL_LIVE_CENTRES where LIVE = 'Y')
    AND (trunc(S_CONTACT.LAST_UPD - (UTC_OFFSET/24)) = trunc(p_business_date) or trunc(S_CONTACT_X.LAST_UPD - (UTC_OFFSET/24)) = trunc(p_business_date) OR (S_CONTACT_XM.X_CONSULTATION_DT = p_business_date) OR oxm2.CONTACT_ID IS NOT NULL)
    AND S_CONTACT.last_upd_by not in ('1-14WD')
    AND oxm2.CONTACT_ID (+) = o.CONTACT_ID
    AND S_ORG_EXT.LOC <> 'CW_846'
    AND (a.pr_accnt_id in (select row_id from S_ORG_EXT where S_ORG_EXT.LOC IN (Select CentreID from UPL_Live_Centres where BATCHID = p_batch_id)) or a.pr_accnt_id is null)
    AND (a2.pr_accnt_id in (select row_id from S_ORG_EXT where S_ORG_EXT.LOC IN (Select CentreID from UPL_Live_Centres where BATCHID = p_batch_id)) or a2.pr_accnt_id is null)
    AND (a3.pr_accnt_id in (select row_id from S_ORG_EXT where S_ORG_EXT.LOC IN (Select CentreID from UPL_Live_Centres where BATCHID = p_batch_id)) or a3.pr_accnt_id is null));
    rollback;
    END;
    --------------------------------------------------------------------------------------------------

  • Sorting internal table with variable no of fields

    Hi ,
    I want to sort the internal table with variable no of fields . Every time the  report is run the number of fields as well as the sequence by which the table has to be sorted changes . How to do this .
    regards

    Hi,
    Please try this.
    DATA: BEGIN OF ITAB OCCURS 0,
            F1(4),
          END OF ITAB.
    DATA: BEGIN OF ITAB2 OCCURS 0,
            F1(1),
            F2(1),
            F3(4),
          END OF ITAB2.
    ITAB-F1 = '01AC'.
    APPEND ITAB.
    ITAB-F1 = '02AB'.
    APPEND ITAB.
    ITAB-F1 = '01CD'.
    APPEND ITAB.
    ITAB-F1 = '02CA'.
    APPEND ITAB.
    LOOP AT ITAB.
      ITAB2-F1 = ITAB-F1+2(1).
      ITAB2-F2 = ITAB-F1+3(1).
      ITAB2-F3 = ITAB-F1.
      APPEND ITAB2.
    ENDLOOP.
    SORT ITAB2 BY F1 ASCENDING
                  F2 DESCENDING.
    LOOP AT ITAB2.
      WRITE: / ITAB2-F3.
    ENDLOOP.
    REWARD POINTS IF HELPFUL

  • Duty Cycle

    how to generate a waveform with the duty cycle?
    Pls reply soon
    Thanks,
     Jinal

    Hi Jinal,
    Look in the examples folder, there is a function generator example with a square wave function that allows you to change the duty cycle.
    labview\examples\measure\maxmpl.llb - Function Waveform Generator.vi
    ssk

  • Analog signal duty cycle incorrect

    I am using an NI PCIe 6535 board to send digital timing signals to a custom PCB.
    The signals are digital square wave signals with various duty cycles and phase shifts.
    I also need to send a 12 bit ramp signal to the board.
    I am having issues with the frequency.
    I need the timing signals to run at 833.33333 khz.
    I need the lsb of the ramp to run at 416.666666khz.
    To create the timing signals I am using "Create Analog signal", so that I can set up the square wave with the appropriate phase shift and duty cycle.
    Then I conver from analog to digital.
    I am using a DAQmx generate to output the signal to the PCB. I have noticed that the DAQmx gen frequency directly controls the ramps frequency.
    However for the digital timing signals there is some scaling factor. The frequency of the digital timing signals can be set in the timing signals them selves. The sample rate in the analog signal also effects the frequency.
    To get the frequencies that I need. I had to set the"create analog signal" sample rate at 2.778G S/s, the "create analog signal" frequency to 1.2889GHZ, and the DAQmx generate frequency to 1.66666 MHZ. At those numbers, I get the timing signals to output at 833.333KHZ and the second bit of the ramp at 416.6666HZ (for the ramp I upped it to 13 bit and I don't use bit 0, as it outputs at 833KHZ).
    However at these settings all of my timing signals have the same phase, and the same duty cycle, even though I have them set differently.
    Can someone please help? I think the issue is that I have the sample rate and frequency of the "create analog signal" block set too high, but if I set them lower my signals will not be at the right frequency.
    Attachments:
    timing signal 1.JPG ‏44 KB
    timing signal 2.JPG ‏47 KB
    daqmx gen.JPG ‏55 KB

    Hi David,
    We found that there seems to be a weird divider between the sampling rate of the analog signal module, the analog signal sample rate, and the f daqmx gen.
    After various tests we made a chart of what we observed. Fsignal and sample rate are values set in the "create analog signal" module, Fdaqmxgen is set in the "DAQmx generate" module. We used a "create anaolg signal" module to create the square wave, then convert analog to digital convert the square wave to digital.
    We have "repeated signal" and "N periods" checked.
    Fsignal
    Fdaqmxgen
    Sample rate
    Frequency   measured on the scope
    1GHZ
    10MHZ
    100G s/s
    100KHz
    100MHZ
    10MHZ
    100G s/s
    10KHZ
    1GHZ
    1MHZ
    100G s/s
    10KHZ
    10GHZ
    10MHZ
    100G s/s
    1MHZ
    100GHZ
    10MHZ
    100G s/s
    10MHZ
    100GHZ
    10MHZ
    100G s/s
    5MHZ
    The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    To meaure the frequencies were using an HP 54600A oscilloscope, and probing standoff pins on our custom pcb.
    We have several versions of the project, attached is the latest one.
    Kyle,
    How do I set the compression to false?
    The picture below looks like labview? We are using signal express.
    I can't change the frequency on the DAQ mx gen because I need the ramp to run at a set frequency.
    There is a divider between the daqmx gen and the f signal. I have to set the Fsginal in the GHZ to get it to out at the right frequency. The equation we came up with is Feff = (Fsginal/FDaqmxgen)*1000.
    Thanks,
    Devin

  • Duty cycle value & user prompt

    1. Duty cycle
    The value input in the front panel works fine up to 34%, but then it fails for any value above 35%.
    (for input value 35% and above, instrument shows 0.5% instead..for all values..)
    How can I fix this to make it between 0-100%???
    2. User Prompt for config file
    Currently, config file will be loaded via "Load Config" case, but is it possible to kick this off when the main VI starts?
    The idea is to force a user to load config file to synchronize between the instrument display and the LV front panel.
    (when every time the program gets kicked off)
    Does anyone have an idea how to do this?
    Thanks,
    Attachments:
    Pulse Channel with Load and Save_no event_v09.4.2.llb ‏2689 KB

    I am still having a trouble with setting duty cycle value above 35%...
    Tried to add timebase mode subVI in the application function VI, but the outcome is still the same.
    Plz help on this...
    Attachments:
    HP8133A Application Function_mod2.vi ‏129 KB
    Pulse Channel with Load and Save_no event_v09.4.3.vi ‏580 KB
    HP8133A Ex-Div Timebase_mod.vi ‏48 KB

  • Duty cycle analysis of multiple channel

    I have multiple accelerometer with a duty cycle output (acceleration proportionnal to duty cycle). How can I wire these sensors to the DAQPad 6052E ?

    Hi Math,
    You will probably get more responses if you post this question to the Data Acquisition list.
    When you do so, please provide more info regarding the nature of the signal,
    how often you want to acquire it,
    and what you want to do with the data.
    If you give us enough info, we can answer anything (provided there is funding in place).
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Bad Duty Cycle readings

    Hello!
     I’m building an application in which I want to measure a duty cycle.  I can control the “Duty Cycle In” and the FCM analyzes the info and sends a signal to the Motor. I want to measure the “Duty Cycle Out” of the motor. (I attached diagram) For this measurement I just connected a wire to the negative side of the motor. To calculate this Duty Cycle I am measuring the period and the pulse width. The program works very good when I have a “Duty Cycle Out” from 1% to 99%, but whenever is 0 or 100% it shows wrong info. I would expect that the pulse width at 0% or 100% is cero, but LabVIEW shows a value (1,1E-5 s) and calculates a Duty Cycle of about 23% which is totally wrong.  Also, if I run the program for the first time and I measure this pulse width with a “Duty Cycle In” of 0%, pulse width is cero., but whenever I change the “Duty Cycle In” to 10% or higher, and then I go back to a “Duty Cycle In” of  0% it shows a value, and calculates a bad Duty Cycle. I don’t know why this only happens when I put higher “Duty Cycles In”, and then I go back to 0%. I measured the signal with an oscilloscope and there is nothing, not even noise! I don’t know how the card gets these lectures.   Do you have any suggestions of what can be wrong?
    Appreciated! 
    Solved!
    Go to Solution.
    Attachments:
    Diagram.JPG ‏33 KB

    Hi Elmar
    Thanks for the reply. I attached my Code. I am measuring the period with ctr0 and pulse width with ctr1. I divide Pulse Width / Period to obtain the Duty Cycle. To detect 0% and 100% I compare the value of pulse width to zero. I created an additional Digital Input, with this channel I check if the signal is high or low. So if Pulse Width is zero, I read from the Digital Input the level of the signal, and then I know whether is 100% or 0%. My problem is when I have a Duty Cycle of 0 or 100%, the DAQ keeps sending a value for the pulse width, and I cannot apply the method explained before. I think this value should be zero, I don’t know if I am mistaken.    
    Attachments:
    PWM_Measurement.vi ‏61 KB
    PWM_Measurement.JPG ‏151 KB

Maybe you are looking for

  • Firefox does not want to open popup or when I do "file new window" it does not open it too.

    When I click on a link that opens a popup, firefox does not open it. Same for "File> New Window." Then, often after Firefox starts to malfunction and no longer wants to open my bookmarks. I uninstalled and reinstalled firefox, removed all extensions

  • GL account 131139 does not exist in chart of accounts INT (CIN)

    Hi All, I understand this question has been discussed many times. But I am not able to solve it. The error is in MIGO.It was working fine before.I activated CIN by doing all the settings. When I do MIGO its giving the error.The GL 131139 has been cre

  • Commitment FY

    Hi, We have WBS with AVAC ( Annual Budget). Is it possible to be at this situation : ? ( It is immpossible for me check in our system) 1. PO created in 2010 delivery date 2010 ( budget is taken from 2009) 2. Good Receipt 2011 ( posting date 01.01.201

  • [SOLVED] Files in /etc with a dash after them (e.g. /etc/group-)

    Hi, What are the files in /etc with a dash after them? For example, I have: /etc/group /etc/group- /etc/gshadow /etc/gshadow- /etc/shadow /etc/shadow- What are the dashed versions for? Do I need to keep them? Last edited by jwhendy (2010-10-25 21:47:

  • Problem in creating idocs

    hi, While creating idocs I created logical system using SPRO,then created RFC then Port but when i am creating partner profiles I am unable to get the destination system which I have created.Could any one guide me.