Optimize the conversion of SGL data chain

As the title indicates, I'm looking to pronounce on a more efficient way (as appropriate) to convert a string into an array of SGL.

The detachment is just to get feedback on the best ways of doing things from a personal educational point of view. I don't actually have to improve performance... (Just keep improving my skills of codeing.)

'More effective' here must take to be less cycles of CPU and low memory footprint, in that order. (That is, most small load on CPU is preferred, if smaller memory footprint is at the expense of the other cycles CPU, the hit on memory footprint is preferred).

The length of the input string comes from a TCP read and contains only the raw bytes of the expected (in this case, SGL) format without any header/footer of meta-data.

Currently, my implementation is very simple and given that the expected table size is known, I am relying on the loop being smart in his automatic indexation allowance.

For the conversion, I do a right type-Gallery of 4 characters at once.

The code below, the for loop is simply intended to give a 'real' output boolean if the string length is the length of expected as determined by the input string 'number of track points. No additional error handling is required or necessary.

I suspect the "subset of string" combined with the iterations (for loop) are the two worst performance in this VI hits, but I can't think of a good way to do the conversion as a table, and if I could, then I should at least do a conversion in 'string to array U8' first.

Thanks to all who took the time to read and watch. Your time and your contribution is appreciated as always!

Q

Hi Q,

Why don't convert you directly in a table of SGL? No need of a loop FOR, nor for StringSubset...

Tags: NI Software

