How to use type cast change string to number(dbl)?can it work?

how to use type cast change string to number(dbl)?can it work?

Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
2 simple examples:
"1" cast as I8 = 49 or 31 hex.
"1" converted to decimal = 1.
"20" cast as I16 = 12848 or 3230 hex.
"20" converted to decimal = 20.
Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
See tha attached LabView 6.1 example.
Attachments:
TypeCastAndConvert.vi ‏34 KB

Similar Messages

  • How to use Type Casting in JSF Expression Language

    I have an attribute CategoryId in my VO of type oracle.jbo.domain.Number. I am trying to use the expression of Boolean item in JSF as #{row.CategoryId != 4}
    Here is the JSF code:
                          <af:column id="s141NewItem3Col" noWrap="true" width="100"
                                     rowHeader="false">
                            <f:facet name="header">
                              <af:outputLabel value="CAtIDDeq4" showRequired="false"
                                              id="ol18"/>
                            </f:facet>
                            <af:inputText id="s141NewItem3"
                                          value="#{row.CategoryId != 4}"
                                          label="CAtIDDeq4" required="false"
                                          readOnly="#{((pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn']))) or ((!pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn'])))}"></af:inputText>
                          </af:column>I am getting the run time exception as "Can not convert 4 of type class oracle.jbo.domain.Number to class java.lang.Long".
    I am wondering how the row.CategoryId is treated as Long?. PLease advise. Also, will I be able to use type casting expressions in JSF Expression Language?
    Thanks, Pradeep

    use attributeValue
    Try *#{row.bindings.CategoryId.attributeValue != 4}* ?
    Check this thread for details which discusses about the same:
    El expression to disable  or enable
    Thanks,
    Navaneeth

  • Splitting and type casting huge string into arrays

    Hello,
    I'm developing an application which is supposed to read measurement files. Files contain I16 and SGL data which is type casted into string. I16 data is data from analog input and SGL is from CAN-bus data in channel form. CAN and analog data is recorded using same scan rate.
    For example, if we have 6 analog channels and 2 CAN channels string will be (A represents analog and C represents CAN):
    A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 .... and so on
    Anyway, I have problems reading this data fast enough into arrays. Most obvious solution to me was to use shift registers and split string in for loop. I created a for loop with two inner for loops. Number of scans to read from string is wired to N terminal of the outermost loop. Shift register is initialized with string read from file.
    First of the inner loops reads analog input data. Number of analog channels is wired to its N terminal. It's using split string to read 2 bytes at a time and then type casts data to I16. Rest of the string is wired to shift register. When every I16 channel from scan is read, rest of the string is passed to shift register of the second for loop.
    Second loop is for reading CAN channels. It's similar to first loop except data is read 4 bytes at a time and type casted to SGL. When every CAN channel from scan is read, rest of the string is passed to shift register of the outermost loop. Outputs of type cast functions are tunneled out of loops to produce 2D arrays.
    This way reading about 500 KB of data can take for example tens of seconds depending on PC and number of channels. That's way too long as we want to read several megabytes at a time.
    I created also an example with one inner loop and all data is type casted to I16. That is extremely fast when compared to two inner loops!
    Then I also made a test with two inner loops where I replaced shift register and split string with string subset. That's also faster than two inner loops + shift register, but still not fast enough. Any improvement ideas are highly appreciated. Shift register example attached (LV 7.1)
    Thanks in advance,
    Jakke Palonen
    Attachments:
    String to I16 and SGL arrays.vi ‏39 KB

    OK, there is clearly room for improvement. I did some timing and my two above suggestions are already about 100x faster than yours. A few teeaks led to a version that is now over 500x faster than the original code.
    A few timings on my rather slow computer (1GHz PIII Laptop) are shown on the front panel. For example with 10000 scans (~160kB data as 6+2) my new fastest version (Reshape II) takes 14 ms versus the original 7200ms! It can do 100000 scans (1.6MB data) in under 200 ms and 1000000 scans (15MB data) in under 2 seconds.
    I am sure the code could be further improved. I recommend the Reshape II algoritm. It is fastest and can deal with variable channel counts. Modify as needed.
    Attached is a LabVIEW 7.1 version of the benchmarking code, containing all algorithms. I have verified that all algorithms produce the same result (with the limitation that the cluster version only works for 6*I16+2*SGL data, of course). Remember that the reshape function is extremely efficient, because it does not move the data in memory. I have some ideas for further improvements, but this should get you going.
    Message Edited by altenbach on 08-05-2005 03:06 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    StringI16SGLCastingTimer.png ‏48 KB
    StringtoI16andSGLArraysMODTimer.vi ‏120 KB

  • How to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?

    Can any body give me an idea on how to use BAPI_SALESORDER_CHANGE to change payment terms in Orders?
    Regards,
    Dantham Conpolwedson

    Hi,
    try the link
    Link:[https://forums.sdn.sap.com/click.jspa?searchID=24060901&messageID=7265357]

  • Why we use type casting  ' ?='

    Hii Team
    sample code for fetching the input value from search view which is connected to btq1order contextnode
    DATA : lr_qs TYPE REF TO cl_crm_bol_dquery_service,
           lr_qr TYPE REF TO if_bol_bo_col,
    lr_qs ?= me->typed_context->btq1order->collection_wrapper->get_current( ).
    lr_qr = lr_qs->get_query_result( ).
    I am new to SAP CRM .while understanding the code i got stuck in one problem that ,
    1.what is the main purpose behind
    TYPE CASTING ie;  '?='
    2.what happens if we write ?=  becoz if we write  '='  instead of  '?='  the system thows an error.
    3.when to use this operator ?= and when we cannot use ?
    It is used almost every where in BOL coding .please help me  by giving complete explaination with an example if possible.
    Thanks in Advance

    Hi Abhishek,
    Please check returning parameter type for get_current_dquery() method. In case returning type is mutually convertible then you don't have to use type casting.
    But in case where you are taking results in some other type where results are compatible but with different structure then you use type casting.
    best example would be cl_crm_bol_entity and if_bol_bo_property_access. Here property access is an interface to class and hence we use type casting.
    Please refer to:
    type casting
    You can find more documentation on internet if you search for type casting.
    Regards,
    BJ

  • How to use TYPE addition with the OPEN DATASET ?

    Hi,
    How to use TYPE addition with the OPEN DATASET and what is the use ?
    For Example:
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    Also, if I wish to do the same for a .CSV file how can we do it.
    Thanks,
    -Sid

    Hi,
    OPEN DATASET 'test.dat'
      TYPE 'lrecl=80, blksize=8000, recfm=FB'
      FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
    For more information press F1 on OPEN DATASET.
    Thanks

  • How to use warn about changes property with page menus

    how to use warn about changes property with page menus

    Hi,
    If u will enable this property, then u will get warning message as a popup in case of change of state of VO.
    Regards,,
    Gyan

  • Hello I'm trying to update my applications and it is asking me to sign in and checking my billing account .it is not accepting my billing account that I use tried to change it several time it didn't work .what can I do to solve it?

    Hello I'm trying to update my applications and it is asking me to sign in and checking my billing account .it is not accepting my billing account that I use tried to change it several time it didn't work .what can I do to solve it?

    What happens when you try to confirm your details, if you are getting an error message then what does it say ? For a card to be accepted (debit cards are no longer accepted in all countries) it needs to be registered to exactly the same name and address as on your account, and have been issued by a bank in your country. If it's not being accepted then do you get the 'none' option on your account ?

  • HT201328 I have iphone 4 with virgin mobile canada, virgin provided me SIM unlock code online, but i don't know how to use that code to unlock my phone. Can anyone help me in this?

    I have iphone 4 with virgin mobile canada, virgin provided me SIM unlock code online, but i don't know how to use that code to unlock my phone. Can anyone help me in this?

    That's not how unlocking an iPhone works.
    The carrier the phone is locked to submits a request to Apple, wh updates their database. When that is complete, you restore the phone with iTunes to process the unlock.

  • SRM 7.0 BADI Define Agents-- How to use type /sapsrm/t_wf_area_entity

    Hi Experts,
    I'm using SRM 7.0. When implementing BADI /SAPSRM/BADI_DET_AG (Define the agents of  procsess controlled workflow), I created the sub-class of interface /SAPSRM/IF_WF_AREA to develop my won logic in method GET_RESPONSIBLE_APPROVERS.
    I want use the data in workflow container, seems the method GET_AREA_ENTITY_IDS of /SAPSRM/IF_WF_AREA  can provide a pointer which type is /sapsrm/t_wf_area_entity and point workflow area.
    My question is how to use this pointer (or how to use the type /sapsrm/t_wf_area_entity )? Many thanks.
    PS. I found some example code delivered by sap, but i want know the full structure which /sapsrm/t_wf_area_entity point. Below code for your reference:
    METHOD /sapsrm/if_wf_area~get_responsible_approvers.
      DATA lt_area_entity_id TYPE /sapsrm/t_wf_area_entity_id.
      DATA lr_area_entity_id TYPE REF TO /sapsrm/wf_area_entity_id.
      DATA ls_actor_id       TYPE swhactor.
      DATA lt_approver       TYPE /sapsrm/t_wf_approver.
      FIELD-SYMBOLS: <ls_agent_id> TYPE /sapsrm/s_wf_approver.
      lt_area_entity_id = me->/sapsrm/if_wf_area~get_area_entity_ids( ).
      LOOP AT lt_area_entity_id REFERENCE INTO lr_area_entity_id.
        ASSIGN lr_area_entity_id->* TO <ls_agent_id> CASTING.
        TRY.
            ls_actor_id-otype = <ls_agent_id>-approver_ot.
            ls_actor_id-objid = <ls_agent_id>-approver_id.
            lt_approver = /sapsrm/cl_wf_config_user=>get_manager_list( ls_actor_id ).
            APPEND LINES OF lt_approver TO rt_approver.
          CATCH /sapsrm/cx_wf_error /sapsrm/cx_wf_abort.
            CONTINUE.
        ENDTRY.
      ENDLOOP.
    ENDMETHOD.

    Hi Darcy,
    You can also use FM SAP_WAPI_READ_CONTAINER to read workflow container values.
    Please state if you have some other specific requierment.
    Regards,
    Saumya

  • How to use OMB to change filter conditions in OWB maps

    Hi,
    I want to know how we can use OMB to change filter conditions in an OWB map.
    As per my scenario i have a filter operator FLTR_1 in my maps and i have to change its filter condition from
    INOUTGRP1.ID IN (1,2)
    AND
    INOUTGRP1.VALUE > CONST_0_MAX_VAL
    to
    INOUTGRP1.ID IN (1,2)
    AND
    INOUTGRP1.VALUE > CONST_6_MAX_VAL
    Just for everybody's information we are migrating from OWB 9.2 to OWB 10.2 and we have called procedures in constants and used their values in filter conditions.OWB 10.2 generates the values for constants in a different way than OWB 9.2 thats why this change is required.I wish to automate the act of changing constant names so we can save time in changing the maps.
    Thx

    Carsten,
    I created a map in OWB 10.2 and ran the following command
    The filter operator name in this map is FILTER
    Carsten Herbe wrote:
    OMBALTER MAPPING 'TEST_MAP' MODIFY OPEARTOR 'FILTER' SET PROPERTIES (FILTER_CONDITION) VALUES ('INOUTGRP1.ID IN (1,2) AND INOUTGRP1.VALUE > CONST_6_MAX_VAL ')
    I got this error:
    OMB02933: Error getting child object of type OPEARTOR with name FILTER: MMM1034:
    Property OPEARTOR does not exist.
    Could you pls help on this.
    Thx

  • J2SE 6 warning message when using type casting

    With Java SE 5 and 6 version, there's always an annoying warning message when I write the following code:
    LinkedList<MyBean> cart0 = (LinkedList<MyBean>) session.getAttribute("cart");The warning message is because I use the type casting with the getAttribute method and thus this is not type-safe. So how do I get around the warning message and write standard code that sticks to the J2SE 6 standards? Thank you.

    Add a @SuppressWarnings annotation to the method. A bit intelligent IDE will provide you a quickfix option for it.
    Keep in mind: it's a warning, not an error. The sessionMap is cannot be specifically parameterized and will never be, it should be able to store any object to your taste. Further on this has not much to do with JSF at itself.

  • JClient/ADF How to use JCLoginDialog to change user

    Hi,
    can anyone give me a clue how to use JCLoginDialog that is automatically generated during design time ?
    I`d like also to add there database name and sid to change also database not only user during run-time.
    thx in advance,
    Jacek

    i,
    JCLogin Dialog is a JAAS based authentication dialog that doesn't perform database authentication or connection. We are workin on a whitepaper explaining what needs to be done to write a database login screen instead
    Frank

  • How to use KAUF_AUFNR_CHANGE  to change Process order and Update a field

    Hello ,
    I am working on 4.6C system and I hve a requirement to change Process order and Update a field value passed from a ABAP Program. I am looking for suitable Function modules or Bapi ( available in 4.6c) .
    I have come across FM KAUF_AUFNR_CHANGE . Would appreciate any guidance on how to use the FM in my program and Update a field in the Process order.
    Many Thanks!

    All the importing parameters of this function module have a striaght structure of the transperent tables...
    i have checked the code and it has a modify statement based on the importing parameter..
    pick one record in databas and pass it to the importing parameters, with some values changed...
    i think that should work
    what values  to pass the import values of FM -KAUF_AUFNR_CHANGE.
    Edited by: ssm on Aug 4, 2011 7:19 PM

  • ***How to use Java to change user password in *mdw file?

    Hi,
    Is it possible to use java to change user's password in the MS Access workgroup file(*mdw)? I have been searching for this topic for a long time, but no discoveries yet. Anyone has any idea?
    Sincerely,
    nonameisname

    There is probably a windows API call that does it.
    Once you find it, you wrap it in C code and then use JNI to call it from Java.

Maybe you are looking for