Mathematical functions in Diadem

Can someone tell me how I simply add two channel properties together in Diadem VB script.
Or if I can calculate a new value by adding a variable to a channel property.
The output from the addition I would like to put back into a new Channel Property.
This code does not seem to work.
msgbox ChnPropValGet(1, "maximum") + ChnPropValGet(2, "maximum")
Thanks

You are correct - it looks like ChnPropValGet only shows up in DIAdem 10.1.  I use different versions of DIAdem, so often re-create the new functions that I enjoy and register them as a user command (using ScriptCmdAdd).  I think something like the function below should give you somewhat similar results.  And yes, you should be able to put this value into a channel property by using the ChnPropSet command, and perhaps the ChnPropCreate command, if you want to create a new property.  For example, the bit between the dashed lines saves the sum of the maximum values to the variable, "MaxSumVal" and then creates a property for channel #5 called "MaxSum" and sets this value to MaxSumVal.  But you could also put the value in an already-created property, but some excisting channel properties are read-only.  I hope this is not confusing!
MaxSumVal = ChnPropValGet(4, "maximum") + ChnPropValGet(3, "maximum")
Call ChnPropCreate(5, "MaxSum", DataTypeFloat64)
Call ChnPropSet(5, "MaxSum", MaxSumVal)
Call ChnPropSet(5, "Description", MaxSumVal)
Public Function ChnPropValGet(ChnNum, ChnProperty)
  Dim ChanType
  ChanType = ChnPropGet(ChnNum, "displaytype")
  Select Case ChanType
    Case "Numeric"  ChnPropValGet = Val(ChnPropGet(ChnNum, ChnProperty))
    Case "Text"     ChnPropValGet = ChnPropGet(ChnNum, ChnProperty)
    Case "Time"     ChnPropValGet = ChnPropGet(ChnNum, ChnProperty)
    Case Else       ChnPropValGet = ""
  End Select
End Function ' ChnPropValGet

