Store data from the Serial Port in the buffer and then take action?

Hello! Everyone,

I'm new to LabVIEW and I take assistance from various videos and stuffs available online to get started with LabVIEW.

But I have a duty, therefore needing help.

initially I see some of the tutorial videos and learned about the LabVIEW interface, and does a little project to communicate with the Port series (receiving and sending data).

Happens to my task.

My LabVIEW application will send a few State request packets on my device or control and based on the response packet that I have to display values.

The Structure of package is as

Header, length, Op_Code, data Checksum

There is no terminator as newline or carriage return or anything else.

In C language, I read the data from the Serial Port, and based on the length, I conclude that I got the full package or not, and then by recalculating the checksum value, the integrity of the package is verified and then based on that Op-Code has been sent will be decided.

(I'm dealing with hexadecimal data)

But how can I do this in LabVIEW.
A tutorial or any referece will be useful for me.

1. I suggest that you learn to use Shift Registers instead of local and global variables.  They are much more efficient (memory and execution speed) and make it much easier to read the schema.

2. you don't need this inside the loop property node.  Is there a way to configure a Serial Port to turn off the stop character.

3. you don't need to wait for playback VISA will limit the rate of loop if no data is coming.

4. Once you have the length, you simply read the rest of the entire message and process it at a time.  This will make things a LOT faster.

5. you should really do this enum a def type so that you can ensure that all your enum constants have the same values.  If you need to add a State later, simply update your enum in the same place then.

Tags: NI Software

Similar Questions

  • read data from a serial port

    Hello to everyone
    I use oracle forms 6i. I want to read data from a serial port. How can I do this?

    HII,

    You may search for any existing OCX or VBX component capable of doing this job.

    Better compliance
    Skyniazi

  • you want to send data using labVIEW to arduino using write visa and the process and to take action using arduino. A

    I want to send data using labVIEW to arduino using write visa and the process and to take action using arduino. After that, I want to arduino to send out necessary via a serial port to labVIEW which should be read using visa read and store in a chain. While I am able to write or read both individually, I can't do it consecutively. I used advanced read and write vi for checking my code, but nothing is helping. The wrong bed 'time delay before execution. " Please let me know where I can go wrong. Also is it possible to write code for hx711 using labVIEW

    1. you need not "\n" on your orders println().  This command adds an end of line character already in the message.

    2. you get the error because you have a loop around your reading.  After the first reading (well technically, the second because of you add an extra line end character), there is nothing left in the port.  As a result, you will get the timeout.

    3. you should really consider using a Structure of the event.  This way you just don't write and read when you press the Write button and you can also use the structure of the event to make the loop to stop.  I also go up to close the port inside the stop-> value Change event.

  • I've implemented all the information for an email from the Charter and then when I click on get mail, it says there is a connection to the server error... Why?

    I've implemented all the information for an email from the Charter and then when I click on get mail, it says there is a connection to the server error... Why?

    Hello ChevyDriver10,

    Thanks for your post.  What email app do you use to receive your mail?

    In the meantime, take a look at the Charter of General electronic installation instructions.

    If you do not currently have an e-mail client, feel free to go on Windows Live Mail.

    See you soon

  • Transfer of data from the old and new Mac

    Hi folks, I'm acquires a new iMac, PC (with Retina 4 K display 21.5 inch iMac) to replace my current iMac (21.5 inch, mid 2010). I sold my existing iMac and will have to ship power off before receiving the new unit, ergo, I won't be able to use the method of transfer of my data from the old to the new Mac.

    Accordingly, I am looking help form to advise me how can I do to preserve my existing Mac data so that I can install on the new Mac. In addition, how to delete all my data from the old Mac but preserve the OS X (El Capitan) and relevant applications.

    All of the advice and recommendations will be greatly appreciated

    1. create a Time Machine backup or clone bootable on an external drive, and then migrate your data from it.

    2. you need to remove El Capitan of the old Mac before send you it off and return it to the most recent of its original operating system or 10.6.8.

    (137493)

  • Save the data on the button and then save the data on a spreadsheet on another key.

    Hello

    I am a new user of Labview. I'm developing a Labview 7.1 program that will record data on the keys. Another button, he must stop recording, and then open a file dialog box to save the data stored on a worksheet. I read in this forum that I have run several loops in parallel but unfortunately I can't see the examples because I use an older version of Labview. I tried to do to pass the data in a table, once recording is started, and then I carry the data to write a function that spreadsheet inside an another case statement. However, once I put the writing on the spreadsheet for the case statement he cannot write. I tried to put out the statement box but it save only a single set of data. Sorry if I am not clear with my explanation. It will be greatly appreciated if someone can give me some advice on this.

    Thanks in advance for your information.

    See you soon,.

    Anson

    You want to build a table of data.
    If the Boolean value is true, you will add a data point in the table.

    If it's wrong, you do not add anything, and the loop will be re-iterate.

    In the example below, the same code appears twice.

    Half top shows the case of 'Real' and the bottom half shows the case of 'false '.

  • Disadvantages of the default tablespace using to store data from the partitioned table?

    Can someone tell me, are there disadvantages, performance problems using default storage in oracle?

    I not create any tablespace during the creation of the database, but all the data partitioned in a tablespace named 'USERS' default... I will continue using the same tablespce...? I'm storing the data in the table where the growth of the table will be great... it can contain millions of records...? It will produce no degradation of performance? Suggest me on this...

    Different storage areas for administration and easier maintenance. In some cases for performance reasons so different disks are representative to the database (fast and not so fast, different levels of raid...)
    For example if you have several diagrams of database for different applications, you may want to separate schema objects to different storage spaces.
    Or, for example, you want to keep in database read-write tablespaces and just only read. Read-write tablespaces with the data files will be on very fast disks, read only the cheaper and perhaps more slowly (not required). Again separate tablespaces makes this very easy thing to do.
    Or you would like to keep separate indexes from tables and keep them in a different tablespace on the different mountpoint (disc). In this case probably better is to use ASM, but it's more than a reason to separate.

    And in your case-, it may be easier to manage if you create a new storage space for these new objects.
    For example:
    1 storage space for small tables
    1 storage space for small index
    1 storage space for large tables
    1 storage space for large index
    and so on. All depends on your particular architecture and database data growth and what you do with these data after a year, two years, three...

  • data from the buffer before graph it and block size

    I hope you can help me with this situation because I was collapsed in this situation for two days and I think I see the light in the short time and time is a scarce resource.

    I want to use a NI DaqCard-HAVE-16XE-50 (20KS/sec accordig to the specifications). For data acquired by DasyLab, I use OPC DA system but when I try to get a graphic from the signal I get ugly results.

    I guess the problem is that the PC is not powerful to generate a graph in real time, is if there is a block to save the data, then graph the data without using "write data" block to avoid to write data on the disk?

    Another cause of the problem, it might be an incorrect value for adjusting the size of block, but in my piont of view with the 10 kHz and 4096 block size is more than necessary to acquire a signal of 26 [Hz] (showing the photo). If I reduce the size of the block to 1 signal showing in the graph is a constant in the first acquisition value. Why might this situation?

    Thanks in advance for your answers,

    You don't want to use OPC DA for a device installed with the material. OPC DA is designed for industrial devices low speed, not for cards installed 20 kHz!

    Rerun setup of DASYLab and select the OR-DAQ driver, deselect the NOR-DAQmx driver.

    You must use the analog input OR-DAQ module for talking directly to the camera. You will get the full speed of the device, and the buffering is managed properly.

    I have this card somewhere in a box, and when I used it, it worked perfectly with the NOR-DAQ driver.

  • What is the best way to move the data from the app and Server data structures?

    Hi guys,.

    I developed my application locally with Apex 4.2 and Oracle 11 g XE on Windows 7. Not far away, it is time to move the application to a server Oracle Apex. I guess that Exim is the way to go app. But what about the APA tables and data (tables/as 'customer' and 'account' created specially for the application)? I've been using a modeling tool, so I can run a DDL script to create the database server data structures. What is the best way to move the application data on the server? Is it possible to move the structures and data in a single process?

    Thank you
    Kim

    There is probably another way to get here, but in Developer SQL, on the navigation tree, expand objects until your table, right-click, and then click EXPORT... you will see all the options. It is a tedious process and it sucks IMO, but yes, it works. This is zero especially because 1) it's a table at a time, 2) If your data model is robust and has constraints and sequences and triggers, then you will need to disable all for the insert and we hope you can re-enable constraints, etc. without hitch (good luck, unless you have only a handful of tables)

    I prefer to use the oracle EXP command-line to export an entire schema, then the server target, I use IMP to import the schema. In this way, it is almost true. This makes the dirty life if you develop multiple applications in a single schema, and I felt pain - however - it is much easier to drop the tables and other objects is to create them! (thus, even if the process of EXP/IMP moved more than you wanted to "move".. blow everything you don't want on the target after the fact...)

    You can use method datapump oracle too.

    If not, what can be done, IF you have access to both servers of your instance of SQL developer (or if you can tnsping both already from the command line, you can use SQL * MORE), is to run a script that will identify the objects of your applications apex (usually by the prefix for the names of objects, such as % EBA_PROJ_ etc.) and do all the manual work for you. I've created a script that does just that so that I can pass data from dev to prod servers on a dblink. It is difficult because of the order that must be executed to disable constraints and then turn it back on and of course, more complicated if don't always precede you ALL your "objects demand '... (tables, views, triggers, sequences, functions, procs, indexes, etc.)

  • Question of package data from the horizon and ThinApp

    Hello

    I have a question about ThinApp packages. I added the package in the ThinApp repository and sync in Horizon workspace. Everything was green and succesfull without alerts.

    When I installed the Client of Horizon Workspace on my laptop, I got the message "error package; Cannot install Total Commander 8.5. "Cannot copy the file: the network path was not found" (I have translated from the Czech version of OS)


    Files in sync between my laptop and HW works, but not applications.


    What should I do to correct the problem with ThinApp packages?


    Hi Black

    If you use the installation program (running in a Windows command window) command line, instead of install by double-clicking the EXE file, you can set various options, including the installation mode.

    Command line Setup is described in this topic Center doc Horizon Workspace:

    http://pubs.VMware.com/horizon-workspace-18/topic/com.VMware.HW-administrator.doc_18/GUID-625C0C94-1F66-47a3-BD36-B2CBAE8FEDB3.html

    For example, in a command prompt window, to install with install mode using HTTP download, you will run:

    VMware-Horizon-workspace - 1.8.0 1800-165331 .exe /s

    /v HORIZONURLhttps:// = yourHorizonURL INSTALL_MODE = HTTP_DOWNLOAD

    Are these packages of ThinApp 64-bit? Is the Windows 64 - bit Windows where you installed the client?

  • Get the data from the file and display it in a dynamic text box

    The purpose of this function is to load and display a specific menu for a restaurant (lunch, dinner, dessert, etc.).

    This script is inside a clip that has the text box and buttons.

    There are 4 buttons that have event listeners that go to a function that determines which button was pushed and then sends a call to loadMenu with a string that has the file.txt.

    In frame 1 of the clip, the variables used in the code are declared as such:

    var newMenuRequest:URLRequest = new URLRequest();
    var newMenuLoad: URLLoader = new URLLoader();
    var loadThisMenu:String = ""; This is the variable of the function buttonclick modifies and defines as the string to send to the loadMenu.

    My error is 1195: any attempted access of inaccessible method with flash .net url: URLRequest of static type

    Any ideas?

    newMenuRequest is an instance of a URLRequest... and it is not a method of url.
    She has a url property.

    I'd be inclined to create a new URLRequest every time. But perhaps this isn't necessary.

    Try changing
    newMenuRequest.url (menuName);
    TO:
    newMenuRequest.url = menuName;

    see if it works.

  • Bigger disk-swapping, but down two, possible to remove them from the table, and then expand?

    I have a R710 with a PERC 6 / i, Win 2008 R2 running. I have a small disk for the operating system, the other 5 bays are filled with 1 TB disks in a RAID array-5.

    I need to add more storage, so I want to buy three discs of 3 TB. I plan on the withdrawal of old readers, and then put it in the new, bigger. I assume that it will take 1 of the 3 TB and repair. Leaving free 2 TB disk. Repeat this step twice more, which will result in three discs of 3TO with 6 TB of disk space not used in the RAID.

    Is it possible to have the controller expand storage in my table of RAID-5 existing free space, and then delete the two remaining 1 TB disks in the array?

    Who is? Is it still possible? Or do I have to backup the data on another storage device and delete the table and simply start a new one with the three discs of 3 TB and copy the data back?

    This will not work:

    (1) the PERC 6 won't take 3 TB drives; the maximum size is 2 TB.

    (2) you cannot delete records in a table - your RAID 5 5x1TB must always have records of 5 or more (you can add without deleting).  Even when using the same number of disks, isn't it possible to do the smaller table/VD.

    (3) even if you used 2 TB disks, there is no way to expand the RAID 5 using the extra space on the disks - with 5 disks in RAID 5, it will remain the same size. The only thing you can do with the new space is to create a second RAID array on the disks (called "slice").  This new VD is handled by the operating system as another "drive."

    Keep in mind if backup and restore in a larger painting, as if the VD ('disc') is greater than 2 TB, the disc "" MUST be converted to GPT and active UEFI bootmode (instead of BIOS).  Make sure that your backup software is capable of restoring one using the BIOS install on a system UEFI (and the 'disc' TPG 'disc' MBR).

  • My WiFi will only connect if I run the convenience store that corrects the problem, and then I'm ok

    My settings are set to auto connect, but lately it does not connect automatically. It is said to run the troubleshooter.  I start the game of shooting and it solves the problem and I am running. My problem is that I have to do this every time I open my laptop.

    Hi Mike,.

    Thanks for posting your query in the Microsoft Community Forums.

    After the description of the question, I understand that you have problems with wifi on the Windows 7 computer connections.

    I understand this must be frustrating, but don't worry, we're here to help and guide you in the right direction.

    I suggest you to update the network driver and check if it helps. See step 4 of section for help to update the drivers.

    Wireless and wired network problems

    http://Windows.Microsoft.com/en-us/Windows/network-connection-problem-help#network-problems=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    It will be useful.

    Let us know if you encounter problems with Windows in the future. We will be happy to help you

  • Read data from the Table and load it into the csv file

    Hello

    I would like to read a table (select * from employees) and load the data into a csv file.

    What methods are available?

    Records will be at high volume.

    Thank you

    If it is to do a lot, use APEX.

    Create a new page with an interactive report based on the SQL code you want. When you go to download Excel, it is actually a CSV file.

    If it is large, you may need to go on the FILE_UTL road.

    If it is only once, use an interface such as SQL tool * or SQL * Developer.

    If it's a learning experience, you must do all three.

    MK

  • How to change the data from the database and displayed in a DG

    Hello, it's me again with a simple question:

    I received the request of SQLi that returns multiple lines.

    In this line, I have for example:

    Reward-> 1

    How, instead of show 1 in the data grid, change this value to 'YES '.

    I followed this thread:

    private void onResultStats(event:ResultEvent):void

    {

    ServerStatsArr = new ArrayCollection (event.result.source);

    for (var i: int = 0; i < ServerStatsArr.length; i ++)

    {

    If (.abonnement ServerStatsArr [i] == 304) {}

    ServerStatsArr [i] .abonnement = 'Premium ';

    } else {}

    . Subscription ServerStatsArr [i] = 'no ';

    }

    If (ServerStatsArr [i] .transparence == 1) {}

    . Transparency ServerStatsArr [i] = 'yes ';

    } else {}

    . Transparency ServerStatsArr [i] = 'no ';

    }

    }

    ServerStatsArr.refresh ();

    }

    Why this method works for the subscription when (.abonnement ServerStatsArr [i] == 304) he displays Premium, but it does NOT work for transparency ?

    I tested (.transparence ServerStatsArr [i] == 1) and (.transparence ServerStatsArr [i] == '1')

    Thank you

    Hi again,

    private void setLabel(item:Object,column:DataGridColumn):String

    {

    Switch (Column.DataField)

    {

    case 'transparency ':

    If (item.transparence is "1")

    return ('yes')

    on the other

    return ('no')

    break;

    case "subscription":

    If (item.abonnement is "304")

    return ("premium")

    on the other

    return ('none')

    break;

    by default:

    Return("");

    }

    }

    and your grid adjustments - add the labelfunction to the following topics
    I hope we get a credit of distinction for this mission...
    David.

Maybe you are looking for