Similar Questions

  • Optimize the BSO - SQL Loader data loading

    Hello

    From left to right on the fields, I put the sparse dims sorted and in some order first then the Dense dims, then data?  Or is this Dense first and then Sparse and then data?   Seems there are conflicting ideas here...

    optimal order is most certainly rare members fors, followed by dense members.  To confirm the best order, take you cube and if there is no data in it, then charge a small amount using a lock of excel and send it, if there is, fine, then make a column for EAS export (level 0 is fine) and look at the exported file. The order of the dimensions is the optimal order of reloading.

  • problem about dynamic data to the conversion of table 1 d

    Hi all

    I have problem with the conversion between dynamic data and table 1 d.

    I wrote a simple VI to show the problem, as the attached picture. Convert dynamic data in table 1 d, and then return to the dynamics of data, I use 3 tables of waveform display data in 3 different places, but only 'force contact 2' the graph looks normal and the 2 other cards are strange data shows. In addition, the probe indicates that data are all just before going to the charts. What is wrong with him?

    Can someone help me?

    When you convert a table, you lose your calendar information.  You need to convert a waveform and manipulate waveform data.  Use a Structure of elements in Place with waveform components to manipulate waveform data.

  • Reliability of the data in the conversion to & from a Variant...

    It is possible to convert any data type to a variant, and then turn it back on.  In doing so, are there data types who will lose information during the conversion process?  If so, why?

    Yes, you can convert any type to a variable ranging and back. There is a VI called "Variant data" which will have a type as input. He continued to convert the variant the correct data. The side variant must know what type of data to expect. He can pull of the Variant. However, you can use a cluster of generic data that consists of a username and a Variant. Then you can have different types of data which can handle the side reception. It is a two-step process. One of conversion the variant of general type (data type and Variant cluster). The second would be a case statement uses the type then covert the internal variant to the specified type. This approach is used for generic messaging systems. The upper levels of the code will know what to do with the data. The lower levels are just generic data passing around.

    I'm not aware of any information that get lost during the conversion of the data to and from a variant. Of course, I not had no problem using them.

  • Conversion in failure "the reconfiguration of processing data store.

    I'm trying to convert a Windows XP SP3 machine that has one partition D:. When I try to convert, it fails to stage "Transformation of the reconfiguration data store" with an error indicating "FAILURE: unable to find the system volume, reconfiguration is not possible." I checked the boot.ini file and it seems to be ok, however when I run a Spotmau CD to try to make some recovery/survey to see what the problem is, it shows Windows is on C:, and in the conversion process step that says "Drive to update for the layout of the destination volume letters" goes and comes without error , so I guess that converter is changing the drive letter, that is all pipe up. Can I prevent converter to change the drive letter, or can I change afterwards?

    Thanks in advance for any help.

    xp is the easiest Converter 3.0.3

    that sets up work correctly

    with 4.3 you MUST order the buslogic controller

    Von meinem iPhone gesendet

    Am the 07.07.2011 um 22:19 wrote mmillington [email protected]<>[email protected]>:

    Http://communities.vmware.com/index.jspaVMware communities >

    Conversion in failure "the reconfiguration of processing data store.

    mmillingtonhttp://communities.vmware.com/people/mmillingtonresponse > converter - see complete discussion onhttp://communities.vmware.com/message/1786568#1786568

  • insertion error - date format picture ends before the conversion while

    My system: I use of Oracle Database 10 g Express Edition Release 10.2.0.1.0 - product with SQL * more: Release 10.2.0.1.0 and the first thing I've done in this project is a user account configuration especially for her through Application Express 2.1.0.00.39 with all permissions and then connected with SQL * more and seized command and run scripts on it since.

    I got the following error was in a previous project, but I don't have the result of it so I don't know how much he touched me. We can not always distribute perfect projects so I could live with that. It is that this new project is the first that start from a previous one have of course, I still have the error so I think they'll be less forgiving of mistakes that I had more time to work on it. However, after hours of research & debugging tests I still cannot do things.

    I read on sites in development more than a couple that we should not rely simply on inputs of channel inserts on dates where there is incompatibilities with nls_date_format and based instead on TO_DATE. This seems logical and I have no problem of implementation, but there is a problem running it. :|

    The following is an excerpt from my project bringing the error that I need to move.
    Thank you so much for your help
    DynV

    H2.
    code

    ALTER SESSION SET nls_date_format = "DD/MM/YYYY";
    DROP TABLE EMP;

    CREATE TABLE EMP
    (
    NOEMP INTEGER NOT NULL PRIMARY KEY,
    NAME VARCHAR (15) NOT NULL,
    FIRST NAME VARCHAR (15) NOT NULL,
    NOFONCTION INTEGER NOT NULL,
    DATEEMBAUCHE DATE,
    SALARY INTEGER NOT NULL,
    NODEPT INTEGER NOT NULL-,
    -FUNCTION REFERENCES FOREIGN KEY (NOFONCTION),
    -FOREIGN KEY (NODEPT) REFERENCES DEPT
    );

    -NoEmp, name, NoFonction, DateEmbauche, NoDept, salary
    INSERT INTO VALUES EMP (1230, "DAHER", "ERIC", 1, TO_DATE (DECEMBER 17, 1997 ',' DD/MM/YYYY ""), 40, 20000);
    INSERT INTO VALUES EMP (3235, "LEMAY", "PATRICK", 3, TO_DATE (FEBRUARY 20, 1982 ',' DD/MM/YYYY '), 20, 3500);

    H2.
    result

    Modified session.

    Table created.

    INSERT INTO VALUES EMP (1230, "DAHER", "ERIC", 1, TO_DATE (DECEMBER 17, 1997 ',' DD/MM/A))
    YY'), 40, 20000)
    *
    ERROR on line 1:
    ORA-01830: date format picture ends before converting all of the input string

    INSERT INTO VALUES EMP (3235, "LEMAY", "PATRICK", 3, TO_DATE (FEBRUARY 20, 1982 ',' DD/M))
    M/YYY'), 20, 3500)
    *
    ERROR on line 1:
    ORA-01830: date format picture ends before converting all of the input string

    H1.
    solution

    The Xgc of channel for the IRC server freenode user [#sql | irc://freenode/%23sql] had me I was using 3 characters for my picture/mask/filter /... instead of the 4 that taking data. then they became "JJ/M".
    M/YYYY "."

    How small error but with such devastating consequences.

    Published by: user13420426 on December 6, 2010 01:39

    You're 1 shy O.

    TUBBY_TUBBZ?select TO_DATE('17/12/1997', 'DD/MM/YYY') from dual;
    select TO_DATE('17/12/1997', 'DD/MM/YYY') from dual
                   *
    ERROR at line 1:
    ORA-01830: date format picture ends before converting entire input string
    
    TUBBY_TUBBZ?select TO_DATE('17/12/1997', 'DD/MM/YYYY') from dual;
    
    TO_DATE('17/12/1997'
    --------------------
    17-DEC-1997 12 00:00
    
    1 row selected.
    
    TUBBY_TUBBZ?
    

    Notice how I YYYY where you YYY.

  • Mac adds the extension txt for dat files

    Hello

    I download the files with the extension dat but when are already downloaded I see another extension txt (F4409.dat.txt). I need to use dat files in another program and convert my file to text file prevents me to do. I would like to block the conversion of files without my approval on my mac. Remove the additional extension (.txt) does not help. I still can't use file in a program that I need for analysis of the data. Help, please.

    AS

    Download from which site?

    Download of what app (a browser)?

  • To convert a new Win 8 PC Win XP PC w/Ffx 28.0, is Ffx 28,0 v. keep? If not, then v. and when and where to install the conversion?

    I will be the conversion of my PC for 9 years with the victory. A new PC with Win XP. 8. my list of program control panel tells me that my old PC running Firefox 28.0 (x 86 en - us). I need to be sure that Firefox 28.0 is your latest version and that I should go to my new PC (it seems to be so many versions out there that it is confusing... in one place you say version 17 is the only one to use). If I do not need to install another version of Firefox, I would need to know that one, and that it must be installed on the old computer first, before changing the PC, or anywhere elsewhere in the in the conversion sequence, that is, on the new PC before (or after?) transfer everything from the old PC. I intend to transfer to new PC software free LapLink offered for us the current XP users through a LapLink/Microsoft agreement.

    Yes, Firefox 28 is the current Windows XP or higher version.

    I'm not exactly sure how works of Laplink, but assuming that he transfer all your data from Windows user profile, then you should bring your Firefox to your new computer data. You can confirm by checking here on both computers and comparing what you see:

    (paste into start > run or WinButton + r): %APPDATA%\Mozilla\Firefox\

    In particular, make sure that Laplink copied the profiles.ini file and folder profile and its subfolders.

    I suggest you copy the data in the first, then installation of Firefox. In this case, when you install Firefox it should automatically find your data and you will be running. If you install Firefox first, then you will need to take some additional precautions to get your old data in.

  • history of the conversations on the new computer

    Hello

    First of all, sorry for my bad English.

    I have a question about the history of the conversations in Skype.

    I joined Skype in 2009 from my old LAPTOP.

    I used Skype on laptop computer for all time.

    Today, I bought a new computer, I downloaded Skype and singed in.

    But I knew the history of the conversations did not save, and I want to see

    the story of my new computer, how can I do?

    Is there a way to copy the files of the conversation on my computer in the new Skype history?

    Thank you much, Noam.

    Hi, sahar5003, and welcome to the community!

    Courtesy of Ruwim and TheUberOverLord, please see this thread that explains in detail how to copy the data from your old computer to the new:

    http://community.Skype.com/T5/general-discussion/how-to-see-my-conversation-history-from-one-compute...

    Best regards

    Elaine

    __________________________________________________________________________________________________
    Your question has been answered? Please click on the link to accept as a Solutionfor everyone can quickly find what works! As a post or want to say, 'Thank You ' -? Click on the button of congratulations!
    Reliable information: Brian Krebs: 3 basic rules for online safety

  • The monitoring of test data to write in the CSV file

    Hi, I'm new to Labview. I have a state machine in my front that runs a series of tests. Every time I update the lights on the Panel with the State. My question is, how is the best way to follow the test data my indicators are loaded with during the test, as well as at the end of the test I can group test data in a cluster, and send it to an another VI to write my CSV file. I already have a VI who writes the CSV file, but the problem is followed by data with my indicators. It would be nice if you could just the data stored in the indicators, but I realize there is no exit node =) any ideas on the best painless approach to this?

    Thank you, Rob

    Yes, that's exactly what typedef are to:

    Right-click on your control and select make typedef.

    A new window will open with only your control inside. You can register this control and then use it everywhere. When you modify the typedef, all controls of this type will change also.

    Basically, you create your own type as 'U8 numéric', 'boolean', or 'chain' except yours can be the 'cluster of all data on my front panel' type, "all the action my state machine can do," etc...

  • How to analyze the data of 10 bytes encoded in the HH306 of Omegatte data logger/thermometer?

    I am trying to write a simple code for a HH306 of OMEGAETTE thermometer/travailleursduweb.com data recorder.

    That is the problem. I communicate with the device via RS - 232, using Labview 8.5.1 and windows xp. I ask her for "all the coded data", which is actually the only option. He returns 10 bytes of encoded data, the manual describes the meaning of each byte and I understand that. The problem is that I can't analyze the information for use in labview, for example: I want to extract the temperature and simply display it.

    on request, I get: 10bytes (read as a string from the serial port read buffer): display HEX: 02 00 A8 48 FF EF B6 49 B6 03 is perfect, and what I expect.     Display codes: \02\00\A8\B6H\FF\EF\B6I\03 The Normal display is a series of special characters, I don't understand, especially since I don't think they are ascii characters that must match returned hexadecimal numbers!   For the life of me, I can't understand how to extract the information (what are the 48 6 hexadecimal display) of what is returned. All string manipulation functions seem to work only on what is given in Normal view. (The 4th and 5th byte of the data are the codes of the BCD for temperature: for example the temperature was 64.8 degrees farenheight when I took this reading).

    Can someone help me to analyze the data returned by this device?

    Ok... I think that I thought about it. I found this: http://digital.ni.com/public.nsf/websearch/77C8F61D36F5A23086256634005ACB38?OpenDocument.

    I guess the normal display garbled is corresponding to each hexadecimal ascii characters. I'm just not used to seeing characters beyond the decimal number 127 ascii or hex 7F.

    So, basically, to analyze the 10 bytes of data:

    (1) break the string read from the serial port in the 10 ascii characters (using String subset vi)

    (2) son of each output string in the left input of 10 separate Type vi Cast.

    (3) wire a constant U8 in each terminal 'type' VI Type Cast.

    cables of 4) the chain of each Cast of Type vi output to the input of a number hexadecimal string vi.

    (5) concatenate or use as you wish as hexadecimal numbers (now in string format) which cause.

    See you soon.

  • Effectiveness of the Cartesian to spherical coordinate of the conversion

    I use a VI in the LV 2014 distribution called ".vi NI_AALPro.lvlib:3D Conversion of coordinates (scalar)". It uses DBL inputs and outputs and has several functions of table build in it as a library function call. I need to make a massive number of Cartesian to spherical conversions with SGL values, and so I would like to re - write this VI using LV primitives most efficiant manner.

    The calculation seems to be pretty simple, and I've attached a VI that does this. However, there is a problem with the calculation of the polar angle. From what I've read online, this is just arctan (y / x), but I get incorrect values when x is negative (but not when there is negative).

    From what I've read on the site of Wolfram, "the inverse tangent must be properly set to the right quadrant of (x / y) into account." I searched online for more details on the calculation, but I'm lost. Any trig works there who can help me?

    Definitions are extremely important in the definition of coordinate systems.  You include with your VI Cart_to_Sph documents of many errors and inconsistencies.

    This is a convention that I use and which seems to be acceptance quite wide (I'm not sure that's the convention of Wolfram, however).

    Let X, Y and Z is a right coordinate system.  That P is a point whose X, Y, Z coordinates we know.  Define a system of spherical polar coordinates (SSC) as follows:

    • Project of a line from the origin to P.
    • RADIUS (rho) - length of the line from the origin to P.
    • The line of the project on the X - Y plane.
    • Azimuth (theta) - measured Angle to the left of the x-axis for this proposed line.  By convention, theta varies less pi (radians), pi.
    • Polar angle (phi) - the angle between the axis Z (or 'pole') and the line from the origin to P.  By convention, including phi between 0 and pi.

    Under this system of coordinates, the following code (very similar to Altenbach, which uses a slightly different coordinate system) cards X, Y, Z in Rho, Theta, Phi:

    We will check certain quantities of 'known '.  Start with the x-axis of the unit, [1, 0, 0].  This clearly has length, Rho = 1.    The X axis lies in the XY, so the angle between the latter and the Z axis is 90 °, Phi should be pi/2.  Finally, the projection of the X axis in the XY plane is located along the X axis, so the angle between the two axes of X is 0, so Theta should be 0.  The first Re / Im polar will give 1, Theta Yes 0 = 0.  The second will give 1, pi/2, and Yes 1 = Rho and Phi = pi/2.

    How about unit Z, [0, 0, 1]?  Again, the length, Rho, is 1.  Technically, since the z plans on the origin, the Azimuthal angle cannot be properly defined (the X coordinates and are 0), so we'll do a loophole 'math' and just say that it is zero.  The polar angle is easy - the angle between the Z axis and the pole, the Z axis is 0, so Phi = 0.  Now "do the math".  Put [0, 0] in the first Re / Im polar gives [0, 0], so theta = 0.  The second d / Im to polar takes [1, 0] [1, 0], Rho Yes = 1 and Phi = 0.

    It is easy to show (in particular by the coding of this place and put in test of numbers) that negative quantities are working properly.  Rho is always non-negative, Phi is always in the range 0... PI and theta of pi-pi, with the sign depends on the sign of Y (as it should).

    Bob 'just do the math' Schor

    PS - If you think this is fun, just try 3D rotation matrices...

  • Optimize the MITES on the NOR-HSDIO devices

    Hi all;

    I download an example of web of OR call "NOR-HSDIO Stream of the use of the disc (generation) Win32 file i/o", the example of the generation advance. Although utilities in these examples work fine, (utilities are used to determine the transfer of maximum data, the maximum block size, etc.), when I try to run some of the examples of the world, I still get the same error: "Failed to set command on 1", which is an error generated from the Sub - VI called: 'NOR optimize MOTH - NOR - VISA_Reg_Read.vi'. I think I forgot to change some this VI param, but I don't know which one of them, I think the GOLD mask, but I don't know how or why this is the value that I need to change.

    Example:

    FTP://FTP.NI.com/pub/DevZone/EPD/NI-hsdiogeneration-advanced.zip

    I want to solve the problem, but also I want to understand, so guidance on what can I read to fix myself will be appreciated.

    Mmdd,

    Thanks for posting on the forums of NOR. I was curious, if you could tell me exactly what NOR-HSDIO device you are using for your application, this could give me some information about the moth error you get. Some devices like the 6541/42, 6551/52, 6561/62, use the moth, but others like 6544/45/46/47 aren't, and that's why the MOTH code would not need.

    In regards to your second post, I'm guessing you are trying to change the MOTH VI to make it work for your application, but it is not recommended to use the VISA application for reading / writing with the HSDIO cards, you could try to remove the MITE VI and see if the example works without raising errors. I would like to know how the trial goes. Thank you!

    Thank you!

  • Memory management by displaying the large amount of data

    Hello

    I have a requirement to display the large amount of data on the front in table 2 & 7 graphic during the time period 100hrs for 3 channels, data read from strings must be written in the binary file, and then converted and displayed in front of the Panel for 3 channels respectively.

    If I get 36 samples after conversion for all hours, up to 83 h 2388 samples displayed in table and graphical data are thin and samples correspond exactly.

    After that 90 hours 45 minutes late is observed after theoretical calculation of samples, what could be the problem

    I have controller dual-core PXI8108 with 1 GB of ram

    As DFGray,

    says there is no problem with the RAM or display, problem with conversion (timming issue) if I am data conversion of large amount it takes even, compared to the conversion less amount of data. So I modifed so that each data point Sec 1 is convereted at once, problem solved

    Thanks for your replies

  • 'image' for the conversion of "photo".

    LabVIEW dear gurus,.

    I have a problem I would like to help with. I have a labview VI that creates an image using the entire block 'IMAQ image', and I a VI which allows the selection of image with the mouse. Most of the code for this second VI is an example. The problem is my photo VI selection requires that the image of the data type 'image', but the photos my other VI creates are the data type "image." CTRL-h wrote the first type of wire is 'image' and the second type of thread is "Image Dst Out (IMAQImage). I need either to convert the 'image' to 'image', or rewrite my photo selection to take in a variable "image" instead of "photo". I'm not particularly good at labview, I'm short on time, so conversion seems to be the best option. I found another thread that talks about the conversion of an 'image' in a table, but I do not know how to turn this table back into a 'picture '. Someone at - it ideas?

    Thank you
    sdt51

    Hi Daniel,.

    The VI I posted actually did the right thing, but I misnamed it.  Where did you see this VI?  I just created myself on my PC here.  Anyway, here's the same VI to 8.2.

Maybe you are looking for