Reading and saving data of two serial ports

Hi, I googled similar questions in the forum, but I don't have an answer for my problem so I'm posting it here.

I would read and record data of two balances throgh serial ports. I have a drop down menu in VI, I can choose the availabe ports on my pc. But it is still only one that works. So I only get one data scales them.

I usually get to choose 6 ports, but only one of them works. So I'm wondering if this is something that has to do with my pc or the VI?

I've attached a screenshot of my VI.

Thank you =)


Tags: NI Software

Similar Questions

  • 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.

  • 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

  • How to periodically send various types of data via the Serial Port?

    Hello! Everyone

    I have to send data to LabVIEW to my device on the Serial Port.

    I know how to send data on serial port in LABVIEW, I already have this part.

    Now the problem is that I have several types of data I need to question my embedded device, if I want to send the query periodically command.

    So lets say that my four Op Codes are the following, which will send four different types of query command to my device on the serial port.

    (To be honest only OP_LED and OP_SENSOR is used now)

    0, OP_SYNC

    1, OP_LED

    2, OP_SENSOR

    3, OP_FUTURE

    Structure of basic package is as follows:

    Header (0x2C), Checksum, length of the data (n bytes), Op_Code (1 byte), length (length of Code + data Op)

    For OP_LED, I need to send the package as follows:

    0x2c 0x02 0x01 0 x 00 0x2F (0x2F being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    Length of the package this is 0x02

    0x01 is Op Code for OP_LED

    In the same way

    For OP_SENSORi need to send the package as follows:

    0x2c 0x03 0x02 0x00 0 x 00 0x2D (0x2D being the XOR checksum) (calculation of Checksum part is done and SUB Vi form)

    0x03 is length of packet here

    0x02 is Op Code for OP_SENSOR

    So, how can I do this periodically in labview, in such sort that period can be adjusted whenever necessary.

    Is there something in LabVIEW to do.

    I had done the reception and decoding part and working properly.

    http://forums.NI.com/T5/LabVIEW/store-data-coming-from-serial-port-in-buffer-and-then-take/m-p/32722...

    So I must implement read and write the part of same while loop?

    Do not insert in the table if you put data in an array at index 0.  Just use array to build.

    No need to have Visa to write don't be a part of wire to the wire of reference and error VISA go in the upper part.  These wires should go THROUGH the entry VISA.

    Don't your checksum requires all the bytes up through data?  Righ now, you only put the checksum on data bytes and forget the opcode and length bytes.

    Your sending is not the opcode for Opsync or Opfuture.  You just send the empty tables.  At the same time for the other two, you put the opcode in the data table.  All your original opcode in the table build thread.  Get the data out of these structures in case item which is supposed to represent the opcode.

    xpress_embedo wrote:

    Now it works but I have now two problems.

    (1) OP_SYNC and OP_FUTURE do not data, but still receive its data on serial port, can I do something here as I have nothing when the table is empty in the structure of the case.

    I do not understand this statement.  Perhaps my answer above will fix any issue you have here.

    (2) how can selection operation Code to be send is done using control façade but real application, this task should be automated to a certain frequency, like OP_LED package must go out to the serial port to 100msec and packet OP_SENSOR must go out to 1000msec, I do this.

    Now you agree a little more architecture.  I would encapsulate the code that is in the while loop as a Subvi.  Then with the hand of your program while loop, use two time Express VI, a game for 100 msec, the other for 1000 msec.  When an express VI is true, run the Subvi with a command set waiting for the answer.  When the other VI Express is true, have it run the Subvi with the other set of commands.

    The device responds with anything when you send these commands?  You only send data.  I see no VISA Read to be able to recover all the data.

  • Send and receive data via the Ethernet Port?

    Hello

    I am trying to acquire details of LAN/Ethernet from the PC through LabVIEW.Like details, we get the date & time, etc Serial Port system, is it possible to get the details of my PC via LabVIEW.My LAN aims to sebd and Receive via Ethernet Port command.

    The last time I did it, I used the range of tcp. (I go ctrl + space for quick menu then type tcp). Open a connection to the network device, and then use tcp read/write, depending on the case. There are examples that can be very useful

  • How to convert string data from the serial port to double?

    Hello!

    I am very new in LabView and attempt to read data from an OHAUS pioneer pa-313 electronic scale via RS232 serial port. I use the VISA. I can read the data and see it as a string to the screen, but when I try to convert it to a double, it is just the integer and decimal numbers have disappeared. Here's the question: what can be the problem? How can I get the decimals as well?

    What is your normal decimal point?. or?

  • global variable functional to read and write data from and to the parallel loops

    Hello!

    Here is the following situation: I have 3 parallel while loops. I have the fire at the same time. The first loop reads the data from GPIB instruments. Second readers PID powered analog output card (software waveform static timed, cc. Update 3 seconds interval) with DAQmx features. The third argument stores the data in the case of certain conditions to the PDM file.

    I create a functional global variable (FGV) with write and read options containing the measured data (30 double CC in cluster). So when I get a new reading of the GPIB loop, I put the new values in the FGV.

    In parallel loops, I read the FGV when necessary. I know that, I just create a race condition, because when one of the loops reads or writes data in the FGV, no other loops can access, while they hold their race until the loop of winner completed his reading or writing on it.

    In my case, it is not a problem of losing data measured, and also a few short drapes in some loops are okey. (data measured, including the temperature values, used in the loop of PID and the loop to save file, the system also has constants for a significant period, is not a problem if the PID loop reads sometimes on values previous to the FGV in case if he won the race)

    What is a "barbarian way" to make such a code? (later, I want to give a good GUI to my code, so probably I would have to use some sort of event management,...)

    If you recommend something more elegant, please give me some links where I can learn more.

    I started to read and learn to try to expand my little knowledge in LabView, but to me, it seems I can find examples really pro and documents (http://expressionflow.com/2007/10/01/labview-queued-state-machine-architecture/ , http://forums.ni.com/t5/LabVIEW/Community-Nugget-2009-03-13-An-Event-based-messageing-framework/m-p/... ) and really simple, but not in the "middle range". This forum and other sources of NEITHER are really good, but I want to swim in a huge "info-ocean", without guidance...

    I'm after course 1 Core and Core 2, do you know that some free educational material that is based on these? (to say something 'intermediary'...)

    Thank you very much!

    I would use queues instead of a FGV in this particular case.

    A driving force that would provide a signal saying that the data is ready, you can change your FGV readme...  And maybe have an array of clusters to hold values more waiting to be read, etc...  Things get complicated...

    A queue however will do nicely.  You may have an understanding of producer/consumer.  You will need to do maybe not this 3rd loop.  If install you a state machine, which has (among other States): wait for the data (that is where the queue is read), writing to a file, disk PID.

    Your state of inactivity would be the "waiting for data".

    The PID is dependent on the data?  Otherwise it must operate its own, and Yes, you may have a loop for it.  Should run at a different rate from the loop reading data, you may have a different queue or other means for transmitting data to this loop.

    Another tip would be to define the State of PID as the default state and check for new data at regular intervals, thus reducing to 2 loops (producer / consumer).  The new data would be shared on the wires using a shift register.

    There are many tricks.  However, I would not recommend using a basic FGV as your solution.  An Action Engine, would be okay if it includes a mechanism to flag what data has been read (ie index, etc) or once the data has been read, it is deleted from the AE. 

    There are many ways to implement a solution, you just have to pick the right one that will avoid loosing data.

  • Read and write data to the content repository.

    Hi all
    We use the content repository to store a document and images on the web server in the Center.
    So we have created/setup a repository of content on the web center.
    Please proivde me some might document page to get an idea of how I can read and write the date
    content repository.
    You are most welocme to provide some idea /suggestion.
    Thank you
    Arun.

    You are using webcenter spaces or you create a custom application webcenter?

    When you create a custom application webcenter, you can make use of the workflow Documents. Jdeveloper resources catalog, you will find a few flows of Documents job that will allow you to add some components to manage documents in a folder structure.
    You must first create a connection to your content from your application server. This can be done in the Application resources, right-click on the connection and in the context menu, select "content repository". Them you must filll in connection to your content server details. Make sure you have selected "Set as primary connection for document service" because otherwise the document taskflows you deposit on your page will not find a connection.

    Once you have added the connection, you will also find a datacontrol to the content repository. In this way, you can use the datacontrol place the taskflow and you can create several custom tables.
    I'm not sure but I think the datacontrol also include surgery to create the document but I'm not sure...

    And if not enough, you can always do use the webservices provided by content server. In Jdeveloper you can easily create a datacontrol from Web services by providing the wsdl file. UCM provides for services so that you can import the wsdl into your application and you can easily create your own forms checkin, tables...

    Here is some information on how to integrate services document:
    http://sqltech.CL/doc/oas11gR1/WebCenter.1111/e10148/jpsdg_doc_lib.htm

    and here are some others:
    http://sqltech.CL/doc/oas11gR1/WebCenter.1111/e10148/jpsdg_content.htm#BABCCFJH
    http://sqltech.CL/doc/oas11gR1/WebCenter.1111/e10149/documents.htm#WCSUG2635
    http://sqltech.CL/doc/oas11gR1/WebCenter.1111/e12405/wcadm_documents.htm#WCADM205

    Published by: Yannick Ongena on Oct 8, 2010 08:23

  • Reading and writing data XML of BC4J

    Hello!

    I try to reproduce "27.7 reading and writing XML data" chapter of 'Developer Framework of developing applications for forms/4GL developers's Guide. "
    Our intention is to read and write at first only XML.
    However, it seems that we need this chapter a database connection.
    To shorten this assessment - is it possible to adf bc only with xml?

    Kind regards
    Torsten

    The solution is described in "27.8 Using programmatic view objects from other Sources of data" in the doc you mentioned. If you use programmatic EO/VO you can do almost what you what to store data. We use xml for some data (but always store in the DB) and read it.

    Timo

  • Sending data through the serial port and the mscomm control is not the same as the original data

    Please find attached the mscomSerialWrite2.vi and the resulting image.

    Try it and find that when data "FFAE" 4040 EA41 D8FF is sent,

    the received data are "FFAE" 4040 EA41 3F

    I tried other data, the result is as follows:

    sending: 4164 8163 4341 03 receive: 41 64 81 63 43 41 03 leadK
    sending: A143 B245 6AAA BBCC receive: AA BB 00 A1 B2 45 6a 43 result: NG
    sending: AAAA AAAA AAAA AAAA AAAA AAAA receive: result AA AA AA AA AA AA AA AA AA AA AA AA K
    sending: A1A1 A1A1 A1A1 A1A1 A1A1 receive: result A1 A1 A1 A1 A1 A1 A1 A1 A1 A1K
    Send: FFAE 4040 EA41 D8FF receive: FF AE 40 40 41 EA 3F result: NG
    Send: FFAE 4040 EA41 D8FF AA23 AB33 A233 AAAA A404 ABCD A2CD A22D B22C receive: FF AE 40 40 41 EA 3F 3F 3F 3F AA AA AB CD A2 CD result 3F 3F 3F: NG
    Send: FFAE 40A 2 SDAC AETS receive: result FF AE 40 A2 CC DD EE 00: NG

    Please help me solve the problem.

    According to Microsoft, you want something with non-printable strings as an array of bytes, not a string.  I don't know that it will make a difference in this case, but may be worth a try.

  • storage, reading and writing data to the file

    Hello world

    I am new to the Labview and his community.  Asked me to acquire data on the measurement of the pressure using Labview.  I could build the code and got it working, but when I look at my data that has been collected, there no stopping point.  I just spent a lot of time looking at the data in the place where it begins and where it ends.  The question I ask is how to create a code to read the pressure, storage, in memory until there finishes, collect data and then to write in a .csv file.

    I use the NI USB-6009 case and hook upwards to ai0 and ai4.  See the attached code so uncertain.

    I want to record 100 data points and the system stops after these collection.

    Thank you

    John H.

    You have a certain time which means your VI will continue to run until you press your button to stop the loop.

    The DAQ Assistant is already set to 100 samples.

    Just delete the while loop!

  • read and receive data from the server

    Hi all

    I want to develop an application that extract data related to the content of the server, how to do? I read somewhere stating this task requires sdk server push? is it possible do not use push sdk server and the server reading so that I don't have install anyting from the server.

    Your Web service code decides how much data you send or receive from the customer.

    For example, you can have a Web service method, which returns records to a particular date, then you must create a web service method that accepts a date to a string as a parameter and a request for service records of server request, write resultset in encoding (like xml, json, etc) and return this string as a response to the client client will read the data as a byte array, then converts the byte array to the string and according to the encoding defined by service will analyze data of interest.

  • RTF (reading and saving)

    Dear patients, all assistants

    My current project is "re-treatment" the FameMaker to EndNote' connection. This task includes several steps:

    1. Collect temporary citations (for example [stew, 1969, #123]) text, notes and tables in a table. This part already works very well (I had to delay further development for a year now...).
    2. Then, I write these data to a new document (which is created from the template) - with your help, this came to work today.
    3. Then this file is saved in RTF to work the bibliographic request endnote (or Citavi in another case) to resolve the temporary visas in the formatting of citations and the bibliography.
    4. After that the updated rtf is opened as a docment FM. The information of these are used to replace the temp. quotes on document/book of the user by formatting citations.
    5. The user then copy the bibliography (text only) in its appropriate chapter/section and formats to his liking.

    For step 3, I now did much research and found this:

    • App. ExportFilters does not provide a list of the filters as described in the Guide to FM script.
    • FrameScript Johannes Graubner wrote:
      SAVE the Document DocObject (docVar) leader (ofilename) FileType (SaveFmtFilter) FilterFormatID('RTF');
    • Talk on channels filetype FDK (FDK - PG) programmers Guide informed suspicion of ID format "RTF". But how to use this in eScrpt?
    • The file type indicator string syntax in FDK - PG gives some information, but which seller code must be used to RTF?
    docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
    params = F_ApiGetSaveDefaultParams();
    i = F_ApiGetPropIndex(&params, FS_FileType);
    params.val[i].propVal.u.ival = FV_SaveFmtFilter;
    i = F_ApiGetPropIndex(&params, FS_SaveFileTypeHint);
    params.val[i].propVal.u.sval = F_StrCopyString((StringT)"0001ADBEHTML");
    
    • Somewhere else () channels tip for the standard installation of filters) FDK - PG says: RTF Microsoft = > 0001AW4W0191
    • Other information can be found on indication of filtering RTF 1.6 revealed! : "0001ADBIRTF"

    So my interpretation of what led to this excerpt:

    var file = app.ActiveDoc;
    SaveFileRTF (file);
    
    function SaveFileRTF (file) {    
      var params = GetSaveDefaultParams();
      var returnParamsp = new PropVals();
      var i;
      
      i = GetPropIndex (params, Constants.FS_FileType);
      params[i].propVal.ival = Constants.FV_SaveFmtFilter;
      
      i = GetPropIndex (params, FS_SaveFileTypeHint);
      params[i].propVal.ival = "0001ADBERTF ");
      
      file.Save(file.Name, params, returnParamsp);
      return;
    }
    
    

    But alas, this Signals a stange error: "expected semicolon on line 13. Even if you help me overcome this next swamp hides in step 4: how to open the RTF?

    Hello Klaus, it works for me 12 FrameMaker. Please let me know if you have any questions or comments. -Rick

    #target framemaker
    
    var doc = app.ActiveDoc;
    saveRtf (doc);
    
    function saveRtf (doc) {
    
        var saveName, saveParams, retParams, i = 0;
    
        // Get a property list to return any error messages.
        retProps = new PropVals();
    
        saveProps = GetSaveDefaultParams();
        i = GetPropIndex (saveProps, Constants.FS_FileType);
        saveProps[i].propVal.ival = Constants.FV_SaveFmtFilter;
        i = GetPropIndex (saveProps, Constants.FS_SaveFileTypeHint);
        saveProps[i].propVal.sval = "0001ADBIRTF ";
    
        saveName = doc.Name.replace (/\.[^\.]+$/, ".rtf");
    
        doc.Save (saveName, saveProps, retProps);
    
    }
    
  • Do form extended PDF reader and send data in it.

    Hello

    I'm trying to do the following thing:

    I have a number of forms (May 10) I'll create with LiveCycle Designer (or more if necessary). I am able to get the form data as an XML file, and I am able to do the 'extended player' form with Acrobat.

    However, I am not able to push data into the form whitout losing the capacity of extended drive to save the form because I use a library open spource to push data into the form.

    How can I do this without losing the possibility to save the form? Y at - it software/service from Adobe that does this?

    In addition, I do not understand the restrictions on the drive extended when you use Acrobat as oppose to the service. How the 500 limit is counted? If I create the form, send by e-mail and then people will return the completed form back, and would automatically retrieves the data is there a limit on that?

    Thank you

    Simon

    OK, understood. Then, you're to LiveCycle Forms and LiveCycle Reader Extensions.

  • Read and display data in series

    Hi all

    I use LV2013. I created a VI that reads the value of the measure and display in a waveform graph. The measured values are transmitted continuously but to form an image (using a specific algorithm), each image requires 144 measurement values. The process is repeated to form another image with another of 144 measured values. My question is: How do I verify that I will not fail of all measured values? Currently I apply a loop with 144 iterations. Is this a correct way?

    Thank you.

    Because you have a loop in the 2nd loop that takes any element you just removed and creates an array of 144 of the said elements.  Why?

    You don't need the timeout on your waiting for what you are doing.  It's better if you have the producer loop send a signal to the consumer to tell him to stop treatment.

    See attached changed VI.

Maybe you are looking for