CONVERTIR 4 OCTET EN U32

bonjour, je ne comprend la conversion avec la fonction adapter le type qui ne respecte pas le LSB fisrt.
Merci d'avance
De plus pour passer de LSB en MSB y a t il un autre moyen que la conversion en tableau de booléen et l'inversion de celui-ci ?
Ludo
Attachments:
ConvOctet.vi ‏16 KB

Reversing the array in the case of little endian is fine, other solution are not really simpler. Here is an alternative.
LabVIEW Champion . Do more with less code and in less time .
Attachments:
ArrayToU32.png ‏2 KB

Similar Messages

  • How can I convert 16bit greyscale pictures to 24bit color pictures

    Hi,
    I am stuck at coloring 16bit greyscale pictures without losing the
    resolution of 16bit, as it would happen when using the
    WindMapping-thing (which reduces the displayed resolution to 8bit).
    I figured that what I would need is probably an array consisting of
    32536 RGB-color clusters to convert all greyscale values to a color,
    preferrably a rainbow spectrum.
    I tried to create such an array via the HSL-model, where the coding of
    a rainbow spectrum is easier than in RGB, and then converted it to U32
    for obtaining the RGB-colors. The problem here is: Although HSL is
    24bit in IMAQ, I can only get about 200 different colors when using
    constant saturation and luminance. I understand that 24bit is made of
    3x8bit for H,S and L. - However, as the HSL-model describes colors as
    Hue (0-359°); Saturation (0-100%) and Luminance (0-100%) I don't really
    understand, how those 360 Hue-values could possibly be put into
    U8-representation required by the IMAQ ColorToRGB-vi.
    Does anyone have an idea how to obtain a 24bit-rainbow spectrum coded
    in 32536 distinct colors other than manually creating all the entries?
    The reason I need this is to determine whether it will be necessary to
    process the images all the way through using I16 or if can be done with
    U8 as well without losing too much of detail.
    I couldn't figure out any other way to DISPLAY true 16bit other than
    the detour using 24bit pictures. It is only about display, not about
    processing, which can be well done using the IMAQ I16 format...
    Thanks for any input!
    C.

    Thanks for the answer and especially the link, George!
    Unfortunately our relevant grey values are distributed over a wide
    range of about 5000, which I would rather use instead of letting them
    melt down to 256...Of course - being able to distinguish between 5000
    different greyscale values with the human eye is another story!
    However - a co-worker of mine came up with the idea of coding the grey
    values in terms of travelling along the axes of the RGB cube, as shown
    in the attached image.
    Attachments:
    rgb-axis-travel.PNG ‏14 KB

  • How to remove tailing zero in U32

    Hello,
    I am trying to change the format of a U32 number so that all bytes are reversed without tailing zeros, and I am not that familiar with formatting numbers and strings.  Please kindly advise how my VI should be changed to accomplish that.  Thanks a lot for your help.
    Valen
    What I want to achieve:
    x12345678 --> x78563412
    x123456     --> x563412
    x2               -->x 2
    My Results:
    x12345678 --> x78563412
    x123456     --> x56341200
    x2               -->x 2000000 
    My VI:
    U32-->Swap words-->Swap bytes-->U32

    Try this (LabVIEW 7.0)
    If course if you only need to convert a single U32 scalar, use the code inside the loop.
    Message Edited by altenbach on 07-13-2006 12:23 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RemoveTailing.png ‏4 KB
    RemoveTailing.vi ‏25 KB

  • Timestamp as simple long

    This should be an easy one. I would like to obtain a timestamp in simple long format. The timestamp to seconds gives me this in some weird format that I can't cast to a long. How can I convert it to this basic format?
    Solved!
    Go to Solution.

    Hi Steve,
    you could convert to an U32 like shown in the attachment...
    You can't use I32 as timestamp is out of range already. But you could make your own timestamp, for instance as "second since 1.1.1980" when you want to use I32...
    @ravens fan:
    In LV7.1 you can't convert a timestamp directly to U32 - one more reason to upgrade
    Message Edited by GerdW on 05-19-2009 07:23 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    timetou32.vi ‏16 KB

  • VI for a cRIO 9002

    I am trying to write a Labview program for a cRIO 9002 chasis with all 7 modules. I want to mainly read temperature, but ultimately control it as well with RTD's and heaters respectively. When I wrote the first parts of the software, which are attached here, one is for the target, and the other one for the host, and tried to compile it, I got an error message saying that I had run out of gates ( 1 million for this particular model of FPGA). It seems to me that there could be a more compact way of writing the software so that it could compile with the number of available gates. I would appreciate you feedback.
    Attachments:
    RTDAcq-FPGA.vi ‏747 KB
    RTDAcq-RTHost.vi ‏146 KB

    What version of LabVIEW are you using? I'm guessing LabVIEW 8.5 just from your code where you convert things to U32 before you send them through FIFOs. LabVIEW 8.5 only supports U32 FIFO data type. Honestly, as much as I hate saying this, the best option here would be to upgrade to LabVIEW 8.6. If you are using LabVIEW 8.6 you could do this data movement from FPGA to Host using FXP data type so you don't have to get calibration data first, as the FXP data is already calibrated when you grab it from the module, and the FIFOs can easily handle that data type... no need to waste space doing U32s.
    Does your compilation report say what is running out of space? Is it block RAM or is it flip flops and LUTs? 
    To get this working in LabVIEW FPGA 8.5, you can remove the FIFO for getting the calibration data to the host. Since this is only used once, you can replace it with just indicators coming from each of the I/O nodes. So instead of grabbing the calibration data from each I/O node, converting it so it is U32, building it into an array, and pushing it through a FIFO... you can replace all of that with just indicators for each value.
    For the loop where you get the data, you can 'pack' the data into the FIFO more efficiently so you don't waste as many bits. So if each channel of your input data is 16 bits, instead of converting each channel up to 32 bits and having 16 wasted bits, you can pack two channels together so the first 16 bits are one channel and the second 16 bits are another channel. That way you do half as many writes to the FIFO and you use half as many bits. Of course, on the Host side... you would need to break the U32s received from the FIFO apart so that you grab each channel as desired. 
    Let me know if this helps! 
    Stephen B

  • DSC vs. TDM

    Hi,
    In our
    company we have a few data-loggers and are thinking of an improvement
    considering data-management and reusability. Therefore we consider the DSC
    (Citadel) and the TDM format.
    At the
    moment we are looking per hour to a binary file with a size of 133 MB. We have
    32 digital and 64 analog channels. Every channel creates 500 data points per
    second. Every value of the 32 digital channels (Boolean array) is converted
    into an U32 value.
    I have
    already tested DSC and TDM. The data-management and the performance of viewing
    the data is very good with Citadel. Disadvantages: When writing the digital
    channels to the database every value reserves at least 1 Byte à overhead of at least 7 bits. The entire needed
    storage for one hour grows about factor 3. We’ve also tried to compress a
    digital array of 32 values to an U32 value. That would save storage but viewing
    the data with MAX isn’t possible. Therefore we have tried to programmatically
    view the data with the Mixed Signal Graph which would be a good opportunity for
    us to view analog and digital data. Unfortunately the loading of the data isn’t
    reasonable for our users. Furthermore we have also tried to use MAX to view
    data from a remote computer. There we detected a great performance lost
    compared with viewing on a local machine. Is it a know issue?
    Next we’ve
    investigated the TDM format. It is really a great thing (we can store the
    scaling and other describing information) but a big problem for us is that we
    aren’t able to search within the binary data. A further disadvantage compared
    with DSC is that we have to care for the data management and that the viewing
    of the data is much slower.
    Has anybody
    tips or details for a possible solution for our problem?
    Many thanks
    in advance.
    Kind
    Regards,
    Joachim

    Hi Robert,
    Yes, we already use Diadem in our company. The main problem is that we aren't able to search the binary data --> signal. In our binary file we have compressed 32 digital signals to an U32. There is only the possibilty to view the data with a DataPlugin which describes the configuration of the binary file. The TDM format is a good format but our application should be continous user friendly. Our favourite would be the TDM file format which can be viewed with the Mixed Signal Graph with a high performance like the MAX is doing it with Citadel data.
    Kind Regards,
    Joachim Schreibmaier

  • Filtre en racine cosinus surélevé

    bonjour;
    je suis étudiante en licence Télécommunication au Maroc;et je travaille actuellement sur les techniques de Modulation sous Labview .je suis tombée par hasard sur cette article (Télécommunications Numériques sous Labview).que j' ai lu plusieurs fois et que je trouve d'ailleurs trés intéressant .cependant .j'arrive pas à le programmer correctement sous Labview peut être que par ce que je travaille sur une version LV différente de la votre ;notamment j'arrive pas à trouver le composant qui permet de convertir Octet en 2 trains de bits ;(unit et lit) ;qui permet l'acquisition du signal présent sur le microphone;diagramme de 'oeil ;(demodul );(modul).et surtout la palette du filtre en racine cosinus surélevé
    Je veux demande par ailleurs de nous envoyer le code source des programmes qui figures sur  l'article.ou donnée moi le programe du filtre en racine cosin us surélevé sous matlab sript; s'il vous plait répond moi rapidement
    Merci par avance . 
    Attachments:
    j3ea10013.pdf ‏319 KB

    Salut Souad,
    J'ai pu localiser le moduler et démoduler fonctions dans notre boîte à outils Modulation, qui est un add-on pour LabVIEW et ne viennent pas avec un téléchargement régulier de LabVIEW. J'ai joint un lien vers cette boîte à outils au bas de cet e-mail. Je ne suis pas sûr quelle fonction l'auteur utilise pour acquérir son, mais le Acquire Sound.VI est livré en standard avec LabVIEW et devrait vous permettre d'obtenir une fonctionnalité similaire. Cela peut être trouvé sous Programmation >> graphiques et sonores >> Sound sur la palette de fonctions. Je suis pas sûr de l'octet à 2 trains Bits VI que l'auteur a utilisé, mais vous devriez être capable d'écrire votre propre sous-VI avec régulière LabVIEW pour obtenir la même fonctionnalité. L'auteur peut avoir créé ce VI personnalisé. Aussi, je suis sûr de la racine de cosinus surélevé fonction de script Matlab vous avez parlé. Peut-être, si vous postez votre code, je pourrais être de meilleure utilité pour vous. J'espère que cette information vous aidera!
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/12855 - NI Modulation Toolkit
    Cordialement,
    Michelle G
    Applications Engineering
    National Instruments

  • How can I convert a U32 array into binary string?

    Hi
    I would like to find an efficient way to convert an array of 8192 U32 into a single binary string!!!
    the solution below  last 550 ms on an RT target to convert 8192 U32.
    The same code running on Labview (not RT) last 100ms. I don't understand why there is such a difference.
    I've tryed to replace the inner loop and convert by a format string whith U32 on entry and %032b as parameter but it lasted same time.
    Thanks a lot

    Your picture of your code didn't come through. You can't link to a picture that's on your computer, as a server on the internet cannot access your computer to display the picture for others to see. You have to upload the picture as an attachment. Then, if you want to actually display the picture in the message you have to edit your post, insert a picture, and when it asks for the URL you enter the URL of the picture. You can get the URL when viewing the message, as the link is within the message itself.
    As for your question, can you just use the TypeCast function?

  • Convertir un tableau d'octets en un nombre décimal signé

    Bonjour,
    J'ai une petite question : comment es-ce que je peux convertir un tableau de 2 octets, c'est une valeur dont le signe est intégré, en une valeur décimal que je pourrais ensuite utilisé dans un graph ou un indicateur par exemple. Je vous joins mon vi.
    Merci à tous
    Attachments:
    ExempleSERIAL3.vi ‏13 KB

    Bonjour,
    tu es sur le forum anglais, tu aura plus de chances d'avoir des réponses sur la partie française:
    http://forums.ni.com/ni/board?board.id=4170
     Cordialement
    Yann C.
    France

  • How do I convert an U32 integer to ascii?

    I am communicating with a digital device. I can send it commands, and receive ascii as an output. In many instances, the data I receive is in packets, which I decode. When I combine my 8 bits with the build array function, I get a U32 integer. Currently I am converting that to a U8 integer, and displaying the result as a program rev. We would like to display it as an ascii value, and I have been unable to figure out how to do it. I am including a screen shot of where I am trying to make the conversion. Thank you!
    Solved!
    Go to Solution.
    Attachments:
    Attempt to convert to Ascii.doc ‏28 KB

    The string to number conversion does not change the number. It just changes it from a number to a string. For example the U8 result I get is 31 hex. This is a "1" in ascii.
    I have included a jpeg screen shot.
    Attachments:
    Screen Shot.JPG ‏26 KB

  • How to convert U32 value obtained from color control of front panel to float(SGL) for use with IMAQ Draw ?.

    I am trying to get user color inputs from front panel and use it in IMAQ Draw. I need to draw an oval of a certain color in a background of another color. Both these color values are user input. The problem is IMAQ Draw requires SGL color value and the color controls of front panel give U32. I have tried conversion VI's which hasn't worked. HELP !!!

    Jake,
    I think the color control can be wired directly to the input, but I am not positive. I don't know of any color conversions that would help.
    Make sure your image is a color image. You can't draw colors on a grayscale image.
    You might want to consider using overlays, which appear on top of the image but are not part of the image.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • Convert an U8 array to a LabView data type

    In my code the input is an fixed length of U8 array reflecting data in memory, I need to convert it to a predefined data type. For example, the first 2 U8 elements in the arrary need to comvert to an U16 data, next 4 U8 elements to U32 data. I am just wondering if there is any easy way to do that kind of conversion. 
    Solved!
    Go to Solution.

    In the first case use the Join Numbers function to join the bytes. In the second case, use the Join Numbers function three times: twice to join the consecutive bytes and once more to join the words into a single long word.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Error -200429 DAQmx read (counter u32 1ch 1samp).vi -append- Edge count in for loop

    I am receiving error -200429 DAQmx read (counter u32 1ch 1 samp).vi <append>. This is occuring on the second loop of a for loop.
    I have a sequence inside the for loop that is using four DAQmx assistant vi's for edge count at various times in the sequence. All four of these count fine the first time through but at the beginning of the second loop the first edge count receives this error and does not count.
    Any ideas?

    The code you have supplied is similar to the converted subvi but this code will give an empty task error on the DAQmx Create Channel vi.
    Notice on the Daqmx create task vi that there is nothing wired to the "Task to copy" or the "Global virtual channels" connectors - I believe this is why the task is empty when sent to the Daqmx create channel vi.
    The code we are currently using is a modification of a previous code used before a recent upgrade. It may be better in your/NI eyes to re-write this into a State machine but time constraints and resources do not allow that at this time - All other parts of the current program work except for the counter on the second iteration. Would rather not reinvent the wheel at this point. 
    If the task is being cleared was the issue then the other three should also not execute. The issue appears to be the "First Call"
    I have attached a zip file of the complete program as it is now written to give you a better idea of the whole picture.
    Attachments:
    Test Machine current code.zip ‏657 KB

  • Converting an html file with jsp contents to a text file for download

    Hi guys,
    I'm currently having troubles with downloading a .jsp file to a doc file.
    The thing is i am able to download the desired file and make it as a .doc but when i open it with ms word 2007 i can only see the content of the html. The dynamic content generated from the database and reflected on the .jsp page that i suppose to download and convert to .doc file doesn't show.. I hope someone could help me... My servlet code is this:
    public class FileDownload extends HttpServlet
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    try
    String originalFileName="localhost:8080//Appsdev//reportresults1.jsp";
    File f=new File(originalFileName);
    System.out.println("THE 1st f:"+f);
              response.setContentType("application/octet-stream");
    response.setHeader("Content-Disposition", "attachment; filename=tryreport.doc;");
    response.setHeader("Cache-Control", "max-age=0");
    byte[] buf = new byte[1024];
    FileInputStream inStream = new FileInputStream(f);
    OutputStream outStream = response.getOutputStream();
    int sizeRead = 0;
    int size = 0;
    while ((sizeRead = inStream.read(buf, 0, buf.length)) != -1)
    outStream.write(buf, 0, sizeRead);
    size += sizeRead;
    inStream.close();
    outStream.close();
    catch(Exception e)
    e.printStackTrace();
    }

    Hi BalusC,
    sorry for the double post i'm newly registered and it's my first post before i was just reading other's threads.
    well last night while i was reading and researching for a solution a came across this.
    <%@ page language="java" contentType="application/msword"%> naturally for my other jsp pages, the contentType is text/html so when the page loads it display in the browser. But with application/msword when i direct the page to the jsp page that i want to download and set the contentType with that...it prompts a window like when you're downloading the one with the <open with and save as>. It works fine to, i was able to see the report that i have to download and it is formatted very much like what i am seeing on the browser. My only concern now is the file i am able to download is a .jsp file how could i change that to a .doc file and be able to see the same content like the one with the .jsp file that i have right now.... any help or examples would be greatly appreciated. I didn't use the servlet anymore because even though i am able to download there is no content the html parts only but iam able to change the extension for the file...thanks again! ^ ^

  • How to Convert Binary Data in Binary File

    hi,
    my telecom client puts a binary file which is asn.1 encoded with BER.
    how to handle binary data in java.
    how to convert binary to hexa to ascii format
    how to convert binary to octet to ascii format
    please help me in this.
    regards,
    s.mohamed asif

    You don't need to convert the data.
    Only you can do is print it in that formats, like it:
    public static String byteArrayToHex(byte[] b) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < b.length; i++)
             sb.append(Integer.toHexString(b&255) + " ");
    return sb.toString();
    take a look at this
    http://java.sun.com/docs/books/tutorial/essential/io/

Maybe you are looking for

  • Goods Receipt PO Quantity Deviation with PO

    Hi all Is it possible to prevent user to post Goods Receipt PO with greater qty than PO Qty for the item with an option to choose YES or NO? Kedalene

  • Note on interactive SVG and Edge Commons

    I encountered something I want to mention so people do not pull their hair trying to find out which things are not working. 1- issue publishing If you add a js folder for your js files, Animate v2 will not import it in your web folder - So add it aft

  • Computer switching between 2 close extending airport express

    Hi i have a Windows 8 computer that is switching between 2 airport expresses that are extending the network. Is there no fix or can i keep my phone connected to one?

  • Selecting Customer Report

    Hi, We are using customized customer transaction report developed in ABAP. When preview, the selected customeru2019s transaction report list comes out in one page, scroll down to see the next customer. On the list of customers the user wants to furth

  • How to setpage/workset in a role on toplevel-navigation instead of role

    Hi all, Guess the are one page and one workset in our role, as follow: role1 (Role) page1 (Page) other iviews workset1 (Workset) other iviews By default, the role1 is shown in the toplevel navigation, how to set the page1 and workset1 in the topleave