Serial Recieve with termination character

Hi All,
I have developed a seqence fileto transmit data on the serial port and loop back to recieve the data on reciever of same port. I'm transmitting "Test
 Serial" (Note: I'm not transmitting "Test\\rSerial") and recieving the data with termination character "carriage return".I'm using ASCII value 13 for the carriage return,but the recieve is not terminating on carriage return.
It seems Teststand is not able to recognize "13" or "\r" is seen as 2 character.
I'm attaching the sequence file for your perusal.It would be great if somebody can suggest me ways to make this work.
Thanks in advance.
Regards
VDC
PS: IVI serial driver need to be installed.You need to select Serial driver in device driver installation
Attachments:
SerialReadWrite_Term.seq ‏23 KB

HI,
I tried to find this dll, where is it located?
If this is using "IVI" then you could see every action in NI-Spy !
I watched you code. Another thing you could try is disabling the caching. Try Cache=0
now data shold send very time to your device by the IVI engine
Juergen
=s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

Similar Messages

  • Can query serial port with NI MAX, but doesn't work in Labview

    I'm trying to control a Coherent Sapphire 488 with labview. It's connected via a serial to USB converter into the computer. I can communicate with a device using NI MAX, but when I try to run the vi (attached), it works for several queries, but evetually returns a null character, after which I can no longer communicate with the port. If I then go into the NI MAX interface, every time I try to read it gives the "VISA: (Hex 0xBFFF0015) Timeout expired before operation completed" error message.There are also several queriess from the instrument's manual that don't seem to work at all (with or without MAX) and always return a null character. Any help is appreciated. I'm certainly a novice with device communication. Thanks.
    Solved!
    Go to Solution.
    Attachments:
    488_query.vi ‏16 KB

    Generally issue with termination character.
     And you are sending     \  and  r   and not CarriageReturn.

  • Serial port termination character status?

    Hello,
    I need to read a message from a serial port and I'm having some problems. I used the advanced serial communication example and came up with the attached program. Everything works perfectly fine except for the fact that if no message is sent for 10 seconds as designed the serial read outputs an error. I know normally I can check to make sure there are bytes at the port before I do a read operation which solves this problem. However, when using the buffer to terminate the read once a termination character is provided the bytes at port property always returns 0 so I can't use this as a conditional for reading the port.
    Is there a way to prevent the serial read from timing out in the attached program? Thank you.
    Attachments:
    serial_buffer.gif ‏19 KB
    serial.vi ‏15 KB

    Let me maybe give a bit more details about the application. I want to be able to get any amount of characters as a string that someone inputs in to the serial port. This will be a computer so I can expect the commands to usually be valid but I want to provide some additional redundency incase a person at a terminal is writing commands. The commands might be "measure 110" or it might be "set 23 34". So the amount of bytes being sent will depend on the command. I used 1000 as the byte count on the read just to provide as much room as possible, setting it to 100 doesn't really make a difference in this application, the same thing happens. If someone starts typing in a terminal "measure 110" (for example) but forgets to hit enter for the termination character the program will time out since the error cluster is connected to the stop button of the loop. When this happens the entire program needs to be restarted. Not really ideal.
    If I disconnect the error cluster from the stop button I noticed it works perfectly fine. After 10 seconds of the terminator character not being entered the buffer clears and the loop simply restarts. What I worry about is if there is some other fatal error (such as not being able to connect to the serial device) that the program will keep running. Is this something I even need to worry about?
    Attached is a screenshot of my latest program which works great but like I said I'm just worried about not wiring the status from the error cluster to the stop button since that seems to be what I've always been taught to do. If I wire the byte count to the number of bytes property it will only collect the number of bytes I set, since this will vary based on the command that won't really work in this application.
    Attachments:
    serial_buffer.gif ‏20 KB

  • Termination character for serial write

    Hi there,
    (LabView 6.02 on Win2k)
    Trying to communicate with a serial device I open a VISA-session on
    COM1 and it all works fine except that I'm not able to configure a
    termination character.
    I've tried the as well as the VISA property
    nodes. But I never get the desired termination characters (0xA or 0xD)
    sent to the port.
    What am I doing wrong?
    Thanks in advance,
    \Ulli.

    finally I found out the following:
    For the VISA session you have to setup (by means of property nodes)
    not only and
    but also set to "TermChar". Now everything
    works fine :-)
    Bernd-U. Seifert wrote:
    > Hi there,
    >
    > (LabView 6.02 on Win2k)
    > Trying to communicate with a serial device I open a VISA-session on COM1
    > and it all works fine except that I'm not able to configure a
    > termination character.
    > I've tried the as well as the VISA property
    > nodes. But I never get the desired termination characters (0xA or 0xD)
    > sent to the port.
    >
    > What am I doing wrong?
    >
    >
    > Thanks in advance,
    > \Ulli.
    >

  • Why do I get a "termination character was read" warning with VISA read and TCPIP?

    I am using VISA Reads with TCPIP raw sockets without issue with NI-VISA 3.0.1 but when I moved to NI-VISA 4.4 I was getting timeout errors.   The timeout errors went away when I set the termination character enable property to true (which seemed to be default in NI-VISA 3.0.1), but now I get a warning stating that the "termination character was read".   
    Can I disable this warning?   Can I set the termination character enable to default?   How can I get rid of this annoying warning?
    Solved!
    Go to Solution.

    Hey Dagwood,
    Unfortunately there isn't a way to globally change the attribute VI_ATTR_TERMCHAR_EN to VI_TRUE.  I spoke with R&D about possible use of the registries and they say it's not accessible through that.  To address why this change was made, the developer who made the switch isn't around anymore so I can't find his reasoning as an explanation for you.  The best this for you to do in your code would be while initializing, use the VISA Property Node to make the change and until that VISA Resource is closed, this change will remain set to the value you assign.  I'm sorry we cannot provide any other solution for this inconvenience.  Also, if you feel this is a large burden on your programming practice you can definitely submit a product suggestion for the ability to change global default values for VISA attributes.
    Thanks,
    David Pratt
    AES - Test Side Products
    NIC

  • How can I define more than one termination character for RS-232 interface communication?

    Hi,
    I have to communicate through the PC's RS-232 interface with a microprocessor board. I am using the "Advanced Serial Write and Read.vi" out of the LabVIEW examples and it works on principle.
    My problem is the termination character: It looks like I just can set one termination character, EITHER 0xA (so LF / newline) OR 0xD (CR / carriage return), but I have the need to react on various termination characters like "<CR> <LF> <CR> <LF> OK <CR> <LF>" or "<CR> <LF> <LF>"; which I would like to set in a control (this VI will be used in a TestStand sequence).
    Is there a way to do that, so that I can set wichever termination character(s) I need? The property node in "VISA configure serial port" just accepts an unsigned integer, nothing else. Sure I can get it running with the timeout - but this is not very nice and extends testing time unnecessarily.
    Thanks & Regards!
    Regards,
    gedi
    Solved!
    Go to Solution.

    That would be for the write. The poster is asking about the read. For the read you will need to write your own read routine. You will basically need to use a loop and inside the loop use the VISA Bytes at Serial Port to see if there's any bytes available. Read that many bytes, and append them to a string that you build up in a shift register. After concatenation check to see if you've got the termination characters. If so, the read is done. Fairly simple. Be sure to turn off the termination character enable in the VISA Configure.

  • Send/receive data without a terminating character

    I am trying to use the visa driver to send hex data over a serial port. I have tried to disable terminating characters but when I read from the port the trasnmission still terminates with a 0x0A character. How can I send/receive data without a terminating character???

    You need to call viSetAttribute with VI_ATTR_ASRL_END_IN set to VI_ASRL_END_NONE. In LabVIEW, use a write property node with the Serial End In mode set to None (0).
    Dan Mondrik
    Senior Software Engineer, NI-VISA
    National Instruments

  • How can I change the termination character (Hex 00) in LabVIEW?

    I'm talking to a 3rd party device over USB where I make function calls to their DLL. I send and receive Hex commands as Strings data type. I can send without problem however when I read back a string that should be Hex "FF 00 FF", I get back "FF" because LabVIEW sees 00 as a termination character so I don't get any data past the 00.  Likewise if I'm supposed to read "00 FF", I get back nothing!   The following KB linked below explains that LabVIEW sees 00 as a termination character.  It shows where using Serial to change the termination character to something else.  I don't have this option using my 3rd party USB device.  Is there a way to change what LabVIEW sees as it's termination character?
     http://digital.ni.com/public.nsf/allkb/9A3589A05F21A1B186256CE9006448D4

    That article is talking about two things. The first has to do with the fact that in C strings are terminated using 0x00. The second part has to do with a serial port read terminating once it sees 0x00. Based on what you described, I don't believe the second part does not apply to you since you are calling a third-party DLL, so it's doing the serial port read. Is this correct? Or, are you actually doing the serial port read yourself using VISA functions? If you are just calling their DLL, then the issue has to do with the string being passed back from the DLL to LabVIEW. You're probably passing in a string datatype. You should simply change this to a byte array so you get all the values.

  • Serial communication with forms developer

    How I can send character to a serial port with form developer 6.0 on winNT 4.0?
    Thank you, P. Guerriero.

    If you're using a serial connection can you talk to it using HyperTerminal, or equivalent serial communication program? You should check this first.
    More than likely the issue is with termination characters. Check the documentation to determine what termination characters need to be used when sending commands, and what termination characters are used to indicate the end fo a read. For commands it's usually just a carriage return, and for reading data it's usually a linefeed.

  • Termination character enable is FALSE but active

    When opening a new VI and starting to write code (in the other words, no special initialization is done to the serial port settings, as yet), the Term Char Enable indicates FALSE. The reads do get terminated with \n (\x0A). After a little while, I found in the support that actually one needs to check a different attribute (ASRL End In), in order to have the correct picture. Is this behaviour by design (??!!!???), or is it a bug?
    Sincerely,
    Albert Lysko

    In VISA Configure Serial Port, setting Enable Termination Char to true (the default mode) does two things. It sets the VISA Message Based Settings property Termination Character Enable to true, and the Serial Settings property Serial End Mode for Reads to termchar. The serial end mode for writes is not set in the function and if you want to terminate each write operation with a termination character, you have to set Serial End Mode for Writes to termchar.

  • Phone numbers with "pause character" not working same as first-gen iPhone

    Is this a bug?
    When I configure a phone number in my contact list to use the "pause" character (which shows up as a comma character in the display) a number of strange things happen.
    For instance, if I configure the following: (###) ###-#### ,,**2216464#
    where (###) ###-#### is my office phone number
    ,, is a pause to allow for the automated attendent to pick-up
    ** is recognized by my phone system as a transfer to my voice mailbox
    2216464 is my voice mailbox
    # is a termination character recognized by my phone system.
    Using my first-generation iPhone, this worked fine.
    Using my new iPhone 3G, this no longer works.
    Some observations:
    When directly using the touchpad on the iPhone, it appears to send DTMF tones as quickly and for as long as you hold your finger on the keypad. But, if you configure a phone number in the contact list and that phone number has a pause in it, each number configured after the pause will actuate for several seconds. The tone for each number (in this case, the 2216464) last SO long that my phone system gives up on the call and, basically, terminates the call. In addition, the inter-digit time is SO small as to be non-existant. In other words, in my sample phone number, the leading two digit of my mailbox number sound like they are expressed by the iPhone as a single, extra-long tone. There should be a longer pause between the first two digits. If I attempt to break them apart by inserting a pause (displayed as a comma), the pause is SO long that, again, my phone system gives up.
    So, in summary:
    Why did this change between the first generation and second generation iPhones?
    Also, why is the pause "character" SO LONG? Instead of making a pause character, say, four seconds, why not make it one second and let the user put in four pauses if they want a four-second pause?
    Why does the character length appear to extend after use of a pause character?
    Why is the inter-digit pause practically non-existant?
    Thanks.
    Ken

    I'm having the same issue. I just got the phone last week and was trying to call a number with an extension. After realizing that Address book does not have an extension field I reformatted the phone number using the "pause" (comma). With this in place it will not dial the number. Remove the pause however, and it will dial the root phone number.
    Please tell me this is just a bug and will be fixed soon. It's bad enough that I've had to spend the last week reworking my contacts in Address Book after having to jump ship from my Palm software. As a business user it is a regular piece of daily business to encounter the automated receptionist asking for someone's extension. Since the iPhone doesn't show the number you just dialed (the extension is in there after the "x" but it doesn't recognize it) you end up having to memorize the extension prior to making each call.

  • Termination character

    Hello,
    I'm communicating with an 20 years old optical spectrum analyzer with GPIB connection using VISA.
    I having trouble reading the entire data. I've try to use the termination character options to solve this but my instrument use both line feed and EOI termination codes.
    I've found this help text: http://www.ni.com/white-paper/4256/en/
    but could understand it to the end.
    what is the symbol accepting the arrow symbol at and zero constant at the end? where should I put this property node in case I want to read many bytes ending with the above characters? before VISA - WRITE? after VISA read? and how can I combine two termination character? how do I represent two EOI?
    thanks, Avishay

    Specify too many bytes to read and the visa read wil stop on the first end character or eoi that appears.
    For two eoi's read twice.
    greetings from the Netherlands

  • Serial communication with Omni Link

    Has any body had any success communication with an Omni Link 5000 using LabVIEW?
    Thanks.

    If you're using a serial connection can you talk to it using HyperTerminal, or equivalent serial communication program? You should check this first.
    More than likely the issue is with termination characters. Check the documentation to determine what termination characters need to be used when sending commands, and what termination characters are used to indicate the end fo a read. For commands it's usually just a carriage return, and for reading data it's usually a linefeed.

  • Utl_file.putline  - platform specific line termination character

    PUT_LINE terminates the line with the platform-specific line terminator character or characters.
    But the porblem is this.
    The file generator application can run in different platform,and hence it means I can have different line termination character.Is there anyway I can force it to generate Unix only line termination character (line termination char in Unix I guess is \n) .
    In short programatically I want to control it.
    I looked at UTL_FILE.PUTLINE but it doesnt have any option to control the line termination char.
    Help.

    here is the example, i am on HP UNIX
    SQL> DECLARE
      2     l_text   VARCHAR2 (32767);
      3     v_file   UTL_FILE.FILE_TYPE;
      4  BEGIN
      5   -- OPEN FILE to write
      6     v_file :=  UTL_FILE.FOPEN (LOCATION          => 'NOTIFICATION',
      7                        filename          => 'Test.txt',
      8                        open_mode         => 'w',
      9                        max_linesize      => 32767
    10                       );
    11     UTL_FILE.PUT(v_file,'Hello' || CHR(10));
    12 
    13     UTL_FILE.PUT(v_file,'how are you' || CHR(10));
    14 
    15     UTL_FILE.PUT(v_file,'I am fine' || CHR(10));
    16     UTL_FILE.FCLOSE (v_file);
    17    ---- open file to read
    18    v_file := UTL_FILE.FOPEN (LOCATION          => 'NOTIFICATION',
    19                        filename          => 'Test.txt',
    20                        open_mode         => 'r'
    21                       
    22                       );
    23     BEGIN
    24        LOOP
    25           UTL_FILE.GET_LINE (v_file, l_text, 32767);
    26           DBMS_OUTPUT.PUT_LINE (l_text);
    27        END LOOP;
    28     EXCEPTION
    29        WHEN NO_DATA_FOUND
    30        THEN
    31           NULL;
    32     END;
    33      -- READ LAST LINE
    34    -- DBMS_OUTPUT.PUT_LINE ('Last Line : |' || l_text || '|');
    35     UTL_FILE.FCLOSE (v_file);
    36  EXCEPTION
    37     WHEN OTHERS
    38     THEN
    39        UTL_FILE.FCLOSE (v_file);
    40  END;
    41  /
    Hello
    how are you
    I am fine
    PL/SQL procedure successfully completed.
    SQL> ed
    Wrote file afiedt.buf
      1  DECLARE
      2     l_text   VARCHAR2 (32767);
      3     v_file   UTL_FILE.FILE_TYPE;
      4  BEGIN
      5   -- OPEN FILE to write
      6     v_file :=  UTL_FILE.FOPEN (LOCATION          => 'NOTIFICATION',
      7                        filename          => 'Test.txt',
      8                        open_mode         => 'w',
      9                        max_linesize      => 32767
    10                       );
    11     UTL_FILE.PUT(v_file,'Hello');
    12     UTL_FILE.PUT(v_file,'how are you' );
    13     UTL_FILE.PUT(v_file,'I am fine' );
    14     UTL_FILE.FCLOSE (v_file);
    15    ---- open file to read
    16    v_file := UTL_FILE.FOPEN (LOCATION          => 'NOTIFICATION',
    17                        filename          => 'Test.txt',
    18                        open_mode         => 'r'
    19                       );
    20     BEGIN
    21        LOOP
    22           UTL_FILE.GET_LINE (v_file, l_text, 32767);
    23           DBMS_OUTPUT.PUT_LINE (l_text);
    24        END LOOP;
    25     EXCEPTION
    26        WHEN NO_DATA_FOUND
    27        THEN
    28           NULL;
    29     END;
    30      -- READ LAST LINE
    31    -- DBMS_OUTPUT.PUT_LINE ('Last Line : |' || l_text || '|');
    32     UTL_FILE.FCLOSE (v_file);
    33  EXCEPTION
    34     WHEN OTHERS
    35     THEN
    36        UTL_FILE.FCLOSE (v_file);
    37* END;
    38  /
    Hellohow are youI am fine
    PL/SQL procedure successfully completed.

  • Termination character enable

    I am connected to hardware via an RS-232 cable and am using VISA’s to request and read information from memory addresses. When I encounter a 0x0a (hex) in memory, the VISA Read stops reading because it thinks it has read the termination character. This only happens when a 0x0a is encountered, all other characters from 0x00 to 0xff are read in correctly (provided there isn’t a 0x0a in the location).
    I have set the Termination Character Enable property node to FALSE and it doesn’t seem to help (Ver 6.0.2). Any help on disabling the Termination Character would be appreciated.
    Thanks,
    DH

    I would think that setting the Termination Character Enable to false would prevent this. Maybe something else is turning it back on. If you use the VISA Configure Serial Port.vi (In instrument I/O>>Serial) it will turn this setting back on. So make sure you turn it off after any of these functions. One other thing that have done is set the Termination Character to 0x00, although I'm not sure what would happen if you got a 0x00 (NULL?) back from the port. Also check for other functions that may alter these settings after you set them.
    Hope this helps!
    Brian

Maybe you are looking for

  • MDM Data Manager Masks, field Shared

    Hi experts, while creating a mask in the MDM Data Manager I noticed the field Shared. It can be set to Yes and No. Can anyone tell me what this field does? I couldn't find any reference to it in the documentation of the MDM Data Manager, current vers

  • IPhone no longer connecting to GoogleTalk

    All of a sudden my iPhone3G will not connect to GoogleTalk. I have re-downloaded the Google app, but same thing happens. It opens, then sits on "loading". Anyone have any ideas about this? Thanks!

  • CS4 upgrade to Elements 10?

    allo, I have CS4.. i was given Photoshop and Premiere  Elements 10 for Christmas.. I often use Adobe Bridge in CS4 to open RAW photos files with Camera RAW (5.7) (in filmstrip mode to edit lots at once).. I believe the version of Camera RAW for Eleme

  • Word report

    Hi All, Currently working on a program where I use the Office Report Generation (Word) With LV 8.5 I used a VI of my own to set a table in autofit. This can not be done with the VI in the toolkit (I think  ) With LV 8.6 the report reference is change

  • How to send an e-mail when the logger produces a severe error ?

    All, I'm using ADF Logger, and I wonder if there is the possibility to make the WLS to automatically send an e-mail when an error occurs. I've heard that that would be possible using log4j; would you mind to share some know-how ? Regards, Sergio