Strange serial write problem in labview 8.5

I'm having a very strange problem with simple serial port write in labview. I'm running the 'Advanced serial write and read.vi' program from NI examples. I connected a microcontroller board on the device side. The board has been programmed simply to blink an LED fixed number of times. For example if I want my LED to blink 13 times, that is specified in the labview 'string to write'  field. I ran the program in hyperterminal window. It runs successfully. But whenever I'm running it in labview it is giving strange response, for example if I give input in 'string to write' field 18/13/15, it blinks 11 times, similarly if I try to run it 21/26/29 times every time it runs 22 times. That is the controller only acknowledges the MSB and duplicates the other bit with it. Since it is running fine in window's hyperterminal, There must be some adjustment need to be done in labview. And that I cannot figure out. Please anybody give some solution.Any suggestion is appreciated.
With Regards,
Tapabrata

Please post your program or a stripped down version (we probably do not need all the signal processing) which shows the problem.  Make sure that all the controls for the serial port are set to your default values. Also, provide the exact communication protocol you are using.
When you say you want to write in "real time," please specify what you mean. That term is used in several different ways and is often misinterpretted as a result. How often do you wnat to write? How much timing jitter or error can you tolerate?
Most likely what you want can be done, but without seeing the code it is difficult to say what might be wrong.
Lynn

