First MSB or LSB First

I byte "00011100" but I want to swap this byte to "00111000. What should I do?

PS. I try to use the Toolbox "swap byte".

None of this makes no sense at all.

You have a single character, turning it into a table containing a single element (i.e. a single byte) U8. To reverse the bytes, you need more than one. The output should not be a 2D array.

If you want to reverse the bits of the byte, user reverse table on the array of Boolean.

(and if you need to do it often, create a table of correspondence of the 256 entry instead).

Tags: NI Software

Similar Questions

  • U8 NChan NSamp 2D DAQmx writing question: Digital

    The help file says that for the "Digital 2D U8 NChan NSamp' vi, each row of U8s is a channel and each column is a sample. But each sample U8 get extended to 8 bits? If so, what bit is first (MSB or LSB)?

    If this is not the case, how the U8 is sent to the material. Is the U8 a sample of port where each bit value corresponds to a line on a port? If it is this plan, so I guess if you had 3 lines in a channel, 5 bits of the U8 would be unused. I also assume that all lines in a channel would have to be on the same port.

    I guess my confusion comes because I think a somewhat broad digital as channel, while the literature seems to indicate that a digital channel can be composed of several bits.

    I don't have a DAQ DIO to confirm this, but I think the LSB of the U8 goes to port x 0 (D0), line up the MSB goes to port x line 7 (D7).  So if you had 3 lines in a channel, 5 bits of the U8 would be ignored.  Yes, all lines must be on the same port.  If the polymorphic selection is U8, then you must have 8 rows on the same port.  If the U16, two ports are concantenated to form 16 lines that correspond with the U16.

    I too tend to think of a digital channel in one line.  The terminology is confusing.  They shouldn't mention the word of all channel.  It should be ports and lines only, as port 0 line until the line port 0 7 0, then 1 line 0 port and so on.

    The expression "each row of U8s is a channel", I think that this meant that only one channel is the 8 lines of a port.  In other words, the channel is a port.  I guess they use the channel because if you specify U16, a channel could be ports 0 and 1.

  • 2 ways to send 16-bit to the serial port. What is the good?

    I am trying to send data via a serial port... This data consists of a 16-bit format. The data are sent by a DSP. Searching in the internet I found two ways to send data. The first is that the first photo anda the second way is the second picture.  I read data ok, which in this case is a sine wave. But I 'don't know if it is correct or not.

    In the first case , the citation read buffer sende th 8-bit to decimate them VI that will be concatenated after to join numbers function...

    Is it fair or not?   Second question. I noticed when I put multiples of 8 in the number of bytes the graph is ok. But when the number is not a multiple is the graph 'missing pieces '.  Why?

    In the second case, I confess I didn't undertood it. I know that the CASTING of TYPE function transforms the string on a table swap bytes (DSP sends the MSB and LSB) I know what subset of string.  I read that the 4 in the offset is put there to avoid the reading of the data header. But I don't know why 2048 is here. The latter reads data too...

    With any who answer my questions would be a really really help

    Thank you guys.

    First case

    second case

    Both are probably correct for the data being sent.

    If you want to read a unique 16-bit value at a time, then obviously you would set the number of bytes to read to be 2. The following code shows two ways to convert the two bytes to a single value. The chain Unflatten to specify the boutien.

    You don't mention her, but how do you synchronize the data. With the dsp to send two separate bytes, not sure what byte you will read first. Do you send start/stop characters so that you know this vital information?

  • Week 2 - calculation of pressure BMP180

    Hi people,

    It's still bugging me, I had the temp calc works very well. But my pressure barometric calc is not fair. Values are output, and he reads maybe 20-30 seconds and then hangs. So I guess I'm hanging songs too much in a way or another.

    My code looks like this:

    Read 0xF6 (MSB) and 0xF7 (LSB), and 0xF8 (XLSB)
    short-MSB = bmp180.pull (0xF6); Read the first 8 bits
    short LSB = bmp180.pull (0xF7); Read 8-bit seoncd
    short XLSB = bmp180.pull (0xF8); Read the third 8-bit

    rawPressue long = (MSB < < 16 + LSB < < 8 + XLSB) > > (8 - OSS);

    Calculate
    long X 1, X 2, X 3, ActualPressure;
    Long B6 = C - 4000;
    X 1 = (VB2 * (B6 * B6 > > 12)) > > 11.
    X 2 = AC2 * B6 > > 11.
    X 3 = X 1 + X 2;
    B3 long = (((AC1 * 4 + X3) < < OSS) + 2) / 4;
    X 1 = AC3 * B6 > > 13.
    X 2 = (VB1 * (B6 * B6 > > 12)) > > 16;
    X 3 = ((X 1 + X2) + 2) > > 2;
    long B4 = AC4 * (X 3 + 32768) > > 15;
    Long B7 = (rawPressue - B3) * (50000 > > OSS);
    If (B7 < 0 x 80000000) {}
    ActualPressure = (B7 * 2) / B4;
    } else {}
    ActualPressure = (B7/B4) * 2;
    }
    X 1 = (ActualPressure > > 8) * (ActualPressure > > 8);
    X 1 = (x 1 * 3038) > > 16;
    X 2 = (-7357 * ActualPressure) > > 16;
    ActualPressure = ActualPressure + (X 1 + X 2 + 3791) > > 4;

    Someone did this work?

    I am interested to then calculate the Altitude and compare GPS reading or be able to supplement the GPS data if you do not find enough satellites for a 3D signal.

    I hear the solution for this work at home is available from lesson 2, I suggest you just take a peek.

  • How cascading 2 counters for 64-bit timer?

    I work with the PCI-6225 card which has several counters.  I configured CTR0 to 20 MHz.  I get the CTR0 time by calling the OR-DAQmx C function 'DAQmxReadCounterScalarU32' to get the number of frequencies and then by dividing the number of frequency of 20 MHz for a time value.   The maximum time value that may be getting is that of 214.7483648 seconds (2 ^ 32 / 20e6).    I want to stunt/link two counters (CTR0 and CTR1) to get the frequency of 64-bit values.    To be clear, CTR0 configured as CTR1 configured as 32 byte MSB and LSB 32 bits so that whenever CTR0 reached maximum values and "roll" then CTR1 would be incremented by 1.   How can I do this using the C-NOR-DAQmx features?

    Thank you

    Ian

    Hw do will be more reliable, but here are two possible ways to approach it in sw.

    1. There is a DAQmx property with a name similar to "Terminal number reached" that I have used in LabVIEW but do not know the underlying C syntax.  When you query this software, it will return a true once, is reset to false.   I'm sure that he will return a true even once on the * following * the event rollover, but you would be better double-check me on that.  Not knowing your entire application, I guess you will probably need to be prepared to manage several inversions.

    2. in certain applications, rather than establishing a measure which follows the cumulative time, you can configure the hw to measure periods and then take a NAP in sw to get your 'timestamp '.   Unless an individual interval could exceed 200 + seconds, you can just do your accumulation of software with a 64-bit data type.

    Technically, you can even do both.  Do a measure 32-bit intervals hw, do a query of software for the event of tc, accumulate intervals & counties of reversal in a 64-bit int.

    -Kevin P

  • Problem using the pixel format indexed bytes in the PixelWriter setPixels method

    I'm trying to build a byte array and set it on a WritableImage using the PixelWriter setPixels method.

    If I use a RGB pixel format, it works. If I use a byte indexed pixel format, I get a NPE.
    Stride etc should be fine if I'm not mistaken.

    java.lang.NullPointerException
    to com.sun.javafx.image.impl.BaseByteToByteConverter. < init > (BaseByteToByteConverter.java:45)
    to com.sun.javafx.image.impl.General$ ByteToByteGeneralConverter. < init > (General.java:69)
    at com.sun.javafx.image.impl.General.create(General.java:44)
    at com.sun.javafx.image.PixelUtils.getB2BConverter(PixelUtils.java:223)
    to com.sun.prism.Image$ ByteAccess.setPixels (Image.java:770)
    at com.sun.prism.Image.setPixels(Image.java:606)
    to javafx.scene.image.WritableImage$ 2.setPixels(WritableImage.java:199)

    Independent, short example here:
    import java.nio.ByteBuffer;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.PixelFormat;
    import javafx.scene.image.WritableImage;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    
    public class IndexedColorTestApp extends Application {
    
        public static void main(String[] args) {
            launch(args);
        }
    
        @Override
        public void start(Stage primaryStage) {
            BorderPane borderPane = new BorderPane();
            Scene scene = new Scene(borderPane, 600, 1100);
            primaryStage.setScene(scene);
    
            ImageView imageView = new ImageView();
            borderPane.setCenter(imageView);
            primaryStage.show();
    
            int imageWidth = 200;
            int imageHeight = 200;
            WritableImage writableImage = new WritableImage(imageWidth, imageHeight);
    
            // this works
            byte[] rgbBytePixels = new byte[imageWidth * imageHeight * 3];
            PixelFormat<ByteBuffer> byteRgbFormat = PixelFormat.getByteRgbInstance();
            writableImage.getPixelWriter().setPixels(0, 0, imageWidth, imageHeight,
                                                     byteRgbFormat, rgbBytePixels, 0, imageWidth * 3);
            imageView.setImage(writableImage);
    
            // this throws an NPE in setPixels()
            byte[] indexedBytePixels = new byte[imageWidth * imageHeight];
            int[] colorPalette = new int[256];
            PixelFormat<ByteBuffer> byteIndexedFormat = PixelFormat.createByteIndexedInstance(colorPalette);
            writableImage.getPixelWriter().setPixels(0, 0, imageWidth, imageHeight,
                                                     byteIndexedFormat, indexedBytePixels, 0, imageWidth);
            imageView.setImage(writableImage);
        }
    
    }
    If there is no solution, maybe someone knows a solution? We chose to use the format indexed due to the size of the data / performance reasons.

    Published by: Andipa on 01.03.2013 10:52

    You have found a bug in the platform, filed against the project to-online http://javafx-jira.kenai.com to your sample code and a link to this forum question.
    Byte indexed pixel formats seem like a feature never completely (or maybe even any) implemented for me.

    The PixelFormat type uses your unsuccessful case is (PixelFormat.Type.BYTE_INDEXED):

    PixelFormat byteIndexedFormat = PixelFormat.createByteIndexedInstance(colorPalette);
    System.out.println(byteIndexedFormat.getType());
    

    Here are the valid PixelFormat types =>
    http://docs.Oracle.com/JavaFX/2/API/JavaFX/scene/image/PixelFormat.type.html

    BYTE_BGRA
    The pixels are stored in adjacent bytes with the non-premultiplied components stored in order of increasing index: blue, green, red, alpha.
    BYTE_BGRA_PRE
    The pixels are stored in adjacent bytes with the premultiplied components stored in order of increasing index: blue, green, red, alpha.
    BYTE_INDEXED
    The pixel colors are referenced by byte indices stored in the pixel array, with the byte interpreted as an unsigned index into a list of colors provided by the PixelFormat object.
    BYTE_RGB
    The opaque pixels are stored in adjacent bytes with the color components stored in order of increasing index: red, green, blue.
    INT_ARGB
    The pixels are stored in 32-bit integers with the non-premultiplied components stored in order, from MSb to LSb: alpha, red, green, blue.
    INT_ARGB_PRE
    The pixels are stored in 32-bit integers with the premultiplied components stored in order, from MSb to LSb: alpha, red, green, blue.
    

    As for a WritableImage native pixel format is not the same that you use the pixel format, the JavaFX platform needs to do a conversion while reading pixels in a format and write it in another format. To do this, he must be able to determine a PixelGetter for your PixelFormat (the PixelGetter is an internal thing, API not public).

    And here's the source determines the PixelGetter for a given type of PixelFormat:
    http://Hg.OpenJDK.Java.NET/openjfx/8/master/RT/file/06afa65a1aa3/JavaFX-UI-common/src/com/Sun/JavaFX/image/PixelUtils.Java

    119     public static  PixelGetter getGetter(PixelFormat pf) {
    120         switch (pf.getType()) {
    121             case BYTE_BGRA:
    122                 return (PixelGetter) ByteBgra.getter;
    123             case BYTE_BGRA_PRE:
    124                 return (PixelGetter) ByteBgraPre.getter;
    125             case INT_ARGB:
    126                 return (PixelGetter) IntArgb.getter;
    127             case INT_ARGB_PRE:
    128                 return (PixelGetter) IntArgbPre.getter;
    129             case BYTE_RGB:
    130                 return (PixelGetter) ByteRgb.getter;
    131         }
    132         return null;
    133     }
    

    As you can see, the BYTE_INDEXED format is not supported, and null is returned instead... it is the source of your NullPointerException.

  • 24 bit MSB - LSB in addition to two the number of spell

    Hi all

    I read bits out of an ADC by sbRIO serial 9602 via DIO on P4 connector.

    ADC sends 24 bit MSB first as a supplement to two: How can I convert it to hexadecimal number they represent the FPGA VI?

    is there already a VI that I have not yet found?

    Thanks in advance.

    Hi Mariano76,

    The VI I think you are looking for is "Boolean Array number.  This primitive interprets an array of Boolean integer.  If you must reverse the sign-MSB/front bit for it to go in this function, you can use the function "Reverse 1 table D.  If you want to interpret these hex data in fixed point representation, the cast function is appropriate.  Once the FXP format, you can scale your ADC full scale data (i.e. +/-10V).  You can drag this code in your LabVIEW FPGA block diagram to test.

    See you soon,.

    SPEX

  • Preview.app stuck on the first page of the PDF in single page mode

    I regularly Preview.app view PDF files and want to use the "Single Page" function to display an entire page at one time. I have 'Single Page' display set as the default behavior.

    Lately when I open a PDF file, they properly open the first page, but I am unable to navigate to another page via the drop-down page, touch up/down arrow. If the PDF file has a table of contents, I am able to go beyond the first page through it and then proceed to navigate normally. If it is not a table of contents, the only solution is to continuous scrolling mode and continue to navigate beyond the first page.

    It's very annoying! Unfortunately, I can't remember where this started happening. It could be when I upgraded to MacOS Sierra, but I can't confirm.

    Everyone else see this behavior?

    Hold down the Option/ALT key, then use the cursor to the TOP or to the BOTTOM of the key.

  • to upgrade my iMac yosemite Sierra do I need save iWork applications first and upgrade etc.?

    To upgrade my iMac Yosemite Sierra can I first of all backup and upgrade the iWork etc. applications. ?

    He can't make a backup.  You don't need to do anything else.

  • Date page does not appear first drop the bar down

    Just downloaded the new ios and found that the Notification Center page appears first when you use the new bar drop down. I have to keep pulling down then drag to the right to display date apps, weather, news, etc.

    How can I configure it so that I can view the main page widget first, when you pull down the drop to the low bar and not the notification page?

    Thank you!

    Just drag to the right at the beginning.  No need to blow first.

  • iPhone 6s more does not accept the password for the first time

    All of a sudden my iphone 6 s more, will not recognize and accept my password.

    First screen says: "enter code". "Touch ID requires your access code when you restart the Iphone."

    Question... is equivalent to a 'code' a 'password'?

    Why she would accept my password and then 30 minutes later he rejects?

    Any ideas would be very appreciated.

    Ray

    Maybe nobody over there wants to take this question!

  • soon my first macbook pro purchase. Designer. Help

    Hey there guys!

    I will buy my first Macbook pro soon.

    I am a student of Visual communication, which means that I work a lot with Adobe

    (Photoshop, Illustrator, InDesign, After Effect, esc.)

    I mean, photo-manipulation, illustration, video art... heavy files.

    While Mac should I buy? What CPU? is the difference between graphics cards questions?

    and how it will affect my work?

    Thank you!

    My philosophy has always been to buy the best that I can afford both.  This would mean, for me, a maxed out 15 "MacBook Pro (which is what I bought this last June).

    But I wonder: do you really need a laptop (MacBook Pro) or something like an iMac would work for you?

    You get better performance with the iMac, everything simply because you are not paid for the necessary solidity with a laptop.  You also get a larger screen, faster processor and more memory (32GB available).

  • Since the last update, I can not choose the music I bought for the first download on my phone

    Since my last update, I can not get music on my phone, re upload it, music that I bought in the past

    Hello victoriafromrodeheath,

    I understand you have updated your iPhone 6s more iOS 10.0.2, but you can not access your purchased music. The first thing I would say is to leave the music app, sign out of the iTunes (from the settings app) account and restart your iPhone.  Then try to access your purchased again music.   Here are a few resources to explain this in more detail:

    Force a nearby application on your iPhone, iPad or iPod touch

    Open one session with another Apple ID on your iPhone, iPad or iPod touch

    iTunes, App Store and iBooks

    1. Tap Settings > iTunes and App Store.
    2. Tap on your Apple ID. If you see the Sign In option, you can change your Apple ID now.
    3. Click sign out.

    4. Go to settings > iTunes and App Store.
    5. Press Sign In, and then enter your Apple ID and password.

    Download your latest purchases

    Download a song

    You can redownload the songs on your iPhone or iPod touch, the iPad, Mac or PC. You can listen to the song already purchased on your Apple TV, but they download on your device.

    On an iPhone or iPod touch

    1. Open the iTunes Store app.
    2. At the bottom of the screen, tap more > buy > music.
    3. Press "not on this iPhone" or "not the iPod."
    4. Find the song you want to download, and then type it.
    5. Press the download icon to the right of the title. Your song downloads on your device.

    If you can't download or do not see your last purchase, get help.

    Take care.

  • If I get another identifier apple - do I lose all my data from the id of the first?

    I don't know which community for posting this in so I take a stab at this one.

    If I get an another apple i.d. - do I lose all my data of the first identity?

    data can be transferred to the new ID?

    It's all too confusing.

    Thank you

    M

    It is normally best to change the email address for the Apple ID existing rather than getting a second Apple ID. See change your Apple - Apple Support ID

  • Disk utility first aid operation was unsuccessful and iMac freezes when it is reloaded

    iMac Intel Core (2010) 320 GB 4 GB of RAM.  Running OS 10.11.6

    Started computer, white screen appeared with the icon of a folder with an exclamation mark in the folder.  Nothing else to do, so restarted iMac, hold down the command and 'r' to open disk utility.

    Ran first aid, recommended "incorrect block are 1172 instead of 601.  File system check or repair a failure.  Operation failed. "" "First aid running not a, if possible save the data on this volume.  Click OK to continue. »

    Discount to zero is successful, but screen is frozen with no access to the hard drive.  I can't open the preferences system due to frost.

    The circle of rainbow of spinning of death continues to run so I am not able to get any other repair mechanism.

    Anyone have any ideas on how to proceed?  The iMac is obviously not able to boot to the hard drive.

    This probably means the HD has failed and must be replaced. How you proceed, is to take the computer to your local Apple authorized provider who can help replace the disk and get you back in business. If you are not aware of any local could be held, please click the following link to start to find one close to you.

    https://locate.Apple.com/country

Maybe you are looking for