Similar Messages

  • How to use mathematical functions in XSL mapping

    Hi,
    I am using Jdeveloper 10.1.3.3. I need to insert mathematical functions like "multiply,divide,power" etc in my mapping. But in the XSL i am getting all string functions and very few math functions for number.
    I am newbie in Jdev. Please if anyone can share how this can be done.
    Thanks

    Hi,
    The RfcAdapter trys to find a Sender Agreement for this RFC call but the lookup failes. The values used for this lookup are:
    Sender Party/Sender Service: The values from Party and Service belonging to the sender channel.
    Sender Interface: The name of the RFC function module.
    Sender Namespace: The fix RFC namespace urn:sap-com:document:sap:rfc:functions
    Receiver Party/Receiver Service: These fields are empty. This will match the wildcard
    Regards,
    Suryanarayana

  • How do mathematical functions in a table invoked in jsf page

    hi i need detail about how can i do mathematical functions for data in table in jsf page using adf bc. for example in my table(sales) i give product id,name,unit price, quantity then i want to calculate product of quantity and unit price in a table automatically and store in total amount column

    Hi,
    John suggestion would work. Another option is to define it in EL using #{row.quantity * row.unitPrice} as the outputText value. Then add a numberConverter to the outputText using type="currency". The best option, imho, is to define the totalAmount attribute on the VO and implement the product there. However, keep the converter on the inputText and don't use the display hints on the VO.
    Regards,
    ~ Simon

  • Create a mathematical function out of samples

    hello
    I'd like to know how can i create a mathematical function out of
    samples of a signal (sine wave for example ) .
    the samples (around 1000 samples) are known( taken from a text file),
    and also the time between every sample is known.
    thanks a lot
    Elad

    What you are probably looking for is fitting experimental data to a model function.
    LabVIEW has many fitting algorithms built-in and it depends on the desired function to decide what is best. You can fit to a line, polynomial, or exponential, etc., or you can use levenberg-marquardt for more complex models.
    If you want to fit to a single sine function, you could use "Extract single tone".
    Tell us a little more about your data.
    LabVIEW Champion . Do more with less code and in less time .

  • Is DIAdem script with Extended Classification functionality of DIAdem Professional executable by DIAdem Base?

    The Professional license adds 3D model data mapping and Extended Classification functionality to DIAdem. If I make a script that uses the 3D model data mapping functionality in DIAdem Professional it is possible to use this same script on a PC with only DIAdem Base (according to http://sine.ni.com/ds/app/doc/p/lang/nl/id/ds-263)
    Is this also true for the Extended Classification functionality? Is it possible to make a script with DIAdem Professional and execute this same script on a PC with only DIAdem Base to generate a report?
    Thanks,
    Roger

    Hi Roger,
    My understanding is that the VBScript you create that uses the extended classification function will work fine in DIAdem Base.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Programming mathematical function spaces in f#.....

    This is a very general question in order to perhaps get some redirection to the appropriate resources....II am interested in the idea of representing mathematical function spaces using f# to program the function relationships..... The idea s that in math...
    Function spaces use function instead of vectors in vector spaces... I would like to get an idea of how to implement function spaces in f#.....?????????.......
    Thank you........

    g2d.draw(polygon)

  • Mathematical functions - Frac, trunc, ceil

    Hi,
    I'm trying to use Mathematical functions like ceil, trunc... in a class method
    but they don't work.
    How can I solve the problem?
    data: appo_dec type p decimals 2,
            wa_val  type p decimals 2 value '1.75'.
    appo_dec = FRAC( wa_val ).
    The variable appo_dec always is zero.
    This code work in a report but not work in a class method.

    Well, so your variable probably becomes empty somewhere before calling FRAC...
    I gave it a try, got no issue at all...
    *       CLASS lcl_test DEFINITION
    CLASS lcl_test DEFINITION.
       PUBLIC SECTION.
         CLASS-METHODS: _frac.
    ENDCLASS.                    "lcl_test DEFINITION
    *       CLASS lcl_test IMPLEMENTATION
    CLASS lcl_test IMPLEMENTATION.
       METHOD _frac.
         DATA: l_dec TYPE p DECIMALS 2,
               l_val TYPE p DECIMALS 2 VALUE '1.75'.
         l_dec = FRAC( l_val ).
         WRITE: l_dec.
       ENDMETHOD.                    "_frac
    ENDCLASS.                    "lcl_test IMPLEMENTATION
    START-OF-SELECTION.
       lcl_test=>_frac( ).
    Kr,
    Manu.

  • What is the mathematical function associated to linear, map ranges, polynomial, table scale?

    What is the mathematical function associated to linear, map ranges, polynomial, table scale? I'd like to use the scale of daqmx for use with other types of data.

    yes, refer to the help, but only found information on the first option "linear". what I intend to is to be able to climb a number, using one of the existing scales, but don't be that mathematical function is necessary to use.

  • Using variables in a calculation function in Diadem script

    Hey guys,
    I'm new to working with Diadem Scripts.  I have tried the two different ways below to make the values of a channel equal to the results of a formula containing created variables.  I can do it if the formula contains values in place of the variables using the calculator method.  I would appreciate any guidance on how to correct the syntax in the below scripts.
    Option Explicit 'Forces the explicit declaration of all the variables in a script.
    dim a, b, c
    a = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Value
    b = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    c = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    Ch ("[2]/ROP (ft/hr)") = a + b* Ch("[2]/Backhead Pressure (psi)") + c* Ch("[2]/Backhead Pressure (psi)")^2
    Or
    Option Explicit 'Forces the explicit declaration of all the variables in a script.
    dim a, b, c
    a = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Value
    b = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    c = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    call ChnCalculate("Ch(""[2]/ROP (ft/hr)"")="&a+&b"*Ch(""[2]/Backhead Pressure (psi)"")+"&c"*Ch(""[2]/Backhead Pressure (psi)"")^2")

    I think you need to use channel name strings of the format "Group Name/Channel Name" in your ChnCalculate function.  I usually use a formula, a symbol array, and a value array to get this done:
    Dim a, b ,c, sFormula, aSymbols, aValues
    Redim aSymbols(6), aValues(6)
    aSymbols(0) = "a"
    aSymbols(1) = "b"
    aSymbols(2) = "c"
    aSymbols(3) = "A"
    aSymbols(4) = "B"
    aValues(0) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef1").Va
    lue
    aValues(1) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef2").Value
    aValues(2) = Data.Root.ChannelGroups(2).Channels("rop regression formula").Properties("ResultNonLinearFitCoef3").Value
    aValues(3) = Data.Root.ChannelGroiups(2).Channels("ROP (ft/hr)").GetReference('ref type')
    aValues(4) = Data.Root.ChannelGroiups(2).Channels("Backhead Pressure (psi)").GetReference('ref type')
    sFormula = "Ch(A) = a + b*Ch(B) + c*(Ch(B))^2"
    Call ChnCalculate(sFormula,aSymbols,aValues)
    CLAD

  • Performance: Mathematical functions

    I'm a recent convert to Oracle and need some advice.
    Scenario:
    1. Our client has a web application written in Java that queries an Oracle database to extract a list of stores based on their location.
    2. The client approached us to rewrite the application in .Net, but the database remains Oracle10g
    3. In the existing Java application there were no stored procedures used so we created much of the logic, that used to be in Java, in stored procedures.
    Problem:
    When extracting a list of stores, 5 at the most, the performance is considerably slower than their existing application. One of the points mentioned is that Oracle isn't the best place to put code that relies on mathematical equations.
    Finer detail:
    Each store record in the database has a latitude and longitude value. The user searches by postal code and the application has to return the X closest stores to them.
    We have a function which accepts the lat and long values and calculates a distance based on math equations including the use of Sin, Atan, etc.
    So in the select query we would have something to the effect of:
    SELECT storeName, round(CalcDistance(parms),13) AS Distance FROM Stores WHERE .... ORDER BY Distance
    Should this kind of code be done rather in the business logic layer or are we missing something about Oracle?
    Regards,
    J.Hov

    user11303583 wrote:
    One of the points mentioned is that Oracle isn't the best place to put code that relies on mathematical equations. As a general statement that is completely false.
    Finer detail:
    Each store record in the database has a latitude and longitude value. The user searches by postal code and the application has to return the X closest stores to them.
    We have a function which accepts the lat and long values and calculates a distance based on math equations including the use of Sin, Atan, etc.
    So in the select query we would have something to the effect of:
    SELECT storeName, round(CalcDistance(parms),13) AS Distance FROM Stores WHERE .... ORDER BY DistanceOk, the problem you are experiencing is generally referred to as context switching. This happens when you call a PL/SQL function from within SQL and you're doing it many times e.g. a function call for each row. This is because for each row the function is called and the value is passed back, causing oracle to have to switch between the SQL 'engine' and the PL/SQL 'engine', passing all relevant information in the process.
    Likewise you can get a performance problem if you call SQL lots of times from within PL/SQL (rather than using single SQL's effecting many rows).. e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    v_sysdate DATE;
      3  begin
      4    v_sysdate := SYSDATE;
      5    INSERT INTO mytable SELECT rownum FROM DUAL CONNECT BY ROWNUM <= 1000000;
      6    DBMS_OUTPUT.PUT_LINE('Single Transaction: Time Taken: '||ROUND(((SYSDATE-v_sysdate)*(24*60*60)),0));
      7    EXECUTE IMMEDIATE 'TRUNCATE TABLE mytable';
      8    v_sysdate := SYSDATE;
      9    FOR i IN 1..1000000
    10    LOOP
    11      INSERT INTO mytable (x) VALUES (i);
    12    END LOOP;
    13    DBMS_OUTPUT.PUT_LINE('Multi Transaction: Time Taken: '||ROUND(((SYSDATE-v_sysdate)*(24*60*60)),0));
    14    EXECUTE IMMEDIATE 'TRUNCATE TABLE mytable';
    15* end;
    SQL> /
    Single Transaction: Time Taken: 1
    Multi Transaction: Time Taken: 37
    PL/SQL procedure successfully completed.
    SQL>As you can see the performance difference can be quite a good factor higher if there's a lot of context switching.
    The way to solve this is to either write your SQL statement within PL/SQL so that it processes many rows in one go, or for your particular issue, re-write your SQL statement to do the calculation as part of the SQL rather than calling user defined PL/SQL functions. You may find using Oracle's built in spatial packages useful as these are already compiled as low-level code and optimised for performance, but you may find, if the calculations can be done within the SQL itself it will be the quickest.

  • Mathematical Functions in Pages

    Hey Ya'll
    Just started a degree course in Civil Engineering. My whole school is working in Word ~ God can you believe it...!! Anyhow, just trying to work through pages to see if it will be compatible ( and in most cases it is as I can save all docs in Word). But what about complex mathematical equations & functions. In WORD you can create the most outrageous functions and equations but in pages you can only add, subtract and the other easy stuff. Is there a program out there that will allow me to keep working in pages but use the complex stuff as well or should I just throw in the towel and buy Office??
    Thanks in advance.
    RutterNFA

    The result is awful !
    But, if I understood well the OP's question, it was not about a formula editor but about the ability to create complex formulas in table's cells.
    But what about complex mathematical equations & functions. In WORD you can create the most outrageous functions and equations but in pages you can only _add, subtract and the other easy stuff_ .
    But maybe I am wrong.
    About Equations editor, look at:
    http://www.uoregon.edu/~noeckel/Keynote.html
    http://evolve.lse.ac.uk/software/EquationEditor/
    http://www.mathmagic.com/download/
    and even at the Equation editor embedded in openOffice.
    Yvan KOENIG (from FRANCE lundi 13 octobre 2008 14:00:57)

  • Add a mathematical function in Query Designer ?

    Hi,
    Do you know if it is possible to add a function in the Query Designer on formula screen ? If yes ... how ?
    Thanks a lot,
    CG.

    You can use the CEIL and FLOOR Functions for this
    Suppose you have a Key Figure K.F . hide this key figure and create a new formula Key Figure and create a formula as shown below.
    ( FRAC ( 'K.F' ) >= 0.5 ) * CEIL ( 'K.F' ) + ( FRAC ( 'K.F' ) < 0.5 ) * FLOOR ('K.F' )
    CEIL, FLOOR and FRAC will be available under Mathematical Functions

  • Oracle mathematical functions

    Hey guys,
    Not sure if this falls under the PL/SQL category or not, but in regards to Oracle's mathematical or numeric functions: i.e. SUM, MIN, MAX, COUNT, etc., does it also do division within a field? I.e. COUNT(*) of one field divided by COUNT(*) with a HAVING or WHERE attatched to it? (or vice versa rather)
    In other words, if I have 65 records, and it's maybe a yes-no field, and maybe 43 have the value "yes", for example, can it divide the count total of 43 by 65 to render a percentage value, or does that just need to be handled by whatever supplementary programming language (i.e. java, C++, Perl, etc.) by creating a double or int value and the like?
    Forgive me if this seems obvious, as I'm not totally versed in Oracle, but realize it has many capabilities.
    Thanks!

    Something like this ?
    TEST@db102 SQL> select a, b, a/b from
      2  (select count(*) a from emp where deptno=30),
      3* (select count(*) b from emp)
    TEST@db102 SQL> /
             A          B        A/B
             6         14 .428571429
    TEST@db102 SQL>                              
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Matlab Detrend function in DIAdem

    Hello,
    I am trying to pre process some data for fft processing and in Matlab I would use the Detrend function and I was wondering if these is anything similar in DIAdem.
    I am using DIAdem 2012
    Thanks
    Tim
    Solved!
    Go to Solution.

    Basically in Matlab Detrend on a matrix simple subtracts the linear line of best fit from each value of data in the array.
    For example if you have an array A[2,3,5,7,5] and you were to detend it in MatLab it would equal detA[-04, -0.4, 0.6, 1.6, -1.4].
    If you subtract detA from A you will get A-detA[2.4, 3.4, 4.4, 5.4, 6.4]  which is exaclty the same as finding the linera line of best fit for A.
    Tim

  • Can text be displayed in a formula column using mathematical functions?

    I am working with Financial Reports version 11.1.1.3 and I'm trying to accomplish the following scenario:
    Column D is a data column
    Column E is a text column containing the value "TEXT"
    Column F is a formula column with the following formula: IfThen([D]=0,[E],[D])
    What I want to see happen is if the value in column D is 0 then I want the value "TEXT" to appear in column F, otherwise; I want to show the data value that is in column D. Is it possible to display text in a formula column and if so, what is the syntax for that? Or does anyone have another way to accomplish this? Any help would be appreciated.
    Thanks!

    Short answer: No.
    For your particular issue, I would suggest putting your TEXT value in the #zero and #missing overrides in Report Studio.
    In general, Hyeprion Reporting does not do any real text validations or functions like you could use in Excel.

Maybe you are looking for

  • IOS SSL VPN problem

    I am implementing a SSL VPN with IOS version 12.4(13r)T5 on a 2801 but when I try to connect to the tunnel mode with the latest svc (anyconnect-win-2.2.0133-web-deploy-k9.exe) with https://1.2.3.4/tunnel the ssl vpn client can't connect. The error on

  • Error in creating AUC

    Hi All, I have an issue in creating as AUC , I have tried testing in development system by creating a project and wbs element. In control tab of wbs we need to select the Investment profile (we have maintained the investment profile with asset class

  • Error with replicating materials from ERP to CRM 7.0

    Hi experts! After dump (No PXA storage space available at the moment) materials are not replicated from ERP to CRM. In transaction R3AC1 there are no filters for object MATERIAL. Replication is managed by transactions R3AR2-R3AR4 with parameters MARA

  • DVD DL with a DVD-rom part

    Hi, With DVD SP 3.0.2, I'm trying to burn a DVD-DL, containing a DVD-video part (2,1 Go) and a DVD-rom part (4 Go). The layer is set to Dual and the Break Point is set to Automatic. DVD SP reports an error : "Formatting Failed. Formatting was not suc

  • I need good gui in swings for a library management system

    i need good gui in swing. i need to develope a small application of library management system where a librarian and manager access the database. librarian take care of add,del,modify the records of customer and books. with good login screens. and the