Similar Messages

  • Strange math-problem with LabVIEW 7.1

    Hello!
    I am using LabVIEW 7.1 and I came to this strange math-problem. Could it be that it is a problem of LabVIEW 7.1?
    Ok try this with LabVIEW 7.1:
    open a new VI
    place a subtract-VI (pallet numerical) on the block diagram and try to subtract 0.2 from 1.6
    place a less-VI (pallet compare) on the block diagram and wire a numerical constant 1.4 to input x
    wire the result of the subtraction to input y of the comparison
    place an LED to the output of the comparison
    and start this.
    What does it say?
    The LED should turn on and this means here that 1.4 would be less than 1.4 .
    But I would have expected that 1.4 is not less than 1.4 .
    This works also if you add or subtract upto 0.2 to/from the values 1.4 and 1.6 (or equivalent with 0.2) .
    If you change the inputs of the comparison then the result is as expected and 1.4 is reported not to be less than 1.4 .
    If you compare two constants with the same value 1.4 you will not get the same strange result.
    Does anybody have an explanation for this?
    Espelkamper

    Hello,
    For floating point math: Rounding to multiples of 0.1 is problematic as
    those numbers are infinite fractions in base2 representation...
    So maybe you should change your numbers to integers using fixed point math. If all your input values are in the range of 1.4 to 1.8 you can multiply by 10000 and round to next integer. Then do your comparison on that integer (there's also an 'InRange' function in the comparison palette).
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How does VISA serial write work?

    I am using LabView 6.0 and the VISA functions to run a distributed sensor network using RS-485 from a NT 4.0 machine.
    In order to work properly I have to manually control the RTS line which isn't a problem using the property node.
    Here's what I want to know.
    I'm using a sequence structure:
    I'm writing a command using VISA serial write
    Then in the next frame I unassert the RTS.
    Now in this setup does Labview pass the command to the serial port and then jump to the next frame in the sequence, or is there some kind of acknowledgment from the serial port that its done so the Write vi knows to finish, or am I running a the risk of cutting off my communication before I've finished or should I put in a short wait after the write to port
    , or could this cause me to miss the reply?

    Robert:
    With the default settings, VISA Write will not return until the data has been at least posted into the hardware FIFO. To be 100% sure that the data has been transmitted over the wire, you should do these 2 things:
    1) Call VISA Flush I/O Buffer with a mask of 32. This will ensure the data has been at least posted into the hardware FIFO, regardless of which settings are being used.
    2) Wait a tiny amount of time for the FIFO to be emptied. This is based on the number of bytes in the FIFO and the baud rate. For example, with a 64 byte UART FIFO and 9600 baud, you should wait 67 milliseconds.
    Dan Mondrik
    Senior Software Engineer, NI-VISA
    National Instruments

  • LV5 serial write.vi vs hypertermi​nal difference​?

    I have a rs232c stepper motor controller connected to a PC running
    NT4. I have
    full control of the device (read and write) when using the
    hyperterminal program (comes with NT4)
    and everything work fine.
    Without changing anything except running Labview<->Serial.vi from the
    LV5 distribution
    disk, I was only able to listen (serial read.vi ) to the device but
    not controlling it. It appears
    that ascii commands sent (serial write.vi) are ignore by the device,
    while the same ascii commands sent via hyperterminal are accepted.
    What are the likely reasons for this? The port parameters appears to
    be OK because
    I was able to read from it.
    TIA.

    Thank you. That solved the problem.
    > I think hyperterminal adds the EOL(end of line) itself, and in serial
    > write vi YOU must add it, try putting a LF and/or a CR in the string
    > you write, and everything should work.
    > Hope this helps

  • Cómo funciona MAX? IMAQ serial write

    Hola buenos días, llevo tiempo intentando averiguar cosas sobre la comunicación de una tarjeta PCIe 1433 y una cámara mikrotron 1462. La cosa esq através del icd file y el MAX he conseguido que cambiando parámetros en el MAX cambie el modo de adquisición, ya que envía dichos comandos a la camara y configura los atributos para la tarjeta de adquisición.
    Para cambiar los parámetros de la cámara, desde el programa de LabView , estaba utilizando el IMAQ Serial Write. Para cambiar las ganacias y ciertos parámetros funciona a la perfección en tiempo de ejecución, incluso cuando la adquisición está en funcionamiento. Pero si envío los comando de cambiar el modo de adquisicion de la cámara (Los Taps X Bits), la tarjeta parece no enterarse del cambio y no funciona bien. Asi q lo intenté con el IMAQ Set Camera Atribute, lo que pasa esq esta opción no me deja aplicarla en tiempo de ejecución y debería cerrar la sesión de IMAQ, setear los nuevos atributos y crear una nueva. Ya que todos los demás se pueden cambiar, y el MAX aparentemente lo hace, me preguntaba si hay una manera de hacerlo sin crear una nueva sesión de IMAQ e alguna manera que no estoy teniendo en cuenta, o el propio Max cuando se produce un cambio de los atributos cierra y genera una nueva sesion de Imaq de manera transparente al usuario.
    Gracias!

    Ay, perdona, que puse el modelo mal!!
    Pues el icd file lo generé a partir de un modelo antiguo que funcionaba para esta cámara, que está en la página web de NI (El MC 1310), y con el file generator me cree uno con los atributos que necesitaba, xa ver la estructura que creaba y fijándome en files de otras cámaras (Contenidos en la carpeta Dat), fui probándo como se le añadian las opciones para enviar los parámetros. Vamos autodidacta total, porque los icd files son los grandes desconocidos. 
    Adjunto mi icd file actual. En el cual se soportan todos los modos de la cámara (taps * bits) menos uno (16 tap 1 bit), una opción para aplicar una corrección, bining.. Y algún parámetro más. Y están definidos el resto de parámetros pero no envía el comando adecuado, porque no sé como definirlo.
    El comando en sí depende del valor que le llega y no sé como recogerlo en el icd file. Por ejemplo, para cambiar la ganancia, si el nuevo valor es 400h el comando sería 400h, en el icd file se defininen los comandos de la siguiente manera:
    Action (Serial) {
                   Command (400)
    En este caso sería Valor y no sé como hacerlo para que recoja el valor q le llega y lo concatene al string del comando. Otro problema que me he encontrado es que creo q solo admite valores numéricos, y este comadno se envia en hexadecimal, por lo que es posible q contengan letras.
    Gracias!
    Attachments:
    Mikotron MC 1360_Maite.zip ‏2 KB

  • Serial VISA problems

    Hello,
    I keep having problems with VISA serial driver. The problem
    is that VISA seems to reserve the serial port even after the
    VISA session has been closed. Also, if I open COM1 with visa,
    I cannot use hyperterminal with COM2. I have to shut donw LabVIEW
    in order to use _any_ COM ports after I've used one with VISA.
    If i use old serial vi's i don't have to close LV in order to
    use COM ports with terminal hyperterminal or procomm
    etc.
    Has anybody else encountered this kind of behaviour with VISA serial?
    I run LabVIEW 5.1f1 in WinNT4.0
    timo
    *Timo Miettunen *
    *Senior Test Designer
    *Fincitec Oy Production Department *
    *e-mail: [email protected] *
    *Address: * *
    *Lumikontie 2 *Tel: +358-16-2151245 *
    *PO BOX 11 *Fax: +358-16-221561 *
    *FIN-94600 KEMI Finland * *

    Timo Miettunen writes:
    > Hello,
    >
    > I keep having problems with VISA serial driver. The problem
    > is that VISA seems to reserve the serial port even after the
    > VISA session has been closed. Also, if I open COM1 with visa,
    > I cannot use hyperterminal with COM2. I have to shut donw LabVIEW
    > in order to use _any_ COM ports after I've used one with VISA.
    > If i use old serial vi's i don't have to close LV in order to
    > use COM ports with terminal hyperterminal or procomm
    > etc.
    >
    > Has anybody else encountered this kind of behaviour with VISA serial?
    > I run LabVIEW 5.1f1 in WinNT4.0
    Timo,
    An easy workaround might be using the "close all visa sessions" option
    in the preferences/Misc tab. Before this option was introduced I used
    the
    visa sessions.vi in .../Labview/vi.lib/visa.llb .
    Do you use "find visa resources" and maybe you do some homemade "plug
    and play" by retrieving info strings from all ports? I'd look for
    sessions not getting closed in your programm.
    I'm using LV 5.1f0 on NT4.0SP3 and didn't see your kind of problem. I
    doubt it is an NT permissions problem.
    Johannes Niess

  • Inconsistent serial write

    hello,
    I'll be brief. I'm a novice, still trying to get the feel of labview. Somehow there's an inconsistency of the serialwrite.vi in my program. Using a protocol analyzer, I could see that sometimes the serial write doesn't send all the strings in the command text box. (For instance, the value of the command textbox is "send 200", and sometimes the serial write only sends "se"). I followed the guideline for serial communication: initialize (baud = 9600, databits = 8, stopbits = 2, parity = none), flush the buffer before writing to the serial port, send the string to the port, have a serial port break to wait for response, and count the number of bytes on the serial port before reading them. I use R-232, and I also have checked the "updat
    e value while typing" on the pop up menu of the command textbox. My program is attached. I will appreciate any help in any way. Thank you!!

    Try using VISA instead of serial VIs. VISA is lot better to use in almost everyway. There is a VI on your computer ( that has Labview on it )named, serial communication.vi That VI will help you understand the use of VISA in serial communication. But for some reason if you have to use Serial VIs then attach your VI on this developer exchange and I will try to troubleshoot the problem.

  • Using VI Example Basic Serial Write Read to send AT commands to Cell phone modem error 1073807360

    I am using the NI Example VI: Basic Serial Write and Read to send AT commands to a Cell phone acting as a Modem.  I can send AT commands to this phone using Hyperterm when I select the modem driver by name in the hypert port selection field but not as com 7 which it occupies according to device manager modem properties. The basic serial vi does not show the modem driver as a selection, only ports by comX are shown. I get error 1073807360.

    Have you tried to put the name you enter in Hyperterminal in the VISA resource control? If Com 7 doesn't show, you can simply type "COM 7" in the VISA resource control. Or use "ASRL::INSTR 7".
    Also, make sure the connection in hyperterminal is closed, before you open the port in LabVIEW.
    Hope it helps,
    Wiebe.

  • Run-time engine problem in Labview 2009 and Labview 2010

    I have a problem with Labview 2009 and Labview 2010. I updated my Labview 2009 into 2010. But it turned out to be a trial one, because i did not have the serial number. So I uninstalled the Labview 2010. however, the funny stuff came over. I cannot use my Labview 2009. So i uninstalled Labview 2009 again. But eventually, I could not reinstall Labview 2009. Every time i had a runtime error and i could not proceed with the installation. in addition, any installation  related to Labview is not permitted and the same error came up every time. it is very annoying.
    So, What is the deal?
    I attached the error here. Any comments or advice are welcomed and appreciated.
    Attachments:
    error.docx ‏2305 KB

    By chance is this machine's language set to any non-English locale?  You would check the locale setting by:
    Opening Control Panel.
    Opening "Regional and Language Options".
    Looking Under "Regional Options" >> "Standards and Formats"
    If it is set to something besides English, trying setting it to English and please report back what locale it was set to (or if this even solves the problem).
    Regards,
    - WesW

  • Can someone tell me how to emulate serial terminal window in labview??

    Hi can someone tell me how to emulate serial terminal window in labview?  or provide me simple code to do it? 
    baud rate 9600

    Have you tried looking through the example finder?  There's a a few great examples in there on how to read from and write to a serial port.  In LabVIEW just choose Help > Find Examples... and then navigate to Hardware Input and Output > Serial > Basic Serial Write and Read.vi
    David_L | Certified LabVIEW Architect
    LabVIEW Tools Network | LabVIEW Tools Network Developer Center

  • Merge a intensity graph to a Serial write/read

    Hey.
    I am doing my bachelor in Labview, and are using a arduino 2560 as a microcontroller for a thermal sensor.
    After many attempts on connecting the arduino to labview using LIFA.BASE I get connection sometimes, and sometimes not.
    I tried the Serial write and read program on the forum, and got much better reliability.
    I would like to use VISA, instead of Arduino int.vi
    I was hoping I could change the Serial write and read(removing the string) with putting an intensity graph in it?
    I have added the bachelor program along with the Serial write and read, can someone please help me??
    Attachments:
    bachelor_2013.vi ‏259 KB
    Modded Advanced Serial Write and Read_test.vi ‏40 KB

    There is the Simple Serial Write Read example.  That should get you started with talking over a serial port with VISA.
    It seems like you have an array of bytes that you need to send.  You just use the Byte Array To String to convert directly into a string and send it.  For reading, there is the String To Byte Array that you can use to start parsing your data.
    Show us what you have so far.  Be sure to include any sample data you may have and expected results.  Things get really confusing when stating ASCII and Hex since people can interpret that in 10 different ways.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do I establish serial communicat​ion using LabView to two stepper motors using a motor controller​?

    I currently use an off the shelf motor controller to run my two stepper motors. It already has integrated a firmware software that sends commands to operate each motor. I would like to create an interface where I can send these commands using LabView. If someone can point me in the right direction I would appreciate it.

    Look at the examples for the serial VISA vi.  Something like Basic serial write and read.vi is a good starting point.
    Have you searched for a LabVIEW driver  at the NI LV driver network?   Asked the vendor?
    If you write your own driver with the serial VISA vis remember to open and configure the port only once at the beginning and close it at the end of your program. 
    Message Edited by Henrik Volkers on 07-13-2009 04:21 PM
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • PDA (Pocke PC) - Serial Write Timeout

    Hello List,
    I am developing serial routines to communicate with external hardware. In many cases, XON/XOFF flow control is used.
    I have configured my PDA device to write out a large file. During the transmission, I use my development computer to monitor the transmission. During the transmission, I can send XON/XOFF characters to the PDA. If I send an XOFF, it will "pause" until I send an XON character. It works great unless I wait for more than about 3 seconds. If the PDA is forced to wait for more than 3 seconds, the transmission is terminated with an error. However, if I send an XON character, before the 3 seconds delay, it continues the transmission and no error occurs.
    It seems that a 3 second timeout is being enf
    orced within the routines but I have not been able to determine if I have control (within the PDA Serial Routines) over the timeout variable. Personally, I would like the timeout to be indefinite unless I want to enforce one.
    FYI: Based on industrial experience, for very large files, delays during the transmission of several minutes may be necessary.
    TIA,
    Guy

    Hello,
    I apologize for the delay in responding to your post. You are having a timeout issue when using software flow control (XON/XOFF) to transfer data between a PDA and a host computer, right? Are you getting error code 7 when the PDA times out? I was able to duplicate this issue here. This error code is a timeout error and it means that not all bytes have been sent. I spoke with members of the R&D team and they know about the problem. While they were unable to offer a formal solution at this time, they did provide a workaround which I hope works for you.
    Put a while loop around the serial write VI on the PDA.
    Continue the while loop until there is no longer an error code 7 (i.e. until all bytes have been sent).
    Essentially, this will ignore the repeated timeouts from the serial write VI. You can manually add a timeout mechanism by obtaining the time before the loop and checking it during the loop. However, you mention an infinite timeout is acceptable in which case no additional code is necessary.
    I have attached a couple of VIs that implement serial communication using XON/XOFF flow control and that use the above workaround. Please let me know if this solution works for you. If not, can you provide some additional details such as the error code and if the timeout is happening on the PC side or the PDA.
    Happy coding,
    Grant M.
    National Instruments
    Attachments:
    Serial_XonXoff_(Host).vi ‏55 KB
    Serial_XonXoff_(PDA).vi ‏68 KB

  • Visa serial write

    i need to connect my electronic hardware/instrument with labview serial visa. i need to enter multiple entries as input like frequencies, data patterns in binaries. but labview serial write accepts only single string as input. pls suggest how should i proceed?

    It really depends on the command format your instrument wants.  Some instruments will let you insert a semicolon between commands and write the one long string.  Others will require separate writes.  I would use a FOR loop in this case (iterate on an array of strings).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Enviar Float mediante Serial Write

    Hola:
    Cual sería la mejor manera de enviar un array de doubles por puerto serie desde Labview ?. Serial Write necesita enviar strings de 8 bits por lo que habría que hacer una conversion de float a int, y luego dividir en grupos de 8 bits ?

    Hola,
            Un float (SGL) son 32 bits (4bytes) y un double (DBL) son 64 bits (8bytes) Estándar IEEE 754
            En un String cada caracter es la representación ASCII de un byte de información.
            Puedes usar la función "Flatten to String" para convertir el arreglo a string y enviarlo por el puerto serial, si dejas el valor por defecto de "prepend array or string size? (T)" se agregan 4 bytes adicionales asociados a la cantidad de elementos en el arreglo, si colocas esa opción en False obtienes el mismo resultado que usar un typecast.
            Del lado de la recepción lo recomendable es que sepas cuantos bytes tienes que leer antes de hacer la reconversión.
    Saludos,
    Luis A. Mata C.
    Ing. Electrónico
    Anaco - Venezuela

Maybe you are looking for

  • No Adapter Engine in the Configuration

    All, When we create a new communication channel and select the adapter type (say File) , the transport protocol and message protocol appear - but there is no Adapter engine (which used to be Integration server earlier). Recently the team moved the SL

  • Data Merge Feature in Master page in InDesign CS5

    I really need some help, because I'm running out of time... I'm trying to create a merged document by using the Data Merge Feature in InDesign CS5. Normally it works fine, but right now I'm trying to create one with a .csv file imported in de master

  • New problem with JRE!!!

    I already installed j2re1.4 on SuSE Linux with some help from some of you (thanks, fellows!). Now I downloaded a freeware program that is programmed with java. It worked on Windows2k without any problems, but now I have Linux. This freeware program o

  • Sending iPhotos by email

    Thanks to leonie DF I was able to reinstall my iPhoto in a moment. Thanks again!  Everything is working except for sending and sharing pictures by email. FB component is great.  Just a big screen, no picture, can enter an email, but it goes no place.

  • Cannot Convert OracleType to DbType

    Hi, Im getting problems working with Oracle Database. Im getting an error that i cant use OracleType in the place of DbType. Becuase the Table has Varchar, and when i use DbType i can only delcare it as String which doesnt work. Please help. Here is