Waveform à DT non constant

Bonjour,
je souhaite utiliser un graphe de signaux mixtes, pour tracer des valeurs analogiques, et des valeurs numériques.
Pour les valeurs analogiques, pas de problème, je trace une courbe XY.
La ou ça se corse, c'est pour les valeurs numériques : il semblerait que le graphe de signaux mixte n'accepte que des waveforms numériques. Malheureusement pour moi, ce que je veux tracer n'est pas simple : par exemple un booléen d'ouverture de porte.
Je voudrais tracer ceci :
T          Valeur
0           false
60         true
63         false
19999   true
20000   false
Ou T est le temps écoulé en secondes.
Le problème avec la waveform, c'est que la waveform doit avoir un DT constant, donc pour tracer ça, je me retrouve avec un tableau gigantesque car le DT minimum est de 3s, donc je dois prendre ce DT !
Est ce que quelqu'un sait comment se dépétrer de ces waveforms ?
Merci !
V-F
Résolu !
Accéder à la solution.

Bonjour,
merci de votre réponse.
Grâce à elle, j'ai encore plus creusé mon problème (j'avais déja beaucoup cherché), et voici la solution !
Grâce à 8 valeurs, je trace un graphe numérique très léger avec un dt variable : un événement a lieu une seconde.
Ces données sont monitorées sur une machine : quand un événement se passe (ouverture de porte, etc.), j'enregistre les paramètres de la machine.
Ces événements ne sont donc pas cadencés !
Merci pour tout !
V-F

