Conversion of channels to different systems of measurements

How do convert from one system to another and not create false precision (http://wikipedia.org/wiki/False_precision) of the data? For example, if we look at the Yahoo Weather API (http://developer.yahoo.com/weather/documentation.html) which is used for the Yahoo Weather Binding (http://github.com/eclipse/smarthome/tree/master/extensions/binding/org.eclipse.smarthome.binding.yahooweather) reports values in US or Metric units.
For example, if you query the Yahoo weather api for Las Angeles, CA in US units (http://weather.yahooapis.com/forecastrss?w=2442047), It returned:
Temperature: 71 F
Pressure: 29.94 in
And, if you query the Yahoo weather api for Las Angeles, CA in Metric units (http://weather.yahooapis.com/forecastrss?w=2442047&u=c), it returned:
Temperature: 22 C
Pressure: 1013.6 millibar
The Smart Home Yahoo weather binding is making queries using metric units. So we'll use that as the base for conversions. To convert from C to F the formula is: C x 9/5 + 32 = F. which in the above example is:
22 x 9/5 + 32 = F
71.6 = F
And to convert from F back C the formula is (F - 32) x 5/9 = C
(71.6 - 32) x 5/9 = C
22 = C
But if we didn't keep the .6 around (like Yahoo does), we'd have the following:
(71 - 32) x 5/9 = C
21.66666666666... = C
In this case, we'd want to scale the number to something reasonable to not give the indication of false precision to downstream consumers of the channel. At some point you need to decide how many digits are significant in the result and round appropriately. The scientific community solves this problem using the Significant Figures rules (http://wikipedia.org/wiki/Significant_figures), and the arithmetic section (http://wikipedia.org/wiki/Significant_figures#Arithmetic) applies to what should be done. It has the following:
Quote:
A common guide often used when performing calculations by hand is as follows.
For multiplication and division, the result should have as many significant figures as the measured number with the smallest number of significant figures.
For addition and subtraction, the result should have as many decimal places as the measured number with the smallest number of decimal places (for example, 100.0 + 1.111 = 101.1).
In a base 10 logarithm of a normalized number, the result should be rounded to the number of significant figures in the normalized number. For example, log10(3.000×104) = log10(104) + log10(3.000) ≈ 4 + 0.47712125472, should be rounded to 4.4771.
When taking antilogarithms, the resulting number should have as many significant figures as the mantissa in the logarithm.
When performing a calculation, do not follow these guidelines for intermediate results; keep as many digits as is practical (at least 1 more than implied by the precision of the final result) until the end of calculation to avoid cumulative rounding errors.
Since the value is consumed downstream, this implies that we should keep around 1 digit of precision since the original number (71) had 0 digit of precision. This would give the scaled value of 21.7C. Now if we were to convert back from C to F:
21.7 x 9/5 + 32 = F
71.06 = F
And since this is no longer a intermediate value, and since this is not an intermediate value, the resulting value would be 71F, which matches the starting value of 71F.
BTW, the first example also followed the significant figures, but the math didn't need to be scaled due to the order of the calculation.
To take this one step further, the calculation from mbar to inHg is mbar x 0.02952998751 = inHg:
1013.6 x 0.02952998751
29.9315953401 = inHg
And scaled the value is 29.93, but in this case the multiplier is so small, you'd probably want to keep 2 digits of precision (29.932). The calculation from inHg to mbar is inHg x 33.8638815 = mbar:
29.93 x 33.8638815 = mbar
1013.54597329 = mbar
1013.54 mbar (scaled)
29.932 x 33.8638815 = mbar
1013.61370106 = mbar
1013.614 mbar (scaled)
Adding a second digit of precision in this case produce a result that was closer to the starting value, If this approach is used, there will need to be some sort of thought put into how much additional precision is needed for each calculation. In some cases one digit will be enough, but other cases might require more. This would be dependent on the multiplier or other variables used in the calculation.

Yahoo!'s weather API is obviously rounding off more precision than their underlying weather stations can provide, probably because it's easier to read fewer digits (i.e., the output is already formatted for display), and perhaps they assume the consumers of the data are not attempting to perform further calculations across sets of data that depend on all available accuracy. I'm sure the weather stations' sensors are reporting more precisely than whole Celsius degrees, for example, but the Yahoo! Weather API isn't providing it. I can imagine the Yahoo! Weather API reports current values for the purpose of easily reading current conditions.
If, on the other hand, you were the operator of your own weather station and wanted to perform calculations across sets of historical measurements from your sensors, you would most likely want to store exactly as much precision as the equipment provided. The unit system used to present the data would only be relevant at the time the data was presented for display, and would not be a justification to erode the accuracy of the reported values by rounding during unit conversion. In other words, rounding is a good way to present final values so they are easy to read, but is a bad idea if you are going to store values that may be used in further calculations where you want to preserve as much accuracy as was available when the samples were first collected.
openHAB lets users format decimal values so they are easy to read using format strings like %.1f, so there can be no confusion about false precision.
...adding:
I know there has been work in OH2 to handle the unit systems used for item states, so ideally binding authors could be freed from having to convert unit systems, and unit conversions could potentially be performed in the presentation layer without bindings having to worry about it. So whatever units were reported to the binding could be passed along without conversion.

Similar Messages

  • How can I read channels from different SCXI modules simultaneu​sly?

    Hello.
    I have a system that consists in:
    - Three E-series DAQ boards (PCI-6034, PCI-6052 & PCI-MIO-16E)
    - One SCXI chassis (SCXI 1001)
    - 4 SCXI modules for voltage measurement connected to PCI MIO 16E
    - One SCXI module for strain gauges connected to PCI 6034
    - One SCXI module for accelerometers connected to PCI 6052
    I have to develop a software application that reads all the channels at the same time or at least in the same program cycle. I have tried to create only one DAQmx task containing all the channels, although they belong to different DAQ boards (and SCXI modules, of course), but it seems to be impossible to use channels from different devices in the same task.
    So I have created three different DAQmx tasks, one for each device and its channels. I have used one "DAQmx Start Task" VI for each task at the beggining of the loop in order to use them independently, reading their channels inside the loop in every program cycle.
    When I have run the program I have get the following error:
    "ERROR -200619 ocurred at DAQmx Start Task.vi
    Chassis cannot be used for more than one scanning operation at the same time.
    Do only one scanning operation or combine multiple scanning operations into a single operation."
    What is the problem? How can I combine these multiple scanning operations? What can I do to read all channels at the same time?
    Thanks.

    Hello pablomendana,
    it's ok that you got an error when trying to use more than one device on the same task. According to the setup you have, I agree that 3 tasks should be put in place.
    The key question I have is... Have you configured manually at MAX the SG and accel. modules to be in Parallel mode?
    I would not expect the error you get if they are in parallel mode (in which you could even read directly from the DAQ board, using DAQ device channels instead of SCXI channels).
    Unfortunately, I haven't been able to setup a system similar to yours, but I would like to know more details on what you've tried so far.
    Also, I recommend you that if still need help on setting up the system, use NI's SSP program to get support from your local NI Application Engineering organization, as this will be faster than the forum.
    Regards,
    Jorge M.

  • About virtual channel in different device and/or different type channel

    Hi all,
      I am looking for a way to write to several analog channels at the same time. In my code, I didnt' pay much attention to that, I just have them placed in the the same frame in the flat sequence such that they might be started to write simultaneously. However, sometimes they might not working perfectly. I am reading something on DAQmx and I found that there is something call virtual channel so I have put more than 1 channel into a unit (called virtual cahnnel), so I can write something to it at the same time. Here are my question
    1) what's the different between virtual channel and channel group? If I write a array of 3 elements to a channel group (consists of dev1/ao1, dev1/ao2 and dev1/ao5),  am I writing to channel group or virtual channel?
    2) can I bind different channels from different devices to form a virtual channel, e.g. dev0/ao0 dev1/ao0 dev2/ao0?
    3) can I bind different type of channel to form a virtual channel, e.g. dev0/ao0, dev0/port0/line0?
    4) last question is about synchronization on writing to a virtual channel (or channel group?) Last say I have a pulse train each pulse is separated in time by 1.2ms and total time is 122.4ms. The pulse train will be sent to dev0/ao3, and at 12ms after start send very first pulse of the train, I need to write two analog signal to dev1/ao1 and dev1/ao5. In my current code, create a flat sequence, start the task for sending the train in the first frame, put delay in second frame and delay for 12ms, write dev1/ao1 and dev1/ao5 in the third frame. For some times, this gives me acceptable timing but not always. I wonder how does it help to use virtual channel?
    In the similar situtation, what about if instead of writing to two analog channel, I write to one analog channel and one digital channel?
    Thanks.

    1) virtual channel is created per task and contains a collection of settings such as a name, a physical channel, input terminal connections, the type of measurement or generation, and can include scaling information.. A virtual group is specific to digital IO and has to deal with the way you read/write data off/to the port
    2) yes you can create a task with physical channels from multiple devices assuming they are comparable writes (ie all analog or all analog read, or all digital) but they will have the same channel characteristics (see answer above)
    3) no you cannot create a task that handle an AO and a DO from with in the same task
    4) if you created a task you are using a virtual channel. The only way to ensure timing is to use hardware timing (ie onboard sample clock of you DAQ card) otherwise the reads/writes are basically interrupts and you are at the mercy of the OS to service the interrupt request
    if you need more information please repost with more questions, include your DAQ hardware, and any code pictures to give us a better idea of what you are trying to accomplish and how you are going about it
    Applications/Systems/Test
    National Instruments | AWR Group

  • Different unit of measurement

    Hi
    For the material a85.52.02.1121, when I see material document list(MB51),material movement showing different UOM( M & FT).
    For material movement 261 it is showing 2- (qty) FT
    movement 262 it is showing 2(qty) FT,
    But for movement type 561 it is showing 2 (qty) M.
    But we maintained in the material master,UOM & alternative unit of measure as 'M' only.
    my question is
    From where this FT unit of measurement is coming?
    Any tips to solve this problem?
    With Regards,
    Jaheer(abaper + MM consultant)

    Hi,
    Check the Unit of issue at plant data storage location 1 of the MMR, I suppose its with FT,
    Other wise too as both M and FT are standard UOM's,with a standard conversion, you can enter a different unit of measurement apart from the base unit maintained in the MMR during the transaction (261/262), which will get automatically updated in the inventory.
    Trust this clears your query
    Regards
    Merwyn

  • Different unit of measurements work independently

    Hi SAP MM Experts
    Is there any possibility to work with 2 different unit of measurement at a time in sap which need to be independent from each others mean no relation b/w 2 uom.
    My client is a steel manufacturer. When a bar (steel rod) received from vendor, they want to  enter in system with uom as KG  and bundle and same thing will be control in all possible good movement. even in sell, they want to control with 2 unit on measurement. pls guide me. thanks

    You can maintain two uom for material, You can purchase this material with two uom. But material can only stored in warehouse with base unit of measure. You can also sale the material with two unit.
    For using different uom in purchasing have a look into the docu Create Info Record for different Order Unit

  • VB6 NI-USB-9237 DAQmxCreateAIVoltageChan selected physical channel does not support the measurement type required

    I have a VB6 program with code that properly reads analog inputs from an NI-USB-6008.
    I tried to re-use the code for a strain-gage module NI-USB-9237, but at the DAQmxCreateAIVoltageChan step I get the following error:
    "Measurements: Selected physical channel does not support the measurement type required by the virtual channel you are creating.
    Create a channel of a measurement type that is supported by the physical channel, or select a physical channel that supports the measurement type."
    Should I be calling a function other than DAQmxCreateAIVoltageChan?
    If so, what is it, or where can I find the reference for such functions?
    Or - if that is the right function, should I pass different arguments?  Currently I'm calling:
    DAQmxErrChk DAQmxCreateAIVoltageChan(taskHandle, "Dev1/ai1", "", DAQmx_Val_Cfg_Default, -10, 10, DAQmx_Val_VoltageUnits1_Volts, "")
    Thanks in advance for your help
    -Chris Hardy
    Solved!
    Go to Solution.

    I figured it out from 372251a.PDF
    First, the correct function is DAQmxCreateAIVoltageChanWithExcit
    Second, you can't just ask for one sample on one channel - ask for 2 samples instead.
    -Chris Hardy

  • Report which reads data from two different systems

    Hi experts!
    By any chance, would be possible to create a report which is able to read from two different cubes and two different systems at the same time?
    Kind regards.

    Good afternoon Raul,
    It should be possible to create a multiprovider on the two different cubes from the two sources
    systems and report on this.
    Best Regards,
    Des

  • How to use BPM itegrate different system aysnchronously

    for example, 3 enterprise applications need to be integrated together with BPM, which are Bid system, ERP system, Finance system,
    and erery business document should be approved  by persons one by one in the 3 different application system with its workflow respectively, we can't change the workflow in the
    different system, and only when the document is finished approved in the BID system asynchronously, it can enter the ERP system, an so on .
    after the business document is approved in the Bid system, it should be returned in the BPM contexts,and the BPM user will dicide whether it will be enter the next system.
    so how to integrate the 3 application system?
    I draw a[ BPM process|http://www3.picturepush.com/photo/a/2586651/640/Picture-Box/aaa.jpg], but in this process,  the "ERP human activity" activity, this activity how to get data from the "BID system asyn workflow" which is an asynchronized
    wrokflow?

    Gavin,
    For asynchronous cases, you should adopt the "wait and trigger" principle.  In BPM, you can acheive it by using a timer and an automated activity. Set the timer repeat time to say 15 mins (you should change it as per your business scenario), and then execute / trigger an automated activity, which will call your Bid system to check the state (whether the data entry / specific workflow is over). If the state is completed, (you may check using exclusive choice), move to next step. Else, pass back the control to timer which will again make the process wait. This way the objective could be attained.
    Hope this helps.
    Br,
    Bala

  • Different System Alias in one iView

    Hi all,
    I have an ESS/MSS Szenario based on EP7 SP13 and HCM (ECC 6). I have setup the business package and all is working fine. I have setup the different System Aliases like SAP_R3_HumanResources and SAP_R3_HumanResources_Meta etc. and I have a working Single Sign On between my Portal and the HCM system.
    I now face the challenge to change one link within the working time iView to point to a different system than all the others!
    Let me explain: I have a second ERP 6 system that provides for the actual working time Web Dynpro and this Dynpro is not provided by the HCM system. I think I need to change the target for this one Dynpro to point to the ERP instead of the HCM system while all the other links in the working time iView still have to point to the HCM system!
    I have no idea whatsoever, how to do this. I checked the PCD but I can't seem to find the right place where to adapt the System Alias for an iView at all. Can someone point me in the right direction?
    Kind regards,
       Christian

    No you're not
    In fact you lack the System and System alias that point to you're new ERP 6.
    Here a link with a demo that explain how to create the system and define its alias : [demo|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/24d8faf9-0701-0010-c99c-aabbdb7e95f4] .
    Informations needed are the same you can find in a saplogon for the system you want to connect to.
    Once you'll have defined system and alias you'll see it in you're listbox!
    Anyway you'll still face the last problem : you can't define multiple system alias for the same iView.
    Hope that helps!!
    Edited by: Seb on Jan 9, 2008 4:34 PM

  • How to Configure a oracle R12 with RAC on two different  system .

    I have one laptop and one desktop
    Laptop----
    on laptop I have install vmware 8
    Host OS --win7
    Guest OS---linux 4
    Desktop ---
    On Desktop I have install Vmware 8
    Hosts OS --- Win XP
    Guest OS ---Linux 4
    Plz suggest How configure oracle R12 with RAC using both system .

    Hussein Sawwan wrote:
    on laptop I have install vmware 8
    Host OS --win7
    Guest OS---linux 4
    Desktop ---
    On Desktop I have install Vmware 8
    Hosts OS --- Win XP
    Guest OS ---Linux 4
    Plz suggest How configure oracle R12 with RAC using both system .If you want to configure RAC, then you must have the same OS installed on all RAC nodes -- See (RAC: Frequently Asked Questions [ID 220970.1], Does Oracle Clusterware or Oracle Real Application Clusters support heterogeneous platforms?) for details.
    Once you have the same OS, please refer to:
    Oracle E-Business Suite Release 12 High Availability Documentation Roadmap [ID 1072636.1]
    Using Oracle 10g Release 2 Real Application Clusters and Automatic Storage Management with Oracle E-Business Suite Release 12 [ID 388577.1]
    Using Oracle 11g Release 2 Real Application Clusters with Oracle E-Business Suite Release 12 [ID 823587.1]
    Thanks,
    HusseinHi Hussein,
    For Rac I am using both same OS (linux 4) for both nodes .
    Plz suggest its possible to install two nodes on different machine(diiferent virtual machine on different system ) .Can communicate both machine without any problem if its possible plz provide links.

  • How to split a single file and then route it to different systems

    Hi All,
    I have a requirement like...my incoming file(single file) needs to be split into 3 files based on a field "company code".and then route it into different systems.
    my incoming file is like this .....
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    EOF.
    I need to split this file and my ouput file should be like this
    For 1st system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(100),....,.....,......
    EOF.
    For 2nd system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(101),....,.....,......
    EOF.
    For 3rd system
    Header,name,.....,.....,........,.....,.....
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    Detail,.....,.....,.....,.....,......,companycode(102),....,.....,......
    EOF.
    and then send it three systems based on company code.
    Can anyone tell me how this can be achieved?
    Thanks,
    Hemanth.

    Hi Nallam,
    I tried the same thing but in the input file as there are different company codes,It is not splitting the file into three parts and sending only concerned data to repective system instead the whole file is going to the all the systems.
    I came to know that the file has to splitted in the mapping only, we are able to do it by using mapping but the problem is in Routing,as in receiver determination we makes use of source structure for giving the condition. Can you please help me on this.
    Thanks,
    Hemanth.

  • How One EP Portal will connect the 2 Different System(ECC Europe,China)

    Hi Friends,
    I have one more doubt on Multi region Functionality. Here we are using single EP Portal. Depending up on user we are able to connect to the ECC System.
    Ex: Here we are using 2 ECC Systems( ECC Europe and ECC China). In Portal ECC Europe is login into the Portal he will be able to connect ECC Europe System through ECC Europe Model data and Meta Data like as ECC China user Login into the Portal he will be able to connect ECC China System through ECC China System Model data and Meta Data.
    How can I do this work. Can you tell me. What type of coding I can write here. Please give Help.
    Regards
    VijayK

    Hi Vijay,
    Not just multiple Systems/JCos needed, you also need multiple souce objects to connect to multiple Systems/JCos.
    In your case you need multiple iView (applications), and configure them to connect to different back-end systems.
    You got to modify the Application Parameter of WD iView objects saperately to talk to different systems.
    Reason, you cannot make one application to use multiple JCo destinations at any point of time.
    Thanks,
    MS

  • RFC call to a different system returns data from local system,

    Hi:
    I defined a RFC function and execute against a different system, the data returned is from the local system. The rfc_destination in SM59 works fine. The function works fine in the target system. No errors appear, just the data is not from the remote system.
    Any input will be appreciated.
    Thanks.
    Kamaraj

    Hi,
    For now, it seems u haven't specified the destination properly. the call function statement must be suffixed with the 'destination' addition to make sure that the function call is an RFC and the particular function be executed at the desired destination.

  • Direct Conversion of smartform into PDF system has to take spool request ?

    does anybody know:
    Direct Conversion of smartform into PDF, system has to take spool request dynamically..
    i don't mean to use the SE38 calling PRG RSTXPDFT4 to transfer SAP sript into PDF.
    thanks
    SRIDHAR

    --strike Yes this is what I understood.
    In the structure job_output_info of your function you'll find your OTF data :
    st_ssfcrescl-otfdata --
      CALL FUNCTION smartform_fonction_name
            EXPORTING
    *     ARCHIVE_INDEX              =
    *     ARCHIVE_INDEX_TAB          =
    *     ARCHIVE_PARAMETERS         =
          control_parameters         = st_ssfctrlop
    *     MAIL_APPL_OBJ              =
    *     MAIL_RECIPIENT             =
    *     MAIL_SENDER                =
          output_options             = st_ssfcompop
          user_settings              = ' '
        IMPORTING
         document_output_info        = st_ssfcrespd
         job_output_info             = st_ssfcrescl " This is the one which contains OTF data
         job_output_options          = st_ssfcresop
        TABLES
       EXCEPTIONS
         formatting_error           = 1
         internal_error             = 2
         send_error                 = 3
         user_canceled              = 4
         OTHERS                     = 5.
    -- Then you just have to convert, using something like that : --
    * Convert OTF to PDF
      LOOP AT otf_data INTO w_otf.
        CONCATENATE w_otf-tdprintcom w_otf-tdprintpar
        INTO w_pdf.
        APPEND w_pdf TO i_content_txt.
      ENDLOOP.
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'
        EXPORTING
          format_src      = 'OTF'
          format_dst      = 'PDF'
        CHANGING
          transfer_bin    = w_transfer_bin
          content_txt     = i_content_txt
          content_bin     = i_content_bin
          objhead         = i_objhead
          len             = v_len_in
        EXCEPTIONS
          err_conv_failed = 1
          OTHERS          = 2.
      v_size = v_len_in.
      pdf_itab_size = v_size.
      it_pdfout[] = it_pdf[].
    * Create the PDF File
      CLEAR it_pdfdata.
      REFRESH it_pdfdata.
    *  it_pdfdata[] = it_pdfout[].
      LOOP AT it_pdfout.
        MOVE it_pdfout-tline TO it_pdfdata-line.
        APPEND it_pdfdata.
        CLEAR it_pdfdata.
      ENDLOOP.
    -- The smartform creation and the PDF creation are done in the same time...--
    OK, So what do'nt you want to use the RSTXPDFT4 program ?
    Hope this helps,
    Erwan
    Edited by: Erwan LE BRUN on Aug 28, 2008 12:02 PM
    Edited by: Erwan LE BRUN on Aug 28, 2008 12:03 PM

  • Which is better Different Distribution channel or different sales order typ

    Hi
    My requirement can be met with three config options. Kindly go through these options and suggest which one is best and why
    1. Keeping one distribution channel and different sales order types.
    2. Configuring different distribution channel but single sales order type.
    3. Configuring different distribution channel and different sales order types.
    Kindly suggest
    Regards
    Gaurav Jain

    Hi there,
    Without telling what the requirement is how can we suggest you something?
    All the below options are possible in SD. Depends on the scenario to choose which is the best 1.
    Regards,
    Sivanand

Maybe you are looking for

  • Unable to change apple ID location

    I was trying to make a purchase recently, but a message telling me I needed to update my billing info came up. For some reason, my country is listed as China (I live in Canada, I've never even been to China). I tried changing my country back, but I a

  • Calendar with Windows XP

    I read on the Apple site that the iphone will only sync with Outlook 2003 and 2007. For some reason, a Dell laptop we purchased last year has only Outlook 2002 on it. Does anyone know if it will work with 2002, or if there is another option short of

  • Missing Dependency while installing validated rpm

    I installed the Oracle Linux 5.5 with the base package and software development option. Then I downloaded the validated rpm oracle-validated-1.0.0.-22.el5.i386.rpm root] yum install ./oracle-validated-1.0.0-22.el5.i386.rpm Missing Dependency: unixODB

  • JDeveloper 11.1.1.2.0 does not recognize some CVS files

    Hi, We have been using JDev 11.1.1.1.0 with no problems. We installed 11.1.1.2.0 into a SEPARATE directory (and did NOT migrate settings). We configured 11.1.1.2.0 as we had for 11.1.1.1.0. All our applications use CVS for source control - we normall

  • E-mail forwarding

    I have a blackberry 8520. How do I forward an e-mail message to more than 1 recipient. At times, I may want to forward to possibly 10 people. Can anyone help? cannot find an answer in the user manuals or the help screen. Thank You