Conversion from scaled ton unscaled data using Graph Acquired Binary Data

Hello !
I want to acquire temperature with a pyrometer using a PCI 6220 (analog input (0-5V)). I'd like to use the VI
Cont Acq&Graph Voltage-To File(Binary) to write the data into a file and the VI Graph Acquired Binary Data to read it and analyze it. But in this VI, I didn't understand well the functionnement of "Convert unscaled to scaled data", I know it takes informations in the header to scale the data but how ?
My card will give me back a voltage, but how can I transform it into temperature ? Can I configure this somewhere, and then the "Convert unscaled to scaled data" will do it, or should I do this myself with a formula ?
Thanks.

Nanie, I've used these example extensively and I think I can help. Incidently, there is actually a bug in the examples, but I will start a new thread to discuss this (I haven't written the post yet, but it will be under "Bug in Graph Acquired Binary Data.vi:create header.vi Example" when I do get around to posting it). Anyway, to address your questions about the scaling. I've included an image of the block diagram of Convert Unscaled to Scaled.vi for reference.
To start, the PCI-6220 has a 16bit resolution. That means that the range (±10V for example) is broken down into 2^16 (65536) steps, or steps of ~0.3mV (20V/65536) in this example. When the data is acquired, it is read as the number of steps (an integer) and that is how you are saving it. In general it takes less space to store integers than real numbers. In this case you are storing the results in I16's (2 bytes/value) instead of SGL's or DBL's (4 or 8 bytes/value respectively).
To convert the integer to a scaled value (either volts, or some other engineering unit) you need to scale it. In the situation where you have a linear transfer function (scaled = offset + multiplier * unscaled) which is a 1st order polynomial it's pretty straight forward. The Convert Unscaled to Scaled.vi handles the more general case of scaling by an nth order polynomial (a0*x^0+a1*x^1+a2*x^2+...+an*x^n). A linear transfer function has two coefficients: a0 is the offset, and a1 is the multiplier, the rest of the a's are zero.
When you use the Cont Acq&Graph Voltage-To File(Binary).vi to save your data, a header is created which contains the scaling coefficients stored in an array. When you read the file with Graph Acquired Binary Data.vi those scaling coefficients are read in and converted to a two dimensional array called Header Information that looks like this:
ch0 sample rate, ch0 a0, ch0 a1, ch0 a2,..., ch0 an
ch1 sample rate, ch1 a0, ch1 a1, ch1 a2,..., ch1 an
ch2 sample rate, ch2 a0, ch2 a1, ch2 a2,..., ch2 an
The array then gets transposed before continuing.
This transposed array, and the unscaled data are passed into Convert Unscaled to Scaled.vi. I am probably just now getting to your question, but hopefully the background makes the rest of this simple. The Header Information array gets split up with the sample rates (the first row in the transposed array), the offsets (the second row), and all the rest of the gains entering the for loops separately. The sample rate sets the dt for the channel, the offset is used to intialize the scaled data array, and the gains are used to multiply the unscaled data. With a linear transfer function, there will only by one gain for each channel. The clever part of this design is that nothing has to be changed to handle non-linear polynomial transfer functions.
I normally just convert everything to volts and then manually scale from there if I want to convert to engineering units. I suspect that if you use the express vi's (or configure the task using Create DAQmx Task in the Data Neighborhood of MAX) to configure a channel for temperature measurement, the required scaling coefficients will be incorporated into the Header Information array automatically when the data is saved and you won't have to do anything manually other than selecting the appropriate task when configuring your acquisition.
Hope this answers your questions.
ChrisMessage Edited by C. Minnella on 04-15-2005 02:42 PM
Attachments:
Convert Unscaled to Scaled.jpg ‏81 KB