Similar Messages

  • ORA-56901: non-constant expression is not allowed for pivot|unpivot values

    Getting following errors
    ORA-56901: non-constant expression is not allowed for pivot|unpivot values
    ORA-06512: at "APPS.PIVOT_AWARD", line 16
    ORA-06512: at line 5
    when i run the following function it is giving error as above.
    can you please help me
    create or replace
    Function Pivot_award return sys_refcursor
    IS
       v_dept    VARCHAR2 (20000);
       v_query   VARCHAR2 (1000);
       op_rs sys_refcursor;
    BEGIN
      SELECT LISTAGG(award_number,',') WITHIN GROUP (ORDER BY award_id)
      INTO V_DEPT FROM xxdl.XXDL_CD_SCHEDULE_K_GTT ;
       v_query :=
          'SELECT *
            FROM (
            select award_name, award_id,award_number from xxdl.XXDL_CD_SCHEDULE_K_GTT)
            PIVOT(max(VAL) for award_number in  ('||v_dept||'))';
       OPEN op_rs FOR v_query;
       return op_rs;
    END;
    SELECT LISTAGG(award_number,',') WITHIN GROUP (ORDER BY award_id)
      INTO V_DEPT FROM xxdl.XXDL_CD_SCHEDULE_K_GTT ;
    Result of 1st query is PPE_T_CAPITAL,XIBNG,XIABP,XIABQ,XIABR,XIABS,XIABT,XIABU,XIABV,XIABW,XIAAE,XIAAF,XIAAG,XIAAH,XIAAI,XIAAJ,XIAAK,XIAAL,XIAAM,XIAAN,XIAAO,XIAAP,XIAAQ,XIAAR,XIAAS,XIAAU,XIAAU,XIAAV,XIAAZ,XIABD,XIABE,XIABF,XIABG,XIABH,XIABI,XIABJ,XIABK,XIABL,XIABM,XIABN,XIAAA,XIAAB,XIAAC,XIAAD,XIABY,XIABZ,XIACA,XIACB,XIACC,XIACD,XIACE,XIACF,XIACG,XIACH,XIACI,XIABA,XIAAW,XIAAX,XIAAY,XIACN,XIACT,XIACU,XIACP,AAAEX,XIACW,XIADC

    Hi Frank,
    Here is the create table and insert script. This is needed for me to show in report rows to columns.
    create table award_test(
      AWARD_NUMBER                            VARCHAR2 (15) ,                                                                                                                                                                                
    AWARD_NAME                              VARCHAR2(30)  ,                                                                                                                                                                               
    TOTAL_PROCEEDS                          NUMBER    ,                                                                                                                                                                                   
    EARNING_PROCS                           NUMBER    ,                                                                                                                                                                                   
    TOT_PROCS_EARNINGS                      NUMBER   ,                                                                                                                                                                                    
    GROSS_PROCS                             NUMBER   ,                                                                                                                                                                                    
    PROC_REF_DEF_ESCR                       NUMBER   ,                                                                                                                                                                                    
    OTH_UNSP_PROCS                          NUMBER  ,                                                                                                                                                                                     
    ISSUANCE_COST                           NUMBER   ,                                                                                                                                                                                    
    WORK_CAP_EXP                            NUMBER 
    --insert script
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAE','CEFA CP',300000000,200,300000200,300,500,600,0,700);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABG','CEFA K',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAS','Escondido Village #3',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('AAAEX','SU2009A',801806000,null,801806000,null,null,null,1806000,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABI','CEFA L-6',17815000,null,17815000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAP','CEFA R',115050508.15,null,115050508.15,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIACG','CEFA D',53150000,null,53150000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAB','Stu Union-1962',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAA','Notes Payable-Commercial Paper',350000000,null,350000000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABZ','CEFA L-3',9840000,null,9840000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAV','CEFA B',18106540,null,18106540,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAI','Medium Term Notes - Tranche 3',50000000,null,50000000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAZ','Recycling Pool',473379904.44,null,473379904.44,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAY','CEFA T2',187550000,null,187550000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAM','GMAC',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAU','CEFA A/K',16922982,null,16922982,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAC','SU TB 2002A - PARS',50000000,null,50000000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABL','CEFA L-9',15490000,null,15490000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABY','CEFA L-2',8775000,null,8775000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAJ','Frat 1&2',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAW','CEFA S',180727500,null,180727500,null,null,null,-472500,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAQ','Escondido Village #1',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIACW','CEFA U',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIACF','CEFA E',19753227.34,null,19753227.34,null,null,null,-106772.66,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIACN','CEFA T3',27562758.96,null,27562758.96,null,null,null,-47941.04,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAG','Medium Term Notes - Tranche 1',50000000,null,50000000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('PPE_T_CAPITAL','PPE_T_CAPITAL',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAK','Frat 3',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAF','Tresidder',0,null,0,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIABH','CEFA L',5055000,null,5055000,null,null,null,0,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAU','CEFA A/K',6605655,null,6605655,null,null,null,-74345,null);
    Insert into "award_test" (AWARD_NUMBER,AWARD_NAME,TOTAL_PROCEEDS,EARNING_PROCS,TOT_PROCS_EARNINGS,GROSS_PROCS,PROC_REF_DEF_ESCR,OTH_UNSP_PROCS,ISSUANCE_COST,WORK_CAP_EXP) values ('XIAAD','SU 2024 Bonds',150000000,null,150000000,null,null,null,0,null);Expected output rows to columns (i took first two insert statements)
    'XIAAE','CEFA CP',300000000,200,300000200,300,500,600,0,700
    'XIABG','CEFA K',0,null,0,null,null,null,0,null
    I need to have awardnumber and corresponding details below
    'XIAAE'       'XIABG'
    'CEFA CP'    'CEFA K'
    300000000   0
    200             null
    300000200   0
    This way i need to get all the information vertically with awardnumber. I have written following code but it is not working.
    create or replace
    Function Pivot_award return sys_refcursor
    IS
       v_dept    VARCHAR2 (20000);
       v_query   VARCHAR2 (1000);
       op_rs sys_refcursor;
    BEGIN
      SELECT LISTAGG('''' || award_number || '''',',') WITHIN GROUP (ORDER BY award_number)
      INTO V_DEPT FROM award_test ;
       v_query :=
          'SELECT *  from award_test
            UNPIVOT(VAL for operator in(                                                                                                                                                                                                       
    AWARD_NAME,                                                                                                                                                                                                              
    TOTAL_PROCEEDS,                                                                                                                                                                                                             
    EARNING_PROCS ,                                                                                                                                                                                                              
    TOT_PROCS_EARNINGS ,                                                                                                                                                                                                           
    GROSS_PROCS    ,                                                                                                                                                                                                               
    PROC_REF_DEF_ESCR ,                                                                                                                                                                                                        
    OTH_UNSP_PROCS ,                                                                                                                                                                                                              
    ISSUANCE_COST ,                                                                                                                                                                                                            
    WORK_CAP_EXP ))
            PIVOT(max(VAL) for award_number in  ('||v_dept||'))';
       OPEN op_rs FOR v_query;
       return op_rs;
    END;throwing an error ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at "APPS.PIVOT_AWARD", line 11
    ORA-06512: at line 5
    also when i run simple query
    SELECT *  from award_test
            UNPIVOT(VAL for operator in(                                                                                                                                                                                                       
    AWARD_NAME,                                                                                                                                                                                                              
    TOTAL_PROCEEDS,                                                                                                                                                                                                             
    EARNING_PROCS ,                                                                                                                                                                                                              
    TOT_PROCS_EARNINGS ,                                                                                                                                                                                                           
    GROSS_PROCS    ,                                                                                                                                                                                                               
    PROC_REF_DEF_ESCR ,                                                                                                                                                                                                        
    OTH_UNSP_PROCS ,                                                                                                                                                                                                              
    ISSUANCE_COST ,                                                                                                                                                                                                            
    WORK_CAP_EXP ))
            PIVOT(max(VAL) for award_number in  ('PPE_T_CAPITAL','XIBNG','XIABP')) Throwing an error
    ora-01790 Expression must have same datatype as correspoding expression
    Edited by: 893185 on Nov 10, 2011 2:00 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • C++ STL library error: Non-const function ... called for const object

    Hello,
    I'm using the Forte Developer 6 Update 2 C++ compiler and standard library on Solaris 9 SPARC. I've installed the recommended patch set for C++ (both the workshop and platform patches).
    In my code, I have a STL set with some elements that I want to modify, say:
    typedef set<SomeClass> MySet;
    typedef MySet::iterator MySetIter;
    I'm trying to look for an element, then update some of its fields:
    MySet theSet;
    SomeClass sci;
    MySetIter it = theSet.find(sci);
    if (it != theSet.end()) {
    it->update_some_fields();
    The above code fails with the following error (some details scrapped):
    Error: Non-const function SomeClass::update_some_fields() called for const object
    Which is weird, since set::find() seems to return a set<...>::iterator, not a set<...>::const_iterator!
    If I try a workaround, like this:
    if (it != theSet.end()) {
    SomeClass &tmp = *it;
    tmp->update_some_fields();
    I get this other error:
    Initializing SomeClass& requires an lvalue.
    Is there some way to convince the Forte compiler to work around this situation (most likely a compiler / library bug)?

    This was fixed, too, by replacing the set with a map. It seems that the issue was related to the fact that any change made to a set member is supposed to not modify the elements that make up the key (the elements that are used in the comparison function to determine the ordering). The Windows (dinkumware) implementation of the STL allows set modifications, though I don't know how they check that the key fields are not modified. The Solaris implementation (and the GNU implementation, too) disallows any modifications made to set members. At least that's what a person more knowledgeable of C++ in our office found out. So I don't think the issue was related to template constructors or any unimplemented features after all.

  • Non-constant initializer error; compiler bug?

    The following code snippet demonstrates the issue:
    typedef struct {
    char *p;
    } S1;
    int main()
    char a;
    S1 s = { &a };
    hadron:~/src/misc> cc -V junk.c
    cc: Sun WorkShop 6 update 1 C 5.2 2000/09/11
    acomp: Sun WorkShop 6 update 1 C 5.2 2000/09/11
    "junk.c", line 8: non-constant initializer: op "U&"
    The compiler correctly handles the case where 's' is a simple pointer (eg. char *s = &a).  I don't have a copy of K&R handy but surely the C language allows structure initializers to contain address operators.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Using the code you posted and the following compile line:
    % CC -xO3 -library=stlport4 -g -o stl stl.cpp -V
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    ccfe: Forte Developer 7 C++ 5.4 2002/03/09
    iropt: Forte Developer 7 Compiler Common 7.0 2002/03/09
    cg: Forte Developer 7 Compiler Common 7.0 2002/03/09
    CClink: Forte Developer 7 C++ 5.4 2002/03/09
    CC: Forte Developer 7 C++ 5.4 2002/03/09
    /export/home/SUNWspro/bin/../prod/bin/c++filt: Forte Developer 7 C++ 5.4 2002/03/09
    ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.373
    % dbx stl
    Reading stl
    Reading ld.so.1
    Reading libstlport.so.1
    Reading libCrun.so.1
    Reading libm.so.1
    Reading libw.so.1
    Reading libc.so.1
    Reading libdl.so.1
    Reading libc_psr.so.1
    (dbx) access check
    access checking - ON
    (dbx) run
    Running: stl
    (process id 20274)
    Reading librtc.so
    RTC: Enabling Error Checking...
    RTC: Running program...
    execution completed, exit code is 0
    (dbx)
    Are you compiling with some other option? Does this
    error occur every time or randomly?

  • 'build waveform' in cluster-constant not possible?

    I would like to read a 2d-array of a cluster from file that contains - beside 4 clusters - a waveform.
    As far as I understand, you have to determine the byte-stream-type for the "read-file" operation.
    In order to do so I tried to generate a 2d-array-constant that contains the cluster mentioned above with all values as empty constants.
    But soemhow it doesnt seem to work for "build waveforms". I am not able to put the waveform inside the cluster!?
    Any ideas so far?
    Thanks in advance
    Thomas

    I'm a lttle confused. You can put a waveform datatype inside a cluster and put that cluster inside an array and make that array multi-dimensional. This is all easily done on the front panel. Putting a function like "Build Waveform" inside a cluster doesn't work any more than trying to put an arithmetic function inside a cluster. Clusters hold valid datatypes, not functions. If I've misunderstood your problem, could you explain a little more?

  • Reinterpret_cast failed to cast between const and non-const member function

    The following code passes g++, but fails on Sun CC 5.8
    class C {
    public:
    void fv();
    void fc() const;
    typedef void (C::*C_FUNC)();
    typedef void (C::*C_CONST_FUNC)() const;
    int main()
    C_FUNC f1 = &C::fv;
    C_CONST_FUNC f2 = &C::fc;
    C_CONST_FUNC f3 = reinterpret_cast<C_CONST_FUNC>(&C::fv);
    C_FUNC f4 = reinterpret_cast<C_FUNC>(&C::fc);
    "recast.cc", line 15: Error: Cannot cast away const or volatile.
    "recast.cc", line 16: Error: Cannot cast away const or volatile.
    2 Error(s) detected.
    Is this a bug of Sun CC?
    Thanks.
    huoq.

    This is a bug in the Sun C++ compiler. A reinterpret_cast is not allowed to cast away constness, but the "const" on a non-static member func tion is not a "top-level" const, and is not being cast away.
    Please file a bug report at http://bugs.sun.com

  • IMovie volume meter shows much red peaking but audio waveform shows none

    When I play my movie, the volume meter in iMovie shows peaking in the red (distortion) all over the place, but in the audio waveform there is not one place where it peaks into the red (or even the yellow).  The whole wave is very close to the 0db line.  It sounds great when I play it and still great after I export it.  But, once I upload it to YouTube, there is awful distortion all over the place just like the volume meter in iMovie indicates.  I can't find any place to turn down output so the volume meter doesn't peak and I don't want to turn my audio waveform down below 0db and lose all of my volume.  I already tried clicking on the Normalize Clip Volume in Audio Adjustments and that didn't seem to change anything, still peaking like crazy in the volume meter.  What can I do to get rid of the red peaking and distortion?
    Here's a little more info for anyone who can help with my problem.  I am using iMovie 11 on an i7 iMac with Lion.  I turned the audio of my video all the way down and imported another audio that had been compressed in Pro Tools to show no red peaks whatsoever.  Can someone please help?
    Thanks,
    Loribella

    When I play my movie, the volume meter in iMovie shows peaking in the red (distortion) all over the place, but in the audio waveform there is not one place where it peaks into the red (or even the yellow).  The whole wave is very close to the 0db line.  It sounds great when I play it and still great after I export it.  But, once I upload it to YouTube, there is awful distortion all over the place just like the volume meter in iMovie indicates.  I can't find any place to turn down output so the volume meter doesn't peak and I don't want to turn my audio waveform down below 0db and lose all of my volume.  I already tried clicking on the Normalize Clip Volume in Audio Adjustments and that didn't seem to change anything, still peaking like crazy in the volume meter.  What can I do to get rid of the red peaking and distortion?
    Here's a little more info for anyone who can help with my problem.  I am using iMovie 11 on an i7 iMac with Lion.  I turned the audio of my video all the way down and imported another audio that had been compressed in Pro Tools to show no red peaks whatsoever.  Can someone please help?
    Thanks,
    Loribella

  • Accessing external web service with non-constant URL

    Hello, all
    I am looking in the documentation on accessing external web services, but either I am looking in the wrong place, or the documentatoin is lacking info.
    My clients have several web services in the local network (regular services, not DB-based), the have the same interface, but different URL's.
    Versions of the DB are 11, 12, and 16.
    First of all, I do not see in the specs an option for a non-hardcoded URL. The logic says that this has to be possible, but I cannot find it.
    Second, I need to see an example of accessing an XML or JSon based service, I cannot find it in the specs either.
    Can anyone point me to a document with examples?
    Thank you
    Arcady

    The following will call a web service with whatever URL you pass in as the argument "myurl".  I think that is what you are looking for.
    CREATE PROCEDURE cli_test2( myurl LONG VARCHAR )
    RESULT( httpheaders long varchar, httpvalues long varchars
    URL '!myurl'
    To deal with the resulting data in XML, use the OPENXML() function.
    eg. To turn an XML list of employees that looks like this:
    <root>
    <row EmployeeID="102" Surname="Whitney" GivenName="Fran" StartDate="1984-08-28"/>
    </root>
    into a table of results, you would do this (where xmlgetemplist() is the web service call):
    CREATE OR REPLACE PROCEDURE xmlgetemplist() RESULT( httpheader long varchar, httpbody long varchar)
    URL 'http://localhost/demo/xmlEmployeeList'
    TYPE 'HTTP:GET';
    create variable res long varchar;
    -- call the web service
    select httpbody into res from xmlgetemplist() where httpheader = 'Body'
    -- extract the XML elements into a SQL result set
    select * from openXML( res, '/root/row' ) WITH ( EmployeeID INT '@EmployeeID',
           GivenName    CHAR(20) '@GivenName',
           Surname      CHAR(20) '@Surname',
           PhoneNumber  CHAR(10) '@Phone');
    To deal with the resulting data in JSON, use the sp_parse_json() procedure.
    eg.
    To turn a JSON formatted list of employees that looks like this:
    "EmployeeID": 102,
    "Surname": "Whitney",
    "GivenName": "Fran",
    "StartDate": "1984-08-28",
    "TerminationDate": null
    into a table of results, you would do this (where jsongetemplist() is the web service call):
    CREATE OR REPLACE PROCEDURE jsongetemplist() RESULT( httpheader long varchar, httpbody long varchar)
    URL 'http://localhost/demo/jsonEmployeeList'
    TYPE 'HTTP:GET';
    create variable foo long varchar;
    --call the webservice
    select httpbody into foo from jsongetemplist() where httpheader = 'Body';
    --turn the json result into a structured array of data
    -- this step is required because of less structured nature of JSON
    call sp_parse_json( 'output_array', foo);
    --extract the JSON elements from the output array into a SQL result set
    SELECT  output_array[[row_num]].EmployeeID as EmployeeID,
                   output_array[[row_num]].SurName as SurName,
                   output_array[[row_num]].GivenName as GivenName,
                   output_array[[row_num]].StartDate as StartDate,
                   output_array[[row_num]].TerminationDate as EndDate
    FROM sa_rowgenerator(1, CARDINALITY(output_array))
    Hope this helps,
    --Jason

  • Two identical audio tracks, identical waveforms, BUT non-sync playback!

    Hi all - I've been up all night trying to figure this one out... I've shot a video on XDCAM, edited using the native codec in FCP 6.06, graded in Color and sent back to FCP as ProRes 422 (HQ).
    Now, here's the weird one - the original unmixed soundtracks have remained in sync with the graded video, but the mixed track from the sound studio gradually drifts out of sync by about 15 frames after 10 minutes of playback. I figured it was just a sample-rate mismatch but all tracks checked out and are all 48KHz - even the graphical waveforms are visually a frame-perfect match. Then I figured it could be hard disc speed or an issue with the Blackmagic card - but an export to DVD via Compressor also produced a disc where the audio gradually slipped out of sync so I've pretty much ruled out hardware.
    The only difference I can see in FCP is the sequences are '32-bit floating point' and the 48KHz .wav mixes are '16-bit integer'... I've tried changing the sequence settings but the audio still drifts.
    Any guidance would be much appreciated... this thing isn't giving me any more clues to work with!
    Cheers,
    Tom

    Thank you for your solution! I just ran into a similar problem. A friend of mine cleaned up some audio for me in his studio, and he gave me 96KHz WAV files. I put the WAV clips into the timeline, and lined up the visible waveform, exactly to the frame (I found a very distinctive click on one frame near the end of the clip). But the WAV audio gradually drifts, so at the end of about one hour of video, the WAV audio sounds about 60 frames late! I can see that distinctive click in the waveform, but I hear that click 60 frames later! Even when I delete the video and the original audio, so only the WAV file is playing, the sound of the audio drifts out of sync with the visible waveforms. Very strange...
    I will try your solution of running the WAV through Compressor to produce an AIFF, and I'll let you know what happens. - Seth Hill

  • How to return a non const value?

    Hi,
    I would like one of my methods to return a date object that should not be modified. How do I enforce this? I could create a 2nd object duplicating the original and return it, so any changes to the returned object will not mess up the original, but there must be a better way. What is it?
    Thanks,
    Carlo

    That, sadly won't work because I still need to be able to modify the date internally to the class, just when I return it in a getter I want to enforce non modifyability.
    Following is the code. Look at the getNextTime() method, this is the method that returns the date object that I want to enforce being non modifyable.
    import java.util.GregorianCalendar;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.HashMap;
    import java.util.Date;
    * Any ClockListener may register itself with this object to be notified at
    * specified times. This may for example be usefull for a job that needs to
    * be run at certain times or time intervals.
    * To schedule notifications:
    * 1. Create the class that implements the ClockListener interface.
    * 2. Add this class as a listener to the clock, using one of the schedule
    *    methods.
    * To stop notification:
    * 1. Use remove method.
    * To change a notification schedule
    * 1. Reschedule the listener. If added previously the instance will
    *    automatically be rescheduled.
    * NOTE: The granularity of this timer is 1 minute. All timers will fire on
    *       the minute, even if scheduled mid-way a minute.
    * @see com.sorenson.utils.ClockListener
    * @author carlo
    * @since  Nov 21, 2001 - 9:49:31 AM
    public class Clock
        private HashMap mSchedules;
        private HashMap mReminders;
        private static Clock mInstance = null;
        public static Clock getInstance()
            if (null == mInstance)
                mInstance = new Clock();
            return mInstance;
        private Clock()
            mSchedules = new HashMap();
            mReminders = new HashMap();
         * Every (minute) th minute(s)
        public void scheduleInterval(ClockListener listener, int minute)
            addSchedule(listener, -1, -1, -1, minute);
         * Every day at (hour):(minute)
        public void scheduleDaily(ClockListener listener, int hour, int minute)
            addSchedule(listener, -1, -1, hour, minute);
         * Every week on the (dayOfWeek) day at (hour):(minute)
        public void scheduleWeekly(ClockListener listener, int dayOfWeek, int hour, int minute)
            addSchedule(listener, -1, dayOfWeek, hour, minute);
         * Every month on the (dayofMonth) day at (hour):(minute)
        public void scheduleMonthly(ClockListener listener, int dayOfMonth, int hour, int minute)
            addSchedule(listener, dayOfMonth, -1, hour, minute);
        public Date getNextTime(ClockListener listener)
            return ((Schedule)mSchedules.get(listener)).mNextTime.getTime();
        private void addSchedule(ClockListener listener, int dayOfMonth , int dayOfWeek, int hour, int minute)
            // check for existance
            if (null != mSchedules.get(listener))
                remove(listener);
            // create a schedule for the listener based upon the specified parameters
            Schedule schedule = new Schedule(dayOfMonth, dayOfWeek, hour, minute);
            // link the listener to the schedule and store
            mSchedules.put(listener, schedule);
            // create a reminder for the next wake up time and store
            mReminders.put(listener, new Reminder(listener, schedule.updateNext()));
        public void remove(ClockListener listener)
            // cancel the current reminder
            ((Reminder)mReminders.get(listener)).cancel();
            // remove the schedule for the listener
            mSchedules.remove(listener);
            // remove the canceled reminder for the listener
            mReminders.remove(listener);
        private void wakeUp(ClockListener listener)
            // remove the old reminder
            mReminders.remove(listener);
            // create a new reminder with the next scheduled wake up time
            mReminders.put(listener, new Reminder(listener, ((Schedule)mSchedules.get(listener)).updateNext()));
            // notify listener
            listener.onWakeUpCall();
         * Defines a wake up schedule for a clock listener
        private class Schedule
            // the next date/time the listener for this schedule needs to be notified
            GregorianCalendar mNextTime;
            // schedule rule variables
            int mDayOfMonth;
            int mDayOfWeek;
            int mHour;
            int mMinute;
            Schedule(int dayOfMonth , int dayOfWeek, int hour, int minute)
                // set the initial next time to right now,
                mNextTime = BasicHelper.getGMTGregorianCalendar();
                mNextTime.set(GregorianCalendar.SECOND, 0);
                // save the schedule rules
                mDayOfMonth = dayOfMonth;
                mDayOfWeek = dayOfWeek;
                mHour = hour;
                mMinute = minute;
            long updateNext()
                // once a month
                if (-1 != mDayOfMonth)
                    nextMonth();
                // once a week
                else if (-1 != mDayOfWeek)
                    nextWeek();
                // once a day
                else if (-1 != mHour)
                    nextDay();
                // every so many minutes
                else
                    nextSoManyMinutes();
                // return the time in ms between the current time and the next scheduled wake up time
                return mNextTime.getTime().getTime() - BasicHelper.getGMTGregorianCalendar().getTime().getTime();
            private void nextMonth()
                mNextTime.add(GregorianCalendar.HOUR_OF_DAY, mHour - mNextTime.get(GregorianCalendar.HOUR_OF_DAY));
                mNextTime.add(GregorianCalendar.MINUTE, mMinute - mNextTime.get(GregorianCalendar.MINUTE));
                mNextTime.add(GregorianCalendar.DATE, mDayOfMonth - mNextTime.get(GregorianCalendar.DAY_OF_MONTH));
                // skip to next month if next time in the past
                if (BasicHelper.getGMTGregorianCalendar().after(mNextTime))
                    mNextTime.add(GregorianCalendar.MONTH, 1);
            private void nextWeek()
                mNextTime.add(GregorianCalendar.HOUR_OF_DAY, mHour - mNextTime.get(GregorianCalendar.HOUR_OF_DAY));
                mNextTime.add(GregorianCalendar.MINUTE, mMinute - mNextTime.get(GregorianCalendar.MINUTE));
                mNextTime.add(GregorianCalendar.DATE, mDayOfWeek - mNextTime.get(GregorianCalendar.DAY_OF_WEEK));
                // skip to next week if next time in the past
                if (BasicHelper.getGMTGregorianCalendar().after(mNextTime))
                    mNextTime.add(GregorianCalendar.DATE, 7);
            private void nextDay()
                GregorianCalendar newTime = new GregorianCalendar(
                        mNextTime.get(GregorianCalendar.YEAR),
                        mNextTime.get(GregorianCalendar.MONTH),
                        mNextTime.get(GregorianCalendar.DATE),
                        mHour,
                        mMinute);
                if (newTime.after(mNextTime))
                    mNextTime = newTime;
                else
                    newTime.roll(GregorianCalendar.DATE, true); // rolls one day ahead
                    mNextTime = newTime;
            private void nextSoManyMinutes()
                mNextTime.add(GregorianCalendar.MINUTE, mMinute);
         * Internal class used to set reminders for the wake up schedules of the listeners
        private class Reminder
            Timer mTimer;
            ClockListener mListener;
            Reminder(ClockListener listener, long ms)
                mListener = listener;
                mTimer = new Timer();
                mTimer.schedule(new RemindTask(), ms);
            void cancel()
                mTimer.cancel();
            class RemindTask extends TimerTask
                public void run()
                    // Terminate the timer thread
                    mTimer.cancel();
                    // Wake up the listener
                    Clock.this.wakeUp(mListener);

  • PERCENTILE_CONT with non constants

    Hi All,
    I'm currently learning PL/SQL and I'm having an issue with PERCENTILE_CONT where I want to pass a variable value instead of a constant. Can anyone shed any light on how I could coerce the variables into a constant yet still keep it dynamic or alternatively suggest any alternative functions that may perform the percentile calculations?
    My SQL is (very ameturish, improvements appreciated) below:
    SELECT
         TB1.FRONTEND_COUNTRY,ROUND(AVG(TB1.ER_RT),2) ER_RATE,ROUND(AVG(SFR_RT),2) SFR_RATE,ROUND(PERCENTILE_CONT(TB2.PERC1/100) WITHIN GROUP (ORDER BY TB1.SSV_SIV ASC)*30.5,0) SSV_SIV1, ROUND(PERCENTILE_CONT(TB2.PERC2/100) WITHIN GROUP (ORDER BY TB1.SSV_SIV ASC)*30.5,0) SSV_SIV2
    FROM     
         (SELECT PD.FRONTEND_COUNTRY, PD.PROJECT_CODE, PD.PROTOCOL, AVG(PD.PROJECT_MEAN_ERMTHS) ER_RT, AVG(PD.PROJECT_MEAN_SFR_PERCENT) SFR_RT, AVG(PD.COUNTRY_MEAN_SSU2) SSV_SIV
         FROM MYDB.TCTM_TEMP_USERACC_PROJDATA1 PD
         GROUP BY PD.FRONTEND_COUNTRY, PD.PROJECT_CODE, PD.PROTOCOL
         ORDER BY 1) TB1
         LEFT JOIN MYDB.TCTM_STRAT_NEWVAROFMIKE TB2 ON TB1.FRONTEND_COUNTRY=TB2.COUNTRY_NAME
    GROUP BY
         TB1.FRONTEND_COUNTRY
    ORDER BY 1Edited by: 955750 on 29-Aug-2012 05:53
    Edited by: 955750 on 29-Aug-2012 07:12

    Hi,
    Welcome to the forum!
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    It's good that you posted your code; always do that.
    Always say which version of Oracle you're using.
    See the forum FAQ {message:id=9360002}
    955750 wrote:
    Hi All,
    I'm currently learning PL/SQL Do you mean SQL?
    and I'm having an issue with PERCENTILE_CONT where I want to pass a variable value instead of a constant. Can anyone shed any light on how I could coerce the variables into a constant yet still keep it dynamic or alternatively suggest any alternative functions that may perform the percentile calculations?You can pass variables to PERCENTILE_CONT; the question is which values of the variables?
    >
    My SQL is (very ameturish, improvements appreciated) below:Your SQL isn't bad.
    It's hard to read if it's not formatted. When posting on this site, type these 6 characters
    \(lower-case only, inside curly brackets) before and after sections of formatted text to preserve spacing.
    SELECT
         TB1.FRONTEND_COUNTRY,ROUND(AVG(TB1.ER_RT),2) ER_RATE,ROUND(AVG(SFR_RT),2) SFR_RATE,ROUND(PERCENTILE_CONT(TB2.PERC1/100) WITHIN GROUP (ORDER BY TB1.SSV_SIV ASC)*30.5,0) SSV_SIV1, ROUND(PERCENTILE_CONT(TB2.PERC2/100) WITHIN GROUP (ORDER BY TB1.SSV_SIV ASC)*30.5,0) SSV_SIV2
    FROM     
         (SELECT PD.FRONTEND_COUNTRY, PD.PROJECT_CODE, PD.PROTOCOL, AVG(PD.PROJECT_MEAN_ERMTHS) ER_RT, AVG(PD.PROJECT_MEAN_SFR_PERCENT) SFR_RT, AVG(PD.COUNTRY_MEAN_SSU2) SSV_SIV
         FROM MYDB.TCTM_TEMP_USERACC_PROJDATA1 PD
         GROUP BY PD.FRONTEND_COUNTRY, PD.PROJECT_CODE, PD.PROTOCOL
         ORDER BY 1) TB1There's no reason to use an ORDER BY clause in this sub-query.
         LEFT JOIN MYDB.TCTM_STRAT_NEWVAROFMIKE TB2 ON TB1.FRONTEND_COUNTRY=TB2.COUNTRY_NAME
    GROUP BY
         TB1.FRONTEND_COUNTRY
    ORDER BY 1
    Edited by: 955750 on 29-Aug-2012 05:53This problem concerns GROUP BY more that PERCENTILE_CONT.
    In the main query, you're GROUPing BY frontend_country, so there will only be 1 row of ouptput for each distinct value of frontend_country.  Let's say, for a particular frontend_country, there are 3 rows, and thy have perc1 values of 50, 50 and 80.  When you computePERCENTILE_CONT(TB2.PERC1/100) WITHIN GROUP (ORDER BY TB1.SSV_SIV ASC)
    for that row, which value of perc1 should be used?  50? 80? Something in between?  And why should it use that value? For example, if you want it to use 50, is that because 50 is the lowest value? The most common value?  Some other reason?
    If you know that each distinct value of frontend_coutry will only have 1 distinct value of perc1 (and perc2) in the main query, then you can add perc1 (and perc2) to the main query's GROUP BY clause.
    Whatever you want to do, there's probably some way to do it.  However, it's unclear what you want to do.  That's why it's so important to post a little sample data and the results you want from that data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Waveform non temporelle et non continue

    Bonjour à tous,
    j'aimerai utiliser certaines fonctions de waveform sur mes signaux, qui ne sont pas sous forme de waveform. J'essaie donc de les y mettre, mais je n'y arrive pas.
    Je vous joins mon vi pour que vous puissiez mieux cerner mon problème.
    Les 2 tableaux d'entrées sont issus d'une DAQ et l'autre d'une acquisition de valeurs sur le port série. Ces 2 tableaux sont synchronisés, c'est à dire que chaque ligne des 2 tableaux correspondent (à peu de choses près) au meme instant de mesure. Ce temps est par contre non constant entre 10 et 20ms). L'aspect temporel, je m'en fiche, car Position me donne l'angle de mon système à caractériser (potentiomètre rotatif) et DAQ correspond aux ratios de tensions entre tension curseur et alimentation potar.
    Bref, j'arrive donc à générer 2 graphes XY qui correspondent à la caractéristique des potars, mais j'aimerai pouvoir utiliser les fonctions limtes de waveform pour vérifier que ces graphes sont bien dans le gabarit voulu, et par la suite, j'aimerai aussi utiliser la fonction "trigger". Hélas, je n'arrive pas à comprendre comment les utiliser avec mes données qui ne sont pas sous forme de waveform.
    De bonnes idées à me conseiller ?
    Merci d'avance,
    David
    Résolu !
    Accéder à la solution.
    Pièces jointes :
    TriTableauPointsReference.vi ‏151 KB

    Bonjour,
    Les fonctions que vous souhaitez utiliser semblent intéressantes lorsque le
    signal possède une période d’échantillonnage constante, ce qui ne semble pas
    être votre cas (10 à 20 ms). Vu que l’information temporelle ne vous intéresse
    pas, vous pouvez par exemple utiliser la fonction "max et min d’un
    tableau" qui vous renvoie le minimum et le maximum d’un tableau ainsi que
    leurs indices pour obtenir le "gabarit" de votre graphe et vous
    assurer qu’il convient. Je vous invite aussi à prendre connaissance des
    exemples fournis dans l’aide détaillé de la fonction « Test de limite » qui pourraient vous guider.
    Cordialement 
    Mathieu B
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Forum Aéronautique, Spatial et Défense. Avec la participation exceptionnelle de Bernard DUPRIEU, Res...

  • NI USB 6008: expected constant expression

    I am using NI USB 6008 device. Looking at NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Acq-Int Clk\
    So I want to modify the line that has
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,1000,10.0,DAQmx_Val_GroupByChannel,data,1000,&read,NULL));
    as
        DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,numsamps,TimeouT,DAQmx_Val_GroupByChannel,data,numsamps,&read,NULL));
    where the corresponding variables have been defined before like:
      Int_t xx=2;
      const Int_t numsamps = const_cast<Int_t&>(xx);
        int32       error=0;
        TaskHandle  taskHandle=0;
        int32       read;
        float64     data[numsamps];
        float64 RatE = float64(raTE);
        float64 TimeouT = float64(numsamps)/RatE;
    But when I try to compile I get this error message:
    $ nmake -f makefile.mak
    Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
    Copyright (C) Microsoft Corporation.  All rights reserved.
            cl  -D_MT -D_DLL -MDd -EHsc  -nologo -G5 -GR -MD -DWIN32  -DVISUAL_CPLUS
    PLUS -D_WINDOWS -IC:\ROOT/include -O2 -c SNatInDAQ.cpp
    cl : Command line warning D9025 : overriding '/MDd' with '/MD'
    cl : Command line warning D9002 : ignoring unknown option '-G5'
    SNatInDAQ.cpp
    SNatInDAQ.cpp(261) : error C2057: expected constant expression
    SNatInDAQ.cpp(261) : error C2466: cannot allocate an array of constant size 0
    SNatInDAQ.cpp(261) : error C2133: 'data' : unknown size
    NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 8\VC\BIN\c
    l.EXE"' : return code '0x2'
    Stop.
    What does it mean 'expected constant expression'? How can I get around this?
    What I want to do is pass the size of that data array from another function.

    Hi novaiscool,
    I think the issue is that you are declaring numsamps as a constant and the DAQmxReadAnalogF64 function wnats a non constant parameter.  Have you tried calling the function with a regular int or a value?  Give that a try and see if you get the same error. 
    You will also need to initialize numsamps to something since you are allocating an array using that variable. 
    Give those things a try and let me know how it works.
    Thank You,
    Nick F.
    Applications Engineer

  • How do I output three digital waveforms at once?

    I posted this in Digital I/O, but now I think it's actually more appropriate here because it's not a hardware question. I need to output three digital waveforms at a relatively low frequency, 71.9 Hz. I have a PCI DAQ card, the 6024E and am using the NI-DAQmx functions to try to do this. My program basically generates the square wave that I want, and converts it into a digital wave. I do this 3 times for the three separate waves, and then I combine them into an array and send them to my DAQ functions, which are in a while loop so I can get continuous output. My problem is that the waveform that the DAQ is actually outputting is not what I want. It's outputting a wave that has the same duty cycle (approximately) but the frequency is over 2 kilohertz. It's not like this all the time; after it outputs about 7 cycles of this wave, it goes to logic low for a long time, and then repeats itself. When I probe the digital waveform right before it goes into the DAQ functions, it's running correctly at 71.9 Hertz. Am I doing anything wrong with the DAQ functions or the sampling information? Thanks in advance.
    -- Josh Matloff

    Hello Josh,
    I'm pretty sure that the reason that your digital waveforms are not being produced at the correct frequency is because your digital output is not associated with any sort of timing. Unfortunately, with an E series board you can only do software timed digital operations. This means that the frequency at which the values on your digital lines will be updated depends on how fast/often your computer executes the DAQmx Write that is inside of your while loop. If you have an M series board, you can actually correlate the DIO operations with another subsytems clock (AI/AO sample clock, etc.) which means that you can acheive hardware-timed DIO. In the event that you do not have access to an M series board, I think that AnalogKid2DigitalMan was spot on that you would want to use counters to generate pulse trains (that is if your digital waveforms have a constant duty cycle and period). Depending on what the DAQ board is outputting to, you might also want to consider using the Analog Output channels to generate your digital waveform. As long as you continue to use the digital lines on the 6024E, there is not really a way to guarantee the timing of when the digital lines will be updated. You might be able to get close, but you will probably see some "hiccups", especially if your computer needs to service interrupts or give processing time to another application. And lastly, heed geckoee's advice and don't forget to properly close out your tasks! Putting in some error handling may also help in the debugging process.
    Take care,
    E.Lee
    Eric
    DE For Life!

  • Are PL/SQL Package Body Constants in Shared Area or Private Area

    Based on this it not clear to me if PL/SQL Package Body Constants are stored in shared area or private area.
    http://docs.oracle.com/cd/B28359_01/server.111/b28318/memory.htm
    "PL/SQL Program Units and the Shared Pool
    Oracle Database processes PL/SQL program units (procedures, functions, packages, anonymous blocks, and database triggers) much the same way it processes individual SQL statements. Oracle Database allocates a shared area to hold the parsed, compiled form of a program unit. Oracle Database allocates a private area to hold values specific to the session that runs the program unit, including local, global, and package variables (also known as package instantiation) and buffers for executing SQL. If more than one user runs the same program unit, then a single, shared area is used by all users, while each user maintains a separate copy of his or her private SQL area, holding values specific to his or her session.
    Individual SQL statements contained within a PL/SQL program unit are processed as described in the previous sections. Despite their origins within a PL/SQL program unit, these SQL statements use a shared area to hold their parsed representations and a private area for each session that runs the statement."
    I am also curious what are the fine grained differences from a memory and performance perspective (multi-session) for the two examples below. Is one more efficient?
    Example 1.
    create or replace
    package body
    application_util
    as
    c_create_metadata constant varchar2(6000) := ...
    procedure process_xxx
    as
    begin
    end process_xxx;
    end application_util;
    vs.
    Example 2.
    create or replace
    package body
    application_util
    as
    procedure process_xxx
    as
    c_create_metadata constant varchar2(6000) := ...
    begin
    end process_xxx;
    end application_util;

    >
    What i am asking is fairly granular, so here it is again, let's assume latest version of oracle..
    In a general sense, is the runtime process able to manage memory more effectively in either case, one even slightly more performant, etc
    ie does example 1 have different memory management characteristics than example 2.
    Specifically i am talking about the memory allocation and unallocation for the constant varchar2(6000)
    Ok, a compiler's purpose is basically to create an optimized execution path from source code.
    The constant varchar2(6000) := would exist somewhere in the parse tree/execution path (this is stored in the shared area?).
    I guess among the things i'm after is
    1) does each session use space needed for an additional varchar2(6000) or does runtime processor simply point to the constant string in the parse tree (compiled form which is shared).
    2) if each session requires allocation of space needed for an additional varchar2(6000), then for example 1 and example 2
    at what point does the constant varchar allocation take place and when is the memory unallocated.
    Basically does defining the constant within the procedure have different memory characteristics than defining the constant at the package body level?
    >
    Each 'block' or 'subprogram' has a different scope. So the 'constant' defined in your example1 is 'different' (and has a different scope) than the 'constant' defined in example2.
    Those are two DIFFERENT objects. The value of the 'constant' is NOT assigned until control passes to that block.
    See the PL/SQL Language doc
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/fundamentals.htm#BEIJHGDF
    >
    Initial Values of Variables and Constants
    In a variable declaration, the initial value is optional (the default is NULL). In a constant declaration, the initial value is required (and the constant can never have a different value).
    The initial value is assigned to the variable or constant every time control passes to the block or subprogram that contains the declaration. If the declaration is in a package specification, the initial value is assigned to the variable or constant once for each session (whether the variable or constant is public or private).
    >
    Perhaps this example code will show you why, especially for the second example, a 'constant' is not necessarily CONSTANT. ;)
    Here is the package spec and body
    create or replace package pk_test as
      spec_user varchar2(6000);
      spec_constant varchar2(6000) := 'dummy constant';
      spec_constant1 constant varchar2(6000) := 'first constant';
      spec_constant2 constant varchar2(6000) := 'this is the second constant';
      spec_constant3 constant varchar2(6000) := spec_constant;
      procedure process_xxx;
      procedure change_constant;
    end pk_test;
    create or replace package body pk_test as
    procedure process_xxx
    as
      c_create_metadata constant varchar2(6000) := spec_constant;
    begin
      dbms_output.put_line('constant value is [' || c_create_metadata || '].');
    end process_xxx;
    procedure change_constant
    as
    begin
      spec_constant := spec_constant2;
    end change_constant;
    begin
      dbms_output.enable;
      select user into spec_user from dual;
      spec_constant := 'User is ' || spec_user || '.';
    end pk_test;The package init code sets the value of a packge variable (that is NOT a constant) based on the session USER (last code line in package body).
    The 'process_xxx' procedure gets the value of it's 'constant from that 'non constant' package variable.
      c_create_metadata constant varchar2(6000) := spec_constant;The 'change_constant' procedure changes the value of the package variable used as the source of the 'process_xxx' constant.
    Now the fun part.
    execute the 'process_xxx' procedure as user SCOTT.
    SQL> exec pk_test.process_xxx;
    constant value is [User is SCOTT.].Now execute 'process_xxx' as another user
    SQL> exec pk_test.process_xxx;
    constant value is [User is HR.].Now exec the 'change_constant' procedure.
    Now exec the 'process_xxx' procedure as user SCOTT again.
    SQL> exec pk_test.process_xxx;
    constant value is [this is the second constant].That 'constant' defined in the 'process_xxx' procedure IS NOT CONSTANT; it now has a DIFFERENT VALUE.
    If you exec the procedure as user HR it will still show the HR constant value.
    That should convince you that each session has its own set of 'constant' values and so does each block.
    Actually the bigger memory issue is the one you didn't ask about: varchar2(6000)
    Because you declared that using a value of 6,000 (which is 2 ,000 or more) the actual memory allocation not done until RUN TIME and will only use the actual amount of memory needed.
    That is, it WILL NOT pre-allocate 6000 bytes. See the same doc
    http://docs.oracle.com/cd/E14072_01/appdev.112/e10472/datatypes.htm#CJAEDAEA
    >
    Memory Allocation for Character Variables
    For a CHAR variable, or for a VARCHAR2 variable whose maximum size is less than 2,000 bytes, PL/SQL allocates enough memory for the maximum size at compile time. For a VARCHAR2 whose maximum size is 2,000 bytes or more, PL/SQL allocates enough memory to store the actual value at run time. In this way, PL/SQL optimizes smaller VARCHAR2 variables for performance and larger ones for efficient memory use.
    For example, if you assign the same 500-byte value to VARCHAR2(1999 BYTE) and VARCHAR2(2000 BYTE) variables, PL/SQL allocates 1999 bytes for the former variable at compile time and 500 bytes for the latter variable at run time.
    >
    So when you have variables and don't know how much space is really needed do NOT do this:
    myVar1 VARCHAR2(1000);
    myVar2 VARCHAR2(1000);
    myVar3 VARCHAR2(1000);The above WILL allocate 3000 bytes of expensive memory even if it those variables are NEVER used.
    This may look worse but, as the doc states, it won't really allocate anything if those variables are not used. And when they are used it will only use what is needed.
    myVar1 VARCHAR2(2000);
    myVar2 VARCHAR2(2000);
    myVar3 VARCHAR2(2000);

Maybe you are looking for