Project select data from the serial port

Hi everyone,
The project is about use labview to receive data from a serial
port wirelessly. The serial port will receive two values (X1 and X2) every 10
minutes. I want to use those two values as two inputs for my formula. How to
make selection? Many thanks.
Baicy
Solved!
Go to Solution.
Attachments:
port read.png ‏23 KB

Scan From String.
Using the first option, and putting some numbers in for the zeroes so it shows some kind of meaningful result.
Attachments:
Example_VI.png ‏12 KB

Similar Messages

  • How to retrieve data from the serial port and decode it each 2 bytes is a long variable and 1 frame is about 6 bytes

    I send the frame by a microcontroller ( 8bits) the fram contains 6 bytes, 2bytes conform a long variable, I want to decode the frame and make operations with these long variables and then plot them

    Hey jpvans,
    I would first suggest using NI-VISA to talk to the serial port. Then, you can use the LabVIEW Type Cast or the Flatten to String and UnFlatten From String VIs to convert the data.
    You can setup the read so that it reads just two characters at a time to form an individual long or you can set the read up to read it all and then use the string functions like String Subset to cut the information into chunks.
    I hope this helps out.
    JoshuaP

  • Hello!!!I need to read some data from the serial port and processing these, at the same time I want to see the process that I am doing.

    I read the data without problems, and I see them using Waveform graph, the problem is that I want to see the real time stamps, but in the graph appears 2:00:00,000 and 01/01/04, so the date and the time is wrong !!
    Can I change this?
    I am thinking that the problem is that I have to adquire the data and the time stamps ( using Get date/time) and after, I have to represent both!!!
    Thanks!!!

    Hello,
    As you probably know a waveform is made of a beginning time (t0), a time difference between each value (dt) and an array of values (Y). Your problem is probably that you don't initialize t0. Use the Vi 'Waveform->Build a waveform' to initialize the time of the waveform.
    Hope this helps !
    Julien

  • I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadshee​t. Any ideas?

    I've got the labview vi written to read my IMU data from a serial port in COM1 and it displays onto the table on the front panel. I'm having trouble getting this data onto an excel spreadsheet. Any ideas? Right now my data will collect one reading instead of continuously reading my IMU which displays data in a continuous stream.
    Thanks
    Attachments:
    Read_IMU_Drew.vi ‏21 KB

    Hi
    Your vi is in 2009 version, which i am unable to open in 8.6
    However, if you want your data to be saved in excel sheet, here is the VI
    Somil Gautam
    Think Weird
    Attachments:
    save to excel.vi ‏12 KB

  • How to read and write from the serial port using java

    can anyone tel me how to capture data from a serial port and display on the screen and also store it in a database.

    Java Comm API, JDBC

  • Why does a standalone program created in Labview 8.5 try connecting to the internet when the program only reads data through the serial port? Firewalls object to progams that contact the internet without permission.

    why does a standalone program created in Labview 8.5 try connecting to the internet when the program only reads data through the serial port? Firewalls object to progams that contact the internet without permission.
    The created program is not performing a command I have written when it tries to connect to the internet, it must be Labview that is doing it. How do I stop this from happening? 
    Any help would be very appreciated.

    It looks that way..
    "When LabVIEW starts it contacts the service
    locator to removes all services for itself. This request is triggering
    the firewall.This is done in case there were services that were not
    unregistered the last time LabVIEW executed- for example from VIs that
    didn't clean up after themselves"
    This is not yet fixed in LV2009.
    Message Edited by Ray.R on 11-04-2009 12:25 PM

  • MEASURING FORCE ON BALANCE USING AN ELECTRONIC BALANCE FROM THE SERIAL PORT

    Hi,
    I am trying to measure FORCE using an electronic BALANCE from the serial port. My measurements are strange! The BALANCE sometimes give ZERO reading! Is it because of the sample rate, baud rate etc? I have attached the readings concerned.
    Attachments:
    databalance.doc ‏144 KB

    I think your problem is due to the way you read the weight :
    1/ask the balance to send the data
    2/oversee the byte number on the serial port until it is constant
    3/read the bytes received
    4/convert to number
    During step 2, you compare the bytes at serial port with the previous value. So far, you have been very lucky to be able to read something : the answer here is always ZERO since the readings occur BEFORE the balance has been able to send anything! means that your loop stops immediately (if you are not convinced, jujst add an indicator to display the loop index. However, since you added a wait (0.8 s), when going to step 3, the balance has had some time to send something. Here, you should not have read again the number of bytes at serial port, but that unwillingly corrects the previous error and you can read most of the received data...
    You should modify completely your algorithm. Usually, a balance send the weight as a string with some terminator (RC or LF). Accordingly, the algorithm should be :
    1/ask the balance to send the data
    2/read the serial port, concatenating the received chars until a terminator char is received or a timeout has occured
    3/convert to number
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • I want to transfer data through the serial port in the same coding that hyperterminal uses. How can i do it?

    The serial port seems to be working, and labview seems to be sending the data, but the problem is in which format does it send the data, because in hyperterminal i just input the string "JDX" and it sends it to my device, with labview it sends something but my device does not recognize it.

    nobuto wrote:
    > I want to transfer data through the serial port in the same coding
    > that hyperterminal uses. How can i do it?
    >
    > The serial port seems to be working, and labview seems to be sending
    > the data, but the problem is in which format does it send the data,
    > because in hyperterminal i just input the string "JDX" and it sends it
    > to my device, with labview it sends something but my device does not
    > recognize it.
    Hyperterminal adds the carriage return/line feed to the string which is
    generated by the return key to send out the current line. LabVIEW simply
    sends out what you tell it, so try to set the string to "Show \ Display"
    format and add a \r or \n or \r\n to the command you want to send out.
    Assumes of course that you set the right baudr
    ate/bits/parity etc in
    LabVIEW with the VISA property node, when opening the serial port.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Reading a whole frame from the serial port

    I have posted before about my attempts to use the serial port (http://forums.ni.com/ni/board/message?board.id=170&thread.id=387410).
    Anyway, I want to connect an external device through using VISA. It uses a protocol that exchanges frames. My main program is a series of while loops going through the different echanges, it sends one frame, waits for the proper response, sends the frame again etc.
    My problem lies in reading the frames. I'd like to read from the serial port until I get an EOF character, then parse the frame, etc. for every cycle of send/check. This doesn't work. I've managed to get one character from the port, thereby confirming that my reading function does actually read. Then I tried to put it into a loop which resulted in it not returning any characters at all.
    Attachments:
    AssReq.GIF ‏5 KB
    GetFrame.vi ‏14 KB
    readVISA.vi ‏13 KB

    Attachments:
    SerialPortControl_2.vi ‏24 KB

  • ORA-13773: insufficient privileges to select data from the cursor cache

    We are trying to create STS using the below query:
    exec sys.dbms_sqltune.create_sqlset(sqlset_name => 'TEST_STS', -
    sqlset_owner => 'SCOTT');
    The below procedure will load sql starting with 'select /*MY_CRITICAL_SQL*/%' from cursor cache into STS TEST_STS.
    DECLARE
    stscur dbms_sqltune.sqlset_cursor;
    BEGIN
    OPEN stscur FOR
    SELECT VALUE(P)
    FROM TABLE(dbms_sqltune.select_cursor_cache(
    'sql_text like ''select /*MY_CRITICAL_SQL*/%''',
    null, null, null, null, null, null, 'ALL')) P;
    dbms_sqltune.load_sqlset(sqlset_name => 'TEST_STS',
    populate_cursor => stscur,
    sqlset_owner => 'SCOTT');
    END;
    We were getting the following error: ORA-13761: invalid filter
    After granting the below privileges to the user we are getting the below error:
    Err msg:
    ERROR at line 1:
    ORA-13773: insufficient privileges to select data from the cursor cache
    ORA-06512: at "SYS.DBMS_SQLTUNE", line 2957
    ORA-06512: at line 10
    For SQL Tuning Sets:
    GRANT ADMINISTER ANY SQL TUNING SET TO scott;
    For Managing SQL Profiles:
    GRANT CREATE ANY SQL PROFILE TO scott;
    GRANT ALTER ANY SQL PROFILE TO scott;
    GRANT DROP ANY SQL PROFILE TO scott;
    For SQL Tuning Advisor:
    GRANT ADVISOR TO scott;
    Others:
    GRANT SELECT ON V_$SQL TO SCOTT;
    GRANT SELECT ON V_$SQLAREA TO SCOTT;
    GRANT SELECT ON V$SQLAREA_PLAN_HASH TO SCOTT;
    GRANT SELECT ON V_$SQLSTATS TO SCOTT;
    grant select on sys.DBA_HIST_BASELINE to SCOTT;
    grant select on sys.DBA_HIST_SQLTEXT to SCOTT;
    grant select on sys.DBA_HIST_SQLSTAT to SCOTT;
    grant select on sys.DBA_HIST_SQLBIND to SCOTT;
    grant select on sys.DBA_HIST_OPTIMIZER_ENV to SCOTT;
    grant select on sys.DBA_HIST_SNAPSHOT to SCOTT;
    Any info from your end to resolve the issue will be of great help.
    Thanks

    What is the alert log reporting. Are you seeing any other errors than these in the alert log too?

  • How can an image be displayed by using raw data read from the serial port?

    Hi there,
    I am using an embedded camera to take photos. To operate it i send commands to it via the serial interface. I have received all of the image data back through the serial port and can view it as hex data in a string. The image data is 16bit colour RAW data at 160x120 resolution meaning i have 38400 bytes of data (160x120 = 19200. 19200*16 = 307200. 307200/8 = 38400). I want to be able to display this data as a picture, but cannot figure out how to do it. Can someone please point me in the right direction? i have been fiddling about with lots of the pixmap functions but no luck. Do i need to put this data in to a 2D array first?

    Yes, first convert it into a 2D array of pixel values. From there you can convert it into an image to display it in a picture control.
    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

  • How to get a signal from the serial port to start a labview program?

    I need to synchronize the data obtained from a program (which is not in Labview)with the data collected with Labview on a different computer. I can send some data strings to the serial port of the computer running the Labview program when the other program starts. However, I need to be able to read the trigger in my Labview program. Do you know what I should do? Thanks.

    If you don't have any other programs listening on the COM port, you need to let a LV program run BEFORE the signal comes, otherwise you won't be able to read it. You can have the program wait in a slow timed loop so that it doesn't use up too much CPU time, and when the required "trigger" comes, to move into the main part of the program.
    You basically need a while loop waiting for a certain string in the serial buffer. Once the string is found the while loop is exited, and the data acqquisition or whatever else you require from the progam can be performed.
    In the example attached the program wait for ANY text to be sent to the COM port. Please note that you need to configure the VISA resource before using it. Once there is something at the COM port, the loop will exit and the rest of the program will be executed.
    Hope this helps
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Wait for serisl message.vi ‏17 KB

  • Best way to acquire data from both serial port and D/A board in real time?

    In my experiment, I have 2 kinds of data: analog and digital. Now, I have to write a programme to acquire both data not only in real time but also in sychronicity. My colleague tried to write a program for this purpose. However, the digital part was failed. For example, the data length found from "data buffer" is correct in the first 10 seconds; however, the format became wrong later.
    Is it one program involved two different data acquisition methods? 

    Hi,
    You need to figure out when the serial port sample occured by some technique and then obtain the equivalent sample from the aquisition board, probably from a circular buffer. If you know the sample rate (pretty implicit really) you can 'cherry pick' the appropriate measurement from the buffer to be synchronus with the serial port measurement.

  • How to restrict user to select date from the calendar into a text item

    Hi All,
    I am using oracle 10g.IN a form i am having a block 'client_block' in that i am having a text_item ' entry_date' which is a datebase item and i have set enabled false in property palette and i created an image item on the same form and i have an calendar icon on it .In when_image_pressed trigger for image item i have written this code
    SET_ITEM_PROPERTY('CLIENT_BLOCK.ENTRY_DATE',ENABLED,PROPERTY_TRUE);
    DATE_LOV.Get_Date(sysdate,'CLIENT_BLOCK.ENTRY_DATE');
    This is working perfectly but user can enter or delete date into the text_item through keyboard i want to restrict that they can only select date from calendar.
    I have tried setting item property enabled false in triggers but it is not working.
    Can someone help me what trigger i have to use and how?.
    Thanks
    Sri

    Hi,
    This is working perfectly but user can enter or delete date into the text_item >>>through keyboard i want to restrict that they can only select date from calendarSet Insert allowed to 'NO' in property pallete of item ENTRY_DATE.
    In ON-ERROR Trigger::
    BEGIN
    DECLARE
    err_code CONSTANT NUMBER := error_code;
    err_type CONSTANT VARCHAR2(3) := error_type;
    BEGIN
    IF (err_type = 'FRM'
    AND err_code IN (40200)) THEN
    Message('Updates Not allowed, Please Select Your Date from Calendar');
    Message(' ');
    ELSE
    NULL;
    END IF;
    END;
    END;
    Thanks,
    Bhujendra

  • I want to build an array using the data that I get through the serial port

    I am reading data through the serial port, but I want to buffer these data. I have seen a function, but i think that i can use this if I am reading data from I/O intrument, so I don´t how can I fill an array, with the data that I am reading!!!
    Thank you!!!

    I'll hazard a guess that you are reading data with VISA as a string. Then you want to convert that (probably with Scan From String) into a number. Then, you want to collect those numbers into an array.
    We don't really have enough information to tell you the best way to do this. Here are some ideas.
    If you are reading all the numbers from the instrument at once (e.g., a waveform from a scope), you might consider using "Spreadsheet string to array". Most scopes return the data as ASCII with commas between the values, so you'd wire a "," to the "delimiter" input of the "Spreadsheet string to array" function.
    If, however, the instrument is returning a single point at a time, there are more questions. Do you want to do this continuously, or do you want t
    o collect only a certain number of data points, and then process them as a block?
    If the latter, then you'd just acquire each data point, convert it to a number, and then use output indexing on the for loop to create your array.
    If the former, then you may want to store the data in a queue, and read it from the queue elsewhere in your program.
    If you let us know what you want to do, we can probably provide more precise help.
    Brian

Maybe you are looking for

  • Sender Adapter Conf

    Hi Guys, Using Sender JDBC Adapter , am updating back the intermidate table flag status to "T" from "P". UPATE <TABLE> SET flag_status = 'T' where flag_status = 'F' Now user has created a unique constriant on the intermidate table level , by doing so

  • Ipod touch os4.2 working with Airport Express

    hi, need some help!!! Trying to connect ipod touch with os4.2 to airport express. when i go to use airtunes by clicking on the icon to the right of the play funtions, my touch sees my apple tv but fails to see my airport express. I have managed to co

  • Red eye removal in PS Touch?

    Is there a dedicated tool for red eye removal in Photoshop touch?  I've looked around and not found anything so far. I keep looking because I won't believe that such a common tool is not found in such a well-known, used, and respected photo editing s

  • HT1212 my screen is dead.  How can i get my stuff off if i cannot enter passcode?

    My screen is dead.  Dropped.  I got a new phone.  I want to get all the pictures off the old phone.  I logged into Itunes and it states that I need to enter the passcode.  I know the passcode but due to the screen being dead, I cannot enter it.

  • How can I keep my RAW images from having anything applied to them when I import them?

    Hi All, I shoot with a Canon 5D Mark III and I use a picture profile in my camera that keeps all my images with low saturation, low sharpness etc... but whenever I import RAW pictures into Lightroom, I initially see the images the way I saw them in m