Serial communication is blocking my time loop

Hello world. I need your help with my program. I use LabView2014 and a B2902A Agilent.
I want to measure the current value with my instrument continuously, store the values of every second and the display of the messages received through the serial port when I'm gone.
Everything works perfectly separately, but when I put everything together I have this problem: my instrument is waiting for a message from the serial port to take (and display) a measure.
You have an idea to save my problem?
Thank you!

Pauline

(Please find attached a screenshot of my program)

Use the byte to serial port to check if a message is available and read only when a message is available.

Tags: NI Hardware

Similar Questions

  • Problems with the simple serial communication.

    I followed a tutorial online to start learning basic communication series. The involved tutorial shorting pins 1 and 3 on port 1 Comm and write a simple program (attached). I've edited it a bit, the program to see varied results I get when trying to write and read a simple sentence via a serial port.

    Could someone explain what causes the kind of result shown in "Serial Comm example.png"? I think it has to do with timing. Why would be transmitted only the parts of the sentence?

    Thank you

    Sarah

    sarahzig wrote:

    The involved tutorial shorting pins 1 and 3 on the Comm 1 port

    What should be pins 2 and 3?  On a standard serial port DB-9, pin 2 is the receive and pin 3 is the transmission.

    Now for your code...

    1. move the Serial Port to be before the loop to set it up.  Simply configure the port once.

    2. close the port after the loop.

    3. managing your error after closing.

    4 stop your loop on an error or the stop button has been pressed.  You will need a RC in there.

    5. no need to Flush Buffer function.  Remove it.

    6. using the bytes to the Port is a dangerous thing.  It introduced all kinds of race conditions that are interesting.  Instead, say VISA reading to read the number of bytes that you expect to read.

    6a. Moreover, don't forget to send a character to end of line at the end of your data and all the number of bytes to read something a lot more than you ever expect read.  The VISA read will stop reading when he a) sees the number of bytes, it was said to read, b) sees the stop character (currently enabled and set to a line break, which is part of the end of line), or c) the time-out occurs.  Whichever comes first.

    7. with 6, the wait is no longer necessary.

  • Serial communication error VISA with LUDL stage controller

    Hello

    I'm trying to control a micro-positionnement made by Ludl stage. The model is Ludl MAC2000. It seems that the RS232 comunnication is implemented because I can talk to the controller using HyperTerminal. However, when I want to do the same thing through Labview, I can't answer the controller at all. The vi is roughly the same as the visa basic read/write in the example. Looks like a very similar problem in this post:

    http://forums.NI.com/T5/instrument-control-GPIB-serial/visa-serial-communication-problem/m-p/567065#...

    But the trick of nature of endpoint does not help in my case: I tried to toggle the termination character setting in the property node and different combinations of '\r', '\n' as termination characters, but nothing has worked so far.

    Seems to me there is some difference between the interpretations of the same order to Hyper Terminal in Labview. But I just can't understand what it could be.

    Anyone with a similar experience could give me some comments/suggestions? Thank you very much!

    Another difference between hyperterminal and labview is the speed of sending characters.

    LabVIEW breaks out the whole string to the controller

    HyperTerminal is this character by character. So much slower and slow the controller can be affected by this.

    You could add a loop around the writing of visa (to make it easy convert the string into a byte array outside of the loop and convert it to a string inside and you have a shipment char by char in LabVIEW

  • VISA + Serial Communication - need help!

    Hello world

    I have a lot of help with my project of this forum and I'm looking for more . Thank you for taking the time to help. Please bear with my as I ask a LOT of questions.

    I intend to control a frequency converter using its series terminals and send orders from my PC + LabVIEW it. The commands do the basic functions like, start, stop, speed up/down etc etc. I use a converter Series USB to transfer data.

    Now, I ve played with examples like SERIAL COMMUNICATION VI and others and I begin to understand the functioning of VISA.

    Q1. In order for LabVIEW + VISA contact my frequency converter, do I need to install some sort of a driver for him to recognize? The frequency controller is old ages, even I don't know and I don't think I can find a driver for it any time soon? What kind of driver I'm looking for? Is it possible to customize my own driver and which would be easy?

    accessory included - process.jpg

    I downloaded some pictures about the problems of data format. I need to send information to the converter to format "telegram" as shown in the image below. Each 'function' in the 'format telegram' has varied length in bytes: some have 1 others have 2, other 4...

    I also downloaded an image called "Format.jpg" which indicates what information each of these 'functions' will contain. Note:-the frequency converter uses only the last 4 bits.

    Say for example:

    START function will have this bit of information-

    Start the Byte - ASCII ' 59 "

    Address - 00

    Control character -? I'm not sure what it should be I need to use the converter based on parameter values - is confused on what to choose - C, U, I or r Start, stop, etc. have their own specific parameter values such as 402, 404 RESP, so I guess I want update (U)?

    Word of State control -? depends on the previous action

    Sign - do not necessary

    Data - 0

    Comma - is not necessary

    check the sum - is not necessary

    Stop the Byte - ' > ' (ASCII: 62)

    Phew... How would I go about clubbing this whole format together to send a control signal? Put all this information in a table allow somehow?

    Please help to me... to achieve desperately need...

    Thank you

    Sandeep

    It would be useful that you could find a driver, but it is not absolutely necessary to have a. You can write your own, use the Instrument i/o Assistant, or use VISA readings and some discreet.

    The format of the commands is a bit complicated but not impossible. You just need to be careful to have the exact number of bytes.

    What I don't see in the atttachments, it is possible words to control and the State and the number of parameter. I hope these are in another part of the manual.

    A bytes example (without the control and settings) to update the frequency to 12.34 could be '<00U________+123403??>'.

  • Treatment in time loop with microseconds.

    Hello

    I am make only one application in Labview where I capture the image of a camera and image processing. The camera is communicate with the Board of Directors NI PCIe-1433 in the PC with the camera link. This device can operate with a rate of 2000 frames per second. For the treatment of each image in the pc I need a time loop that work with microseconds. The problem is that this time loop only works with MS Windows. If I use the real time module, can I configure this time looping with microsecond or is there another solution?

    Thank you

    Hi xisco,.

    with LabVIEW Realtime, you could create a loop with the order of a microsecond wait States.

    BUT:

    Why do you think you have need of these wait States? What is the purpose of these expectations?

  • Order to internal model with cRIO, synchronization of time loop

    Hello

    I work with control design Simulation & toolkit and I want to implement an internal model control to a real-time target. I want to implement my simulation (as an attachment) to the real target (cRIO-9024 OR cRIO-9112). I removed the transfer function of the process, I broke the line and I added my input/output of the cRIO modules. I put a 1ms, Euler ode solver step size and synchronize the time loop. Unfortunately it does not work properly. The loop decreased the speed a lot and I can't get 1 ms response time and, finally, a good answer for my system. This means that I can not 1ms response for loop? What is the problem of the computer, windows or hardware real-time or software? Simple or I did something wrong? All the advice you will enjoy.

    Kind regards

    Kamil


  • Programming of the digital I/o pins on the NOR myRIO-9100 for serial communication

    I use NEITHER myRIO for my robot and I want to use four reading of the distance sensors that communicate via the serial port. But the myRIO has only two UART ports on board so I was wondering if there is a way to program the digital pins use for serial communication. Any help appreciated.

    It is possible.  Here is an example that I could find.

    Example of reference to RS-232 for LabVIEW FPGA Interface

  • problems with timing in a time loop in a structure of the event

    Hello

    I'm using labview to control three motors stepper, running the three stages of different translation in different axes (X, Y and Z). Please see the attached VI, focusing on the structure of the event on the RIGHT side.

    In the Z axis, I am trying to run the engine for 5 seconds, after clicking on a button. I have attampted to do by adding a sub of elapsed time VI within a while loop, located in the tab 'Mouse before Z down' the structure of the event. A similar "elapsed time while loop" is also included in tab 'Z reverse the mouse down' the structure of the event.

    Separately these "elapsed time loops" work very well, BUT when I run a Z direction after another, say 'Z Reverse' and then 'Before Z' then they annoyingly interact. The calendar is gone, with the moment where we add, rather than rebooting.

    No idea how I can reset the time elapsed while loops? Or is there another method better do?

    Thank you very much

    Charlie

    charlieryan wrote:

    I take a wire from the 'i' of the while loop at the entrance of the Sub autoreset - VI of tiem will blink?

    No, connect you to the "reset", not "autoreset".

  • Time-loop at 1 MHz

    Hello everyone,

    After if you are looking for something already post on the subject, I found a lot of interesting information but no directly who can answer my question.

    I have LabView with time real extension.

    So far, I managed to do a time loop at 1 kHz, but the timer, MHz 1 option is gray, so I can't choose, even with the module in real time.

    Issues related to the:

    -J' heard that MS windows is limited to approtimatly 55 ms of precision. Is this true? I don't understand really because in this case, why NEITHER made a 1 MHz if it is not possible for MS windows to do?

    D ' other hand, how can I do the timer of 1 MHz for my time loop? Is there any process to do with the real time module to do?

    Thanks in advance for your help.

    Vivien

    What you did shows no need to have a while loop clocked at 1 MHz.  Value your ongoing samples DAQ assistant and collect many or all that is available.  Analyze and and for the file.

    A few tips.

    Signals of fusion is extensible by dragging the border down, so you can merge all the signals in a single step instead of having several signals fusion.

    You have the risk of rapid growth of the paintings that fill your memory using the concatenation of tunnels.

    You'd be better off using an architecture of producer/consumer to obtain data in a loop, then go to another loop for analysis and writing in a file.

  • Windows 1 kHz time loop limit reason

    I use a loop timed in Labview2011. I'm not able to exploit the time loop above 1 kHz or less 1 msec .i read in a reply on the forum which, due to windows, it is not possible to operate above 1 kHz, but the reason no didn't to .i want to know why windows cannot function the time loop above 1 kHz?

    Yours sincerely

    Ali211 wrote:

    I work with Labview RT and I know targeting the PC configuration, but I don't know the reason behind windows limitaion of 1 kHz at max?

    Yours sincerely

    The question is the clock source.

    I used a hardware clock (a NI DAQ device with a built-in clock) to drive a loop timed at 2 kHz, but which is possible using a hardware clock.

    For cycle rates MHz, you mentioned above, you will need to move to an FPGA to get this type of perfromance.

    As to WHY?

    Enter the "way back machine" and setting the target date to about 1979, we find that PC came equipped with keyboards but a mouse is an add-on. If you have added a mouse, you have found that 50% of your CPU is used each time that you moved the mouse. Since all what we had were at the time not big thing BACK. Go forward in time to Windows 3.1 we always run on top of BACK, but we could now use a mouse.

    Now to give the impression that the mouse cursor has keep in touch with the mouse moves, interputs were firing repeatedly and put necessary screen to update as quickly as possible. THEN it turned out that using a clock SO that trigger a 1 KHz has been fast enough to deal with the mouse.

    Windows has been designed to use a 1 kHz clock and until MS decides to use a faster clock, we need lieve in this environment... unless you give up Windows and switch to another OS.

    Ben

  • Serial communication - ignore parity error

    I have a question about how LabVIEW opens a serial port for communication. I communicate with a device that uses a protocol owner. It sets and clears the parity bit to indicate the nature of the response. For example, the orders are sent with the parity bit higher while responses are sent with the weak parity bit (unless the answer is at the end of the transmission, in which case the device sets the parity bit high to indicate).

    My problem is the way that LabVIEW opens the serial port for communication. Using Portmon, that I captured the control indicators, that it sends to Windows to configure serial communication:

    IOCTL_SERIAL_SET_LINE_CONTROL   Serial0 SUCCESS StopBits: 1 Parity: MARK WordLength: 8IOCTL_SERIAL_SET_CHAR  Serial0 SUCCESS EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13IOCTL_SERIAL_SET_HANDFLOW  Serial0 SUCCESS Shake:1 Replace:44 XonLimit:64 XoffLimit:64
    

    Note the values 'Shake' and 'replace '. In my view, they are originally bytes with parity errors is removed. A separate RS232 Comm Debug tool that I use with success looks like this:

    IOCTL_SERIAL_SET_LINE_CONTROL    Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8IOCTL_SERIAL_SET_CHAR  Serial0 SUCCESS EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13IOCTL_SERIAL_SET_HANDFLOW  Serial0 SUCCESS Shake:0 Replace:80000000 XonLimit:128 XoffLimit:128
    

    Notice the difference in values. By using this tool, Windows does not packages with parity errors - that's what I want. Is there any way to change how LabVIEW opens the serial communication port to achieve?

    I tried to change the parity, where the ILO is defined differently, but I think that I am running in a race condition; LabVIEW can not run the code and change the mode of fast enough parity before the next byte of data is sent by the device.

    Ravens fan: the parity bit, in the proprietary protocol, that I use, is not used for parity checking. Basically, the protocol uses a 9-bit serial communication. The parity bit must be paid or compensated according to what byte do (if it is a command, if it is the end of transmission, etc.).

    I found an old post on this page which seems to answer my question (my apologies for not completely research before posting... I learn the right use/search phrases that I find more information). I download the 3.4.1 version of VISA now.

  • Use of LabView delay in a while loop instead of use the inherent instrument of time loop.

    I have a lmg500 sez I use. It has the possibility of continuous measurement of data, with a cycle of user control loop (always using a while loop but the delay comes from the instrument). The problem is that the time of the loop is not constant. Can I use a very short time (100ms) as the cycle of the instrument of the time, but use a longer period in time loop collect data?

    I know that many instrument offers the same capabilities, so the issue is relevant to each of them.

    Thanks for any help

    You're not going to be accurate with Windows. The time between samples should be that you have programmed the instrument (i.e. the time between each value in the table 1 d) but the rate of the iteration of a while loop always will be the subject of a jig on a bone not real-time.

  • SERVICE PACK 2 INSTALLS BUT SOON BLOCK BIG TIME.

    SERVICE PACK 2 INSTALLS BUT SOON BLOCK BIG TIME. I tried to install it 4 times. Whenever he works initially but soon has a devastating accident. The screen freezes and goes to a pinkish color ill. I use the system restore and go back before the installation of Service Pack 2. I chipset intel. Inspiron 530 desktop computer. Graphics NVIDIA GeForce 8300. Intel (r) Core (TM) 2 Duo CPU * address email is removed from the privacy * GHz and 32-bit operating system. A way to solve this problem? PS, Currently I have Windows Vista Service Pack 1 installed that works very well.

    https://support.Microsoft.com/OAS/default.aspx?PRID=13014&Gprid=582034&St=1

    Free unlimited installation and compatibility support is available for Windows Vista, but only for Service Pack 2 (SP2). This support for SP2 is valid until August 30, 2010.

    Microsoft free support for Vista SP2 at the link above.

    See you soon.

    Mick Murphy - Microsoft partner

  • Blocked several times trying Ad cab download

    Blocked several times to try to download Acrobat Ad with the message: "close Intrnt Explr."  When closed, message is repeated to infinity... What should I do next?

    Use another browser to download.

  • Impossible to change "first frame" and play a time/loop/Single Frame

    I work is CS3 and problems by changing the first picture on a graphic symbol. When I type in a new number, it jumps back to the former. When I try to change, play a time/loop/single frame layout jumps to the previous setting. I'm trying to simply change this option on a keyframe in the layer of the symbol on the main stage. I have experienced several times, but failed to get the workaround for the moment. I know I can do what I want. In fact, I do a couple of points earlier in the instance of that symbol without problems. Any suggestions?

    Thank you.

    Tyler

    My guess is that somewhere, you have the box checked synchronization. It sometimes seems to do your graphics to synchronize their animation so that it is always the same and other times that he seems to have no effect at all. So I don't really know what it is supposed to do.

Maybe you are looking for

  • Need drivers for XP due to the change in Vista

    I have Vista and want to exchange it for XP can I download the drivers and save on cd to load on XP? If yes how?

  • Satellite A500 - 17 X - cursor has changed to a black box

    I have an A500 - 17 X and the cursor has changed the normal 'I' a black box that flashes in the same way as the normal cursor 'I '. I'd appreciate any help with this as it is now driving me crazy! Thanks in advance Liz

  • synchronize the outputs digital AND digital NI USB 6343 entry

    Hello I use NI USB 6343 to fly 1 TTL devices. This device can also produce a TTL signal to indicate if the door is opened/closed. I use digital Bool 1 line 1 Point. I was able to reverse the opening/closing of the door on time. But I would like to sy

  • Backflip more memory

    I bought a 32 GB sd card for my phone and I need to know if there is a way to change the internal memory on the phone to use the sd card. The phone becomes full and does not allow me to install more apps?

  • Extract the matched data in CSV or XLS

    Hi all I have a file that I can download as a CSV or XLS file. I want to take the file that contains the customer data (name, company, address, city, State, country, e-mail, telephone, etc.) and separate customers who are in the United States and tho