Writing series visa delays

Hello

I use the LabVIEW Vi series to send commands to a DUT. I use the a Sparkfun USB to Serial converter cable for the interface, by connecting directly to the TX and RX pins of my DUT (an MCU). I am able to send and receive data without any problem or data corruption, it is really slow.

There are up to a 5 second delay between writing the message get written in series VI write and actually see me this post to the MCU. I have a scope attached to the TX/RX signals to see when this happens. Fortunately I do only 2 entries of 4 bytes, so there is only an additional 10 seconds of delay, but with it, wrapped in a teststand sequence, delays will be added through hundreds of iterations.

Anyone seen this before? Any ideas what I might be able to try?

Thank you.
Mark

Well, the post was premature. A co-worker pointed out my mistake.

I use 2 queues, one for reading, one for writing on the port series. The problem is that I use the VISA Read.vi timeout for reading queue loop and the Dequeue Element.vi for writing loop. By chance, I had configured the read timeout set to 10 s. Given that the serial port is the same VISA session, these are not truly independent of queue loops. the function Read series was blocking the write function of occurring for at least 10 seconds. Once playback Vi has expired, the writing was able to sneak in and get the message written.to the port.

-Mark

Tags: NI Software

Similar Questions

  • Data drops using reading series visa

    I'm having a problem using reading series visa when you transfer a picture from one PC to another.  Writing PC transfers data systematically as seen by the probe on the chain get into writing.  Exe read the string displays however the string table once and then on the next reading displays an empty string.  It seems new and fourth without a complete data string and an empty string.  The vi that data comes displays a table updated consistent but the exe read the matrix (via RS 232) switches the vacuum to the full establishment of the loop rate which is fixed at 1 Hz.

    Teslac wrote:

    files/NOR/Labview e (toward) Progam vi.llb\Advanced String?   Well Yes

    Bravo and thank you.  There are buttons for those Bravo - simply click on the star under my avatar and brand the solution - (Options > OO > on your right, at the top of each post "Accept as Solution")

    There are three reasons for this:

    1. Other contributors know that they can focus on helping out elsewhere

    2. It is easier to find the next person with a simillar problem

    3. We LOVE 'Solutions-pronounced ".

  • How to stop the series 'VISA read' the sends packets instead of bytes available.

    Dear Labvillians,

    Highlights:

    How can I stop series "VISA read" send me packages rather bytes?

    Background:

    I have a system which publishes series of 14 bytes on a semi-regular interval packets.

    At busy times, the producer of these these queues of data packets, effectively producing Super-paquets multiple of 14 times larger than 8 packages (112 bytes) bytes.

    My protocol handler is designed to process bytes, packets, or packets Super.

    Now, my request has multiple devices and the order of message processing is essential to the proper functioning.

    My observation is that read VISA waits until the end of a package / super package before moving the data to the application code. (See chart below)

    My expectation is that VISA read should give me bytes available, get too smart for itself and not wait for a package.

    .

    I noticed this on PXI, PC shipped, PSC and, more recently, cRIO

    I've experimented with Scan interface the cRIO rate, which helps to reduce the backlog of packages but don't decide to package under read byte.

    I understand that a solution is FPGA code write to handle and pass the bytes by R/T-FIFO, and there are some great examples on this site.

    Unfortunately, it does not help with FPGA devices not.

    I have also dabbled in the event based sequential reads, but he is evil on vxWorks devices.

    Any help is appreciated

    It is helpful to sometimes talk to yourself.

    I hope that is useful for someone sprinkle in the future

  • What is the difference between write < < series > > visa and visa writing < < visa > >

    Is there a difference, the blocks alike?

    Eric

    Entry VISA is located in the VISA palette and the palette of series. This is for practical reasons, but they are the same node.

  • reading and writing series sometimes works, sometimes expires

    I use the series on the VIs VISA to acquire data through an instrument.  After you have configured the port, I have send the instrument the order "AZK" followed of a newline (string hex "2A 61 7A6B 0D").  This brings the instrument to trasmit data.  When I do this in Hyperterminal with the same port settings, it works every time when I repeat the command as quickly as I can without any problem.  When I start my VI in LabVIEW, sometimes it works and sometimes it isn't (work maybe 25% of the time).  When it works, the data are displayed in an indicator very quickly.  When it doesn't work, I get a timeout error (10 seconds).

    I think the data string is ~ 330 bytes; Since I'm troubleshooting, I have it reduced to 20 bytes in order to ensure that the reading series is not waiting for more of bytes.  I also tried to extend the timeout, but it doesn't help.  Thinking this was maybe timing, sequence, or buffer related, I also tried to write and read in frames separated from one frame of the sequence and also tried an initial framework with clear VISA to clear the buffers before writing and reading, but none of this has helped.

    Any ideas why this might work a while but not others?

    I have attached a VI that I use to try to get this working.  (Note some data, the analysis of operations, as well as the VISA read a previous VI, but they have not been configured for this instrument of entry again and only the input string of reading indicator is significant at this time).

    If I can't get this to work, my rescue is rule automatically the instrument on trasmit on a certain frequency (like 1 sec) and acquire these data.  I was able to do this successfully with another device series.  But I wanted to be able to have LabVIEW to control the timing of transmission data as this unit has this capability.

    Thanks for any help.

    You can try adding a delay between characters like Hyperterminal does.

    And please don't say that you use the continuous run button. That would be a mistake.

  • Creating a string of bits to send through questions series VISA, complete noob here...

    Hi all

    I'm trying now, to browse the values I have on my collection of GUI and with these, construct a message to send through VISA.

    I have the usb-> rs232 cable and NO, and I have attached a connector, with the pins 2 and 3 tied together so that I can loopback and see the messages I send.

    I'm supposed to (from the instructions that I read on a design doc) will send a message of length of 24 bits.

    And please bear with me, I've never worked on this low a level before, nor with the serial interfaces, so I can be completely off on how I'm doing... and this is my

    first really relay with LabView for this project.

    I have some time execution of every 20ms in a loop.

    I have a structure of the event looking for user actions on my front.

    I also breast that everything in a loop, a flat sequence structure... my assumption was, every 20ms, the flat sequence structure would run, except where it is interrupted by an event... that could trigger and then continue with the flat structure...

    I have seen that the entry VISA (and read) take a string.

    So, I started the flat structure with build my string of bits/bytes outgoing... first section is coded hard and then, through the two sequences, loop it and based on the values of the controls within each cluster, I concatenate to my outgoing string... in which case, I send by the visa by the closure, and post it on the message indicator.

    It seems that I can send on only 8 bits at a time through VISA... so, I try to understand (and I wonder people with the req on this part) why they said to send such a long chain... or am I supposed to send each message of 8 bits, one at a time?

    If one bit 8 message at the same time, I wonder how I have let him know when I am finished?  I have heard and read things about start and stop bits, but I don't know where to put them.

    In addition, is the string that I'm supposed to put them together to send something waiting for data series bits/bytes? I saw a reference to a string of bytes while the research, but I Coulnd't ' t find a piece of string byte on the pallets.

    And when I run the present (a simpler example of my real application, simply to show here the parts I am trying to figure)... the message echoing again to me is:

    111000010000\n

    When if I have all the tubes with a value in them... I want to get something new like:

    1110000111111110111111110\n

    I'm also noting that messages do not seem to be transmitting every 20ms... seems only to get a message back when when I trigger an event, as the option switch on the LED.

    In any case, I'm confused, I think that, on certain basic principles and hope someone can maybe send me some links or give me some advice on where I'm wrong so seriously...

    Is my construction of the right to follow path string message?

    Is something wrong with the flow of the program... the events + flat sequence structure?

    I received this property by searching for forums and other papers OR, but I'm stuck sort of and confused I think on some concepts with read/writes...and possible VISA my flow control.

    Any suggestions and/or links GREATLY appreciated.

    Thank you

    Cayenne

    PS. Some asked to record for older versions, so I enclose a copy saved to more 2011 v10

    Cayenne,

    Your sequence structure is not necessary.  You have a dependency on the data, as well as the structure of sequence is not really do anything for you.  Seems to me that what you want to do is to build the table of your clusters that you already own and send the table directly in a > 0? function.  It will accept berries and an array of Boolean output.  You can then use the Boolean array to the Number function to create a U8.  Do this for each of your clusters and integrate the results in a table of U8 and fixed data.  Then use the array of bytes to the string function to get a string to pass in the VISA to write it.  Without loops or the necessary structures.  Any additional manipulation you need, I recommend to the byte level.

  • Problem writing series

    Hi, I have problems with writing the series. If I run in the debug (peak performance) mode it seems to write OK, but once out of debugging, it only works once in a while or if I send something to my VI for him to read first.

    No I don't think that's the right way. You try to read from the serial port and the same resourse you spend writing so if you don't have all the data to read you will get an error in the sequence of your serial port of Scripture will not work / by mistake. It must be checked if data are available on the serial port before reading.

    This is just an example, I enclose you who can do better.

    Good luck.

  • Create events series VISA

    Hello

    I want to have a commiunication by serial port, my old code is pooling mode and now I need event mode, how can I do? I need a simple example waiting with the series event and when receive bytes on the port, then I find in the structure of the event and go to this place.

    Thank you.

    Your instrument uses a stop character?  You have the active stop character?  If your instrument sends character of endpoint for each message, then activate the who and set your VISA reading to read in a way that more bytes you always expect.  Do not use the bytes to the Port.  With the active stop character, VISA playback stops when it finds the stop character or the desired number of bytes are read, whichever comes first.

    If your instrument does not send a termination character, then you must add a wait to allow all data to be transmitted before checking the number of bytes in the port.  This certainly isn't the preferred way.

  • cut a red number first element in reading series VISA write vi

    I want to put the serial number of a card RFID in LAbVIEW and for that I used VISA base series read VI... The Red number by which is in the following format...

    2045A15F50... im getting a square in front of tis number... How to eliminate this place?

    Sorry, I am very new to LAbVIEW and have no idea about that... So please help me

    The square indicates her you received an "unprintable" ASCII character  This could be an indicator of 'Start of message' series equipment.  They are often used in certain communications.  Read the manual of the device would be a good place to learn the expected format.  Has LabVIEW some built-in string functions as 'Trim Whitespace, vi' which can remove characters which are white space (tabs, spaces etc.) and this code snippet shows how to remove all nonprinting charaters in a string.

  • Problem with string writing series

    I'm using labview to send commands to a device using the serial port com1.  Using the example VI "Base series in reading and writing", I can communicate with my hardware very well, can write and can read.   the problem comes when I want to edit the VI by using my own string instead of the string provided in the example.  When I create a string constant with the exact text that was in the example string box, I can not write my material.

    I don't understand why this wont work.  Is there something special about the example of the VI text 'string to write' box that I don't know?

    Help, please

    Thank you

    I know what you mean and it does not work like that.  For some reason if I use a string with \r\n constant it still does not work.

    Anyway, I solved the problem in a roundabout way.  The command I sent you is a word but both parties; first part, second part number.  I want to create a loop when the number changes.  I was able to do this by combining three channels, the first is a copy of the example string, the middle is my number converted to string, the third is a different copy of the string of examples.  Now it works and I can with my life

  • Writing LabVIEW visa question

    environment:

    -windows xp professional sp2

    -Labview 8.5

    Description:

    I have an instrument with rs232 interface, when I use the UartAssist tool to send the command, the instrument could receive successfully.

    but, when I start my labview application to use visa control and send the order exactly the same, there is no response.

    I trace the error in my control, there is no error after the send (successful submission) command, but the instrument has no answer.

    I do not know baud rate and other configuration is good, why the device cannot answer?

    BTW, I try to use HyperTerminal to send the same command, the instrument can answer too...

    AJMAL says:

    BTW, I try to use HyperTerminal to send the same command, the instrument can answer too...

    If you mean it is in the hyper terminal to work?

    I would say it is probably a Yes.

    The most likely cause here is a matter of simple termination. Most of the series commands must end by one or more characters. It varies depending on the instrument to the instrument, but it is usually a carriage return. You will need to check the programming of your instrument manual to determine what is this character and add this character of the chain of command. Individual character constants are available in the palette of the chain, the bottom row.

  • USB (series VISA) during reset problem

    Hello

    Immediately to the problem that I'm using communications series in labview with microcntroller. Anyway, whenever I connect the USB cable then Labview detects the port and make the communication. But in the average process if I press delivery to ZERO (lost USB) button on the microcontroller then block visa series get the error and program continues to generate the final error with the code. By the way, this happens when ever I want to confirm the user that USB is disconnected or RESET is pressed. Also if you reconnect the USB at the back, then the program should work as usual. Even I tried with error display VI in the programming menu, but I hope it's wrong way. Finally, I would like to correct two things 1) if RESET is pressed to halfway, then it must show a perceptible message from the user. (2) the USb disconnected by person unknown so what can I do in this situation.

    I'm using LABVIEW 2009. Please help me.

    You can try something similar to the following. However, I would recommend against it because I found that LabVIEW generated errors are very useful for troubleshooting. Message/code often your own mistakes to mask the problems that will be easy to understand if you have the LabVIEW error.

  • Buffer series VISA not containing data not received all

    Hello

    I get the competition of the transmitttet of the LGRTest.txt file for my port com3 (9600n81) every second.

    Using 'VISA on event Wait function' I was supossed to read the summary after detection of a character of 0xA.

    But I get only at random parts of the 486bytes transmittet.

    In earlier versions of my code, he did receive the prize. But I discovered that it was old data stored in the buffer.

    Then I added "VISA Flush function" before wait as the chariot of the end and then I got the first problem I designed.

    Concerning

    Morten Skov

    The event to wait for the VISA is pending for ANY character to receive.  So if you check the number of bytes in the port when half of the message has been sent, you will only read half of the message.

    If you actually use the stop character, don't bother with the VISA events.  Just a reading VISA with the number of bytes to read the value something rediculously high.  Read full when it detects the stop character.

  • Writing of VISA problems

    Hi all

    I am trying to write 2 bytes for VISA on click of a button.

    My device receives the bytes 2 sends data.

    I use "byte array to string" to write these 2 bytes to VISA.

    It is when I click on the button very slow (say, on a distance of 1 sec) it works fine. but I click on the button very quickly, it crashes and stops finally LV

    Is there a way to better and faster to write data on the instrument?

    Thank you

    Ritesh

    Please look at this Post on LAVA:

    http://forums.lavag.org/index.php?s=&showtopic=12116&view=findPost&p=52832

    Eugen

  • problem writing series cRIO

    I want to communicate between cRIO-9073, and PC, the master will cRIO. Now am with VISAS for communication, my problem is when I write from PC and read in RIO I can do. But when I write of RIO and read from PC I could not able to read. No value is coming. I don't know what I'm missing. Maybe the difference in speed? Do I have to change baud rate? Now, I put to 9600 in the two.

    Can someone please help?

    Am still not familiar with the serial port signals but I'm trying to help you. Just do a test: disconnect the cable from the RIO and just turned the numbers 2 and 3 of the serial port cable and run both at the same time code in the host. If you receive data properly, then the problem could be with the cable (right or pivot) option.

Maybe you are looking for