Similar Messages

  • Fix for "Graph Acquired Binary Data.vi" in daqmx 7.4's "Measure Voltage.llb". (factory gains are reversed)

    While perusing binary data collected from the SCXI 1102 and usb 1600, the gains were found
    to be reversed using daqmx writer/reader example code from NI. This bug only surfaces if your using different gains amongst the channels.
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F7199E619CBF4215E0340003BA230ECF&p_node=201208&p_submitted=Y&p_rank=5&p_answer=yes
    has the fix for the binary to floating point viewer vi, "Graph Acquired Binary Data.vi".
    Enjoy.
    Best,
    Davy Baker
    GAMI

    duplicate post
    Continue in other thread
    Message Edited by smercurio_fc on 11-14-2008 09:10 AM

  • How can I print a text message conversation from my iPhone? Not using screenshots.

    How can I print a text message conversation from my iPhone? Not using screenshots. It's around 500 messages so screenshots is not a option.

    Yes, you can delete from iphone:
    http://manuals.info.apple.com/enUS/iPhone_iOS4_UserGuide.pdf
    It is covered in the manual.
    Page 172:
    "Delete a podcast: In the Podcasts list in iPod, swipe left or right over the podcast, then
    tap Delete. "

  • I was just copying my data from stand by phone by using phone to phone data transfer but phone also locked with i cloud login of stand by phone what to do

    i was just copying my data from stand by phone by using phone to phone data transfer but phone also locked with i cloud login of stand by phone what to do

    If it's a hardware problem, then the phone will need to be replaced.
    There is no magic that can fix a hardware problem.

  • DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file

    Hi
    DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file
    Two main
    sections:
    1)     
    Perform
    write and read operations to and fro different spread sheet files, such that
    each file have a single row of 32bits different binary data (analogous to 1D
    array) where the left most bit is the MSB. I don’t want to manually enter the
    32 bits binary data, I want the data written or read just by opening a file
    name saves with the intended data.
          2)     
    And
    by using test patterns implemented using the digital pattern generator or  build digital data functions or otherwise, I need to
    ensure that the     
                binary data written to a spreadsheet file or any supported file type
    then through the NI-USB 6509 is same as the data read.
    I’m aware I can’t use the simulated
    device to read data written to any port but if the write part of the vi works I
    ‘m sure the read part will work on the physical device which I’ll buy later.
    My Plan
    of action
    I’ve
    created a basic write/read file task and a write/read DAQ task for NI USB 6509
    and both combine in a while loop to form a progress VI which I’m confuse of how
    to proceed with the implementation.
    My
    greatest problem is to link both together with the correct functions or operators
    such that there are no syntax/execution errors and thus achieve my intended
    result.
    This
    project is one of my many assignments for my master thesis, so please i’ll
    appreciate every help as I’m not really efficient with LabVIEW programming but
    I prefer it because is fun and interesting if I get to know it.
    Currently I’m
    practicing with LabVIEW 8.6/NI DAQmx 8.8 Demo versions and NI USB 6509
    simulated device.
    Please see
    the attached file for my novice progress, thanks in
    advance for the support
    Rgds
    Paul
    Attachments:
    DIO_write_read DAQ from file.vi ‏17 KB

    What does your file look like?  The DAQmx write is expecting a single U32 value, not an array of I64. 
    Message Edited by vt92 on 09-16-2009 02:42 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • What to use to store binary data in Java

    Hello,
    I have to read data stored as varbinary in the SQL database. What kind of class, data type I can use to store binary data from database?
    I need to store binary data finally in ByteBuffer.
    Please, help.
    Thank you!

    Unfortunately, when I am doing following I am getting an exception:
    ByteBuffer lUTF8BIN=ByteBuffer.allocate(6)
    byte [] lTempByteArray lTempByteArray = Recordset.getBytes(VarBinColumn);
    if (lUTF8BIN.remaining()>=lTempByteArray.length)
    lUTF8BIN.put(lTempByteArray);
    Exception is java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported data conversion

  • Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date?

    Can anyone confirm the date used for pushing the data into AR interface table? Is it abse don Actual ship date or scheduled ship date? We are facing a scenario where trx date is lower than the actual ship to which logically sounds incorrect.
    Appreciate any quick response around this.

    Hi,
    Transaction date  will be your autoinvoice master program submission level date (If you haven't setup any logic.
    Please check the program level default date, if user enter old date ststem will pick the same.
    Customer is trying to set the value of the profile OM:Set receivables transaction date as current date for non-shippable lines at the responsiblity level. System does not set the transaction date to current date in ra_interface_lines_all.
    CAUSE
    Customer has used the functionality in R11i. But after the upgrade to R12, the system functions differently than R11i.
    SOLUTION
    1.Ensure that there are no scheduled workflow background process run.
    2.Set the profile "OM: Set Receivables Transaction Date as Current Date for Non-Shippable Lines"  at Responsibility level only as Yes.
    3.Now switch the responsibility to which the profile is set.
    4.Create order for Non-Shippable Lines and progress it to invoicing.
    5.Ensure that the 'workflow background process' concurrent program is run in the same responsibility and this line is considered in it.
    6.Now check if the 'SHIP_DATE_ACTUAL' is populated to ra_interface_lines_all

  • SUDDEN SPIKE IN DATA USE?  ACCURACY OF DATA OVERAGE ALERTS?

    Our data usage over the past 6 months averaged 2.25 GB  Top usage during that period was 2.99 GB in May
    Since I had been paying for 6 GB and never using it, I switched to 4 GB in May and signed up for Data Usage Overage Alerts.
    Then...all "heck" seemed to break loose???
    May 23 Received data alert via text: Have Used 75% of 3 GB--Added 1 GB
    May 27 Received data alert via text: Have Used 90% of 4 GB
    May 29 Received data alert via text: Have Used 100% of 4 GB-Added 2 GB
    June 1  Received data alert via text: Have Used 75% of 6 GB
    June 7  Received data alert via text: Have Used 90% of 6 GB
    OUR BILLING CYCLE ENDED JUNE 9
    June 11 Received data alert via text: Have Used 100% of 6 GB (???)
    Stunned that between the May 10 - June 9 billing cycle my reported data usage suddenly went over 6 GB for the first time ever, and not doing anything differently at all, I called Verizon Customer Service...
    The rep asked if I had been doing something differently with my phone (apps, photos, etc)
    I replied that my usage had not changed in any way...
    To which she responded that she was unable to track where/why my data use was suddenly so high...???  She had "No way of knowing"
    NEED HELP FROM VERIZON AND/OR COMMUNITY: 
    1.     ARE VERIZON DATA ALERTS UNRELIABLE?
    2.     HOW/WHY WOULD DATA USAGE INCREASE SO DRAMATICALLY WITH NO WAY FOR CUSTOMER TO CHECK/VERIFY?
    MANY THANKS...

    Like radar guns used by local police departments, I firmly believe that without some sort of independent oversight like cable companies use to check the meters Verizon wireless can tell you anything and you the consumer gets hit with high data use.
    My best solution for you is to reset the data counter on the phone starting with the first day of your billing cycle. Then check your online data used and see if they match.
    I also recommend you contact the FCC or even keep taking them to small claims or a superior court to have them produce records of data meter accuracy. At present no known outside concern can monitor what Verizon is claiming you are using.
    Get a good lawyer and take them to court.
    Good Luck

  • Need Help Improving Memory Use of a Binary Data Insert

    I am using the following code to insert binary data from an InputStream into a database.
    It seems to be very memory inefficient. It works fine for small files. But for large files it really causes memory issues.
    Imagine this coming from a 22mb file upload. This method first copies 22megs of data to an ArrayList. It then copies the data to an array. It then creates another array to store the bytes. Finally it inserts the data to the database.
    Is there another way I can get data into a format that the setBytes() method can accept without using so much memory?
            * Inserts Binary Database into the Database
           private void insertData(InputStream stream){
             ConnectionPool pool = (ConnectionPool)properties.getProperty("zeusportal.connectionpool");
             Connection conn = null;
             BufferedReader in = new BufferedReader(new InputStreamReader(stream));
             try{
               byte[] byteArray;
               int streamlength = 0;
               int value;
                  //Read Data Into Arraylist
               ArrayList list = new ArrayList();
               while((value = stream.read()) != -1){
                 list.add(new Integer(value));
               Object data[] = list.toArray();
                  //Create Byte Array to store bytes
               byteArray = new byte[data.length];
                  //Copy Data from ArrayList into Byte Array
               for(int iCounter = 0; iCounter < byteArray.length; ++iCounter){
                 Integer curr = (Integer)data[iCounter];
                 byteArray[iCounter] = curr.byteValue();
                  //Retrieve Connection
               conn = pool.getConnection();
               conn.setAutoCommit(false);
               PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table (video_name, video_description, video_contenttype, video_content, upload_date, objecttype, objectid) values(?, ?, ?, ?, ?, ?, ?)");
                  //Insert Data Attributes into PreparedStatement
               pstmt.setString(1, this.name);
               pstmt.setString(2, this.description);
               pstmt.setString(3, this.contenttype);
               pstmt.setBytes(4, byteArray);
               pstmt.setInt(6, objectType);
               pstmt.setLong(7, objectID);
               this.date = new java.util.Date();
               pstmt.setLong(5, date.getTime() / 1000L);
               pstmt.execute();
               pstmt.close();
               conn.commit();
               conn.setAutoCommit(true);
             catch(SQLException sqle){
               throw new RuntimeException(sqle);
             catch(IOException ioe){
               throw new RuntimeException(ioe);
             finally{
               if(conn != null){
                 pool.releaseConnection(conn);
             return;
           }//insertData

    I have tried storing the data in a temp file and then retrieved the length of the file. That however didn't work as the data was corrupted for anything but the smallest files.
            * Inserts the data into the database
           private void insertData(InputStream stream){
             ConnectionPool pool = (ConnectionPool)properties.getProperty("zeusportal.connectionpool");
             Connection conn = null;
             BufferedInputStream in = new BufferedInputStream(stream);
             try{
                      //Create Temporary File to Store Binary Data
                File file = File.createTempFile(Math.random()+"", ".tmp");
                      //Create a writer to write to the Temp File
                OutputStream writer = new FileOutputStream(file);
                      writer = new BufferedOutputStream(writer);
               int value;
                  //Copy Data to Temp File
               while((value = in.read()) != -1){
                 writer.write(value);
               writer.flush();
               writer.close();
                  //Read new InputStream from Temp File
               stream = new FileInputStream(file);
               //Retrieve Connection
               conn = pool.getConnection();
               conn.setAutoCommit(false);
                  //Inset Data to the database
               PreparedStatement pstmt = conn.prepareStatement("INSERT INTO zeusportalvideos (video_name, video_description, video_contenttype, video_content, upload_date, objecttype, objectid) values(?, ?, ?, ?, ?, ?, ?)");
               pstmt.setString(1, this.name);
               pstmt.setString(2, this.description);
               pstmt.setString(3, this.contenttype);
               pstmt.setBinaryStream(4, stream, (int) file.length());
               pstmt.setInt(6, objectType);
               pstmt.setLong(7, objectID);
               this.date = new java.util.Date();
               pstmt.setLong(5, date.getTime() / 1000L);
               pstmt.execute();
               pstmt.close();
               stream.close();
               file.delete();
               conn.commit();
               conn.setAutoCommit(true);
             catch(SQLException sqle){
               throw new RuntimeException(sqle);
            catch(IOException ioe){
               throw new RuntimeException(ioe);
             finally{
               if(conn != null){
                 pool.releaseConnection(conn);
             return;
           }//insertData

  • Use "RFSA Acquire IQ Data in Blocks" VI

    I wan to run the example "RFSA Acquire IQ Data in Blocks" VI.  It asks for the resource name.
    I have a ni5660 = ni5600 + ni5620.  So in MAX ni5600 has an name and can be seen under NI-DAQmx Devices.  But i cant see ni5620 in that section.  I see it under Traditional NI-DAQ (Legacy) Devices and hence I cant give it a name.
    Also ni5600 in NI-DAQmx Devices has no Digitizer associated with it.
    I went through this link and it was not of much help.  http://digital.ni.com/public.nsf/allkb/ABBB55946EB39A02862571FD0052024C
    I am attaching the example and the screen shots on MAX.
    Attachments:
    RFSA Acquire IQ Data in Blocks.vi ‏45 KB
    max.JPG ‏105 KB

    Hello Om,
    The RFSA Acquire IQ Data in Blocks VI uses the RFSA driver not the 5660 driver.  The RFSA VIs require the 5661 = 5600 and 5142.  Both of these devices are DAQmx devices.  However the 5660 = 5600 and 5620, where the 5620 is only a Traditional DAQ device.  You only have to associate a digitizer with the 5600 if you use it with the 5142 and the RFSG driver.  The behavior you are seeing is expected.
    All of the examples you can run will start with ni5660 and perhaps the ni5660 Fetch IQ Data will work for you.
    Regards,
    Jesse O.
    Applications Engineering
    National Instruments
    Jesse O. | National Instruments R&D

  • Getting error while uploading gl master data using LSMW batch input data

    Hi Experts,
    I am getting error while uploading the GL master data through lsmw using batch input recording.
    After completion of all steps at the time of running batch input session error i am getting is "maintain EN language discription"
    and Pls tell me is it possible to upload transactional data using lsmw? if yes pls explaing briefly.

    Hello,
    Kindly post in the FI forum to get a better response.
    Regarding the issue you might check whether the correct column is being picked up where you have maintained the description.
    Kind Regards // Shaubhik

  • Data plug-in for binary data with byte streams of variable length

    Hi there,
    I would like to write a data plug-in to read binary data from file and I'm using DIAdem 10.1.
    Each data set in my file consists of binary data with a fixed structure (readable by using direct access channels) and of a byte stream of variable length. The variable length of each byte stream is coded in the fixed data part.
    Can anyone tell me how my data plug-in must look like to read such kind of data files?
    Many thanks in advance!
    Kind regards,
    Stefan

    Hi Brad,
    thank you for the very quick response!
    I forgot to mention, that the data in the byte stream can actually be ignored, it is no data to be evaluated in DIAdem (it is picture data and the picture size varies from data set to data set).
    So basically, of each data set I would like to read the fixed-structure data (which is the first part of the data set) and discard the variable byte stream (last part of the data set).
    Here is a logical (example) layout of my binary data file:
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXX (byte stream)
    | fixedSize-Value1 | fixedSize-Value2 | fixedSize-Value3 (=length of byte stream) | XXXXXXXXXXXXXXXXXXXX (byte stream)
    What I would like to show in DIAdem is only fixedSize-Value1 and fixedSize-Value2.
    ´
    If I understood right, would it be possible to set the BlockLength of each data set by assigning Block.BlockLength = fixedSize-Value3 and to use Direct Access Channels for reading fixedSize-Value1 and fixedSize-Value2 ?
    Thank you!
    Kind regards,
    Stefan

  • How do I remove an older itunes password from my iphone and begin using my up to date one?

    I have rebooted phone...took out old itunes from computer downloaded new one, got new user ID (apple)and when I click update on my iphone itunes, it still is showing the old apple ID username?

    Settings/Store

  • How to Extract data using Query or any data fucntion in Excel.

    Dear Users,
     i want to ask one question about excel..............
    i have a parts list sheet, it contains part-number , price, name........ in columns. now my question is this that for example  part names are as under ,
    fix contactor
    moveable contactor
    half contactor
    contactor gm
    contactor skf
    as you saw in the names of parts contactor is the same in all the column. i want such a query that extract all the entries which contain contactor and make a new column or highlight them in the same column. my requirement is very similar to dos command when
    i want to see the list of all files which have exe extension ...dir *.exe.
    Best Regards
    Tahir Mehmood

    =IFERROR(IF(FIND( "contactor" ,LOWER(A1))>0,TRUE,FALSE), FALSE)
    This formula checks cell A1 and will flag TRUE if it matches the requirements of the specified text.  Have wrapped a lower function around the cell to mitigate for different upper or lower case mismatches.
    Alternativey you can use conditional formatting > "Use a formula to determine which cells to format" and use the following formula  =FIND("contactor", LOWER(A1)) >0.  Change the format to colour in the cell and copy the
    format down to all corresponding cells.  This will now highlight those that match the text value.
    Regards

  • Can I use my email and phone number to start a new conversation from iMessage?

    Can I use my email and phone number to start a new conversation from iMessage?

    Can I use my email and phone number to start a new conversation from iMessage?

Maybe you are looking for