Changing Parity on Serial Port (VISA)

Hello all,
I'm having a problem with some parity bits on my serial port. What I need to do is send the first byte of data with mark parity and then all remaining bytes with space parity. I have tried using a property node to do this and it seems to work with one small problem: the system is changing the parity to space before the first byte (the one with mark parity) has finished transmission. As a result, the first byte is ending up with space parity instead of mark. How do I wait until the first byte is finished transmission so that the parity change isn't applied to it? I have tried flushing the transmit buffer on the visa. Is there a way to use the event system to solve my problem?

This is just a shot in the dark.
Try right-clicking on the VISA write and select "do I/O syncronously".
If this works, please let me know. I have been trying to figure a good reason to do serial I/O "syncronously" but was not able to come up with one until I read your question.
Curious,
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • How to abort serial port VISA from wating.

    Hello All
    How can I abort serial port VISA while wating for a byte to arrive.
    Lets say I have timeout set for 3 min. but I want to cancel it before that , how to do it programatically?
    I tried to set timeout to 0 while wating for data, and it works, but I do not like this method.
    Thanks in advance
    Pawel

    Hi again
    I have made some investigations, and here is what I found:
    None of Serial Port Brake nor Set Time out work while the "VISA read" is active. All property node can access VISA class only when the "VISA read" is finished.
    Therefore, it looks like there is nothing I can do when VISA is active. The only solution is not to allow VISA read.vi to activate. I think I can use your idea and monitor the amount of bytes at the port.
    I wanted to avoid it.
    Thank you for your help
    Pawel

  • Adapt QCM serial port VIs for USB QCM

    I am trying to adapt Labview VIs that use a serial port and use them a QCM that uses a USB port. Does anyone know how I can do this. I have limited labview experience.
    The USB QCM gives me data for the thickness and mass gains of the materials deposited but I cannot correlate those mass gains with the pressures in the reactor. I need to correlate the mass gains with the pressures so I can know the pressure profiles of the materials I deposit. The serial port VIs (for a different QCM) save the data for the mass gain and the corresponding pressure but I cannot do that with the USB QCM. That is why I want to adapt the older programs which store all the information and use it with the new QCM.
    Thanks
    -Sicelo

    You would likely want to use VISA to communicate with this USB device.  If you get the VISA alias for the device, you should be able to replace your serial code with VISA code that does very similar things (such as read and write).  This link shows the kind of thing you should encounter when using LabVIEW to control a USB device.

  • Slow Baud Rate serial port (VISA)

    The last version of LabVIEW, 7.1, has the serial functions incorporated on VISA Resources, and it doesn´t possible to work with baud rate lower than 110 bps. I have a big stuff of applications that works with 5 bps. It´s a serial protocol that send a byte, e.g AA (hex) via serial line, with 5 bps, and after the rate is increased.
    I tried to use dll (CIN Function) but I think is impossible, cause the resource declared at the c code, so Im thiking to use a dedicated COM Dll, and use Call library Function)
    I´d like to know if somebody has a tip or similar problem.
    Thanks in advance
    Fabrizio
    Test Engineer

    Matthias Müller writes:
    > Hello,
    > I'm using LabView to controll a spektrometer through the serial port. I
    > use VISA for the communication with the device. Unfortunately, the
    > device is always in 9600baud mode after power on. So I have to change
    > the baud-rate each time by a command i send to the device. So I open a
    > VISA session in 9600 mode and communicate with the divice to set it to
    > 57600baud. After that, i have to reset my local serial port to the same
    > baud-rate. I do this with an property-node, where i change 'Serial Baud
    > Rate'.
    > Unfortunately, after I did this, the vi's that want to communicate after
    > the reset of the baud-rate stop with an error:
    > -1073807298
    > VI_ERROR_IO
    > Could not perform read/write operation
    because of I/O error.
    >
    > (I try to write to the serial port after change of the baud-rate)
    >
    > I would be very glad, if someone could give me an advice, why it doesn't
    > work, or how to make it work.
    > Thank you a lot.
    > Matthias
    Matthias,
    my first approach would be to close the first VISA session after the
    property node. Data dependency is achieved by the error cluster feed
    into a new session with the new properties.
    IMHO you've discovered another bug in serial VISA.
    HTH,
    Johannes Nieß
    P.S:What brand/modell of spectrometer are you programming for?

  • HELP IN KEITHLEY output source PROGRAM!(how to change GPIB to serial port)

    As the topic suggest,can anyone help me in changing from GBIP to serial port?The file is found inside the .lib that i attached.
    filename:2400 swI Linear Stair MeasV - LED.vi
    thanks!
    Attachments:
    KEITHLEY PROGRAM.zip ‏434 KB

    zzz(yawn)!!!!!!  I did not expect people to help me COMPLETE my work;i was just seeking advice on small portion of that program.Isn't what forum is used for?For posting questions and seeking advice from professonals and those willing to help?If you're just idling around here and doing stupid things just to show that you're an active forum user,i would think that you're a pathetic fool that have no life.Please seriously re-consider your words CAREFULLY next time before you post stupid things.Thanks=D
    PS:btw i did try out the program;if not how can i ask a question?You expect the question to just pop out of my brain without thinking?and thanks the person for giving me INVALUABLE advice(the person before that lame "nyc aka joker") as it did worked,and i'm still trying out the test.Thanks for it again=D

  • My Application gets Error 37 when using Serial Port VIs.

    My Application works fine developed with LV 6.1. Then I updated to LV 7.1 and now the Executable of my application gets error 37 when using the old serial port functions. The "serpdrv" file is located in the application directory and is from 02/2002. The application runs well in the development environment after I placed the "serpdrv" file in the LabView directory. I tried to put a line with "serialDevices=..." in the .ini-file of my application but this did not cause an improvement. I also tried to rebuild the EXE with this line in the "labview.ini" file but nothing changes.
    Does anybody have another idea ?
    Many thanks for help
    Thomas

    >Did you actually replace the old serial functions that come with 7.1 with the functions from 6.1?
    Yes. E.g. "open serial driver.vi" uses "open device" with "serpdrv" as device string.
    I had the same problem running my application as VI´s. After the copy of serpdrv into the LV 7.1 directory everything works fine.
    I don´t understand why the application running as a .exe doesn´t find the serpdrv when it is in the same directory....
    Nevertheless many thanks for your answer
    Thomas

  • TROUBLE BUILDING VISA Configure Serial Port .vi

    I posted by mistake in DAQ.  My application Builds fine in LV 7.0, however in LV 8.2 using the Project folder, I receive the following :
    Polymorphic VIs cannot be used as Startup/Exported or Dynamic VIs for applications or shared libraries.
    C:\NEM DS18S20 TEST-8.20\NEM0775B\NEM0775B.llb\VISA Configure Serial Port
    Visit the Request Support page at ni.com/ask to learn more about resolving this problem. Use the following information as a reference:
    Error 1035 occurred at ABAPI Dist Check if PolyVI.vi -> ABAPI Load All Libraries And VIs.vi -> ABAPI Dist Build LLB Image.vi -> ABAPI Copy Files and Apply Settings.vi -> EBEP_Invoke_Build_Engine.vi -> EBUIP_Build_Invoke.vi -> EBUIP_Build_Rule_Editor.vi -> EBUIP_Item_OnDoProperties.vi -> EBUIP_Item_OnDoProperties.vi.ProxyCaller
    Possible reason(s):
    LabVIEW:  Operation is invalid for this type of VI.
    I am using, Polymorphic VI = VISA Configure Serial Port to configure my serial port and then count bytes received for certain serial Port CmDs.
    I am only using the Serial Port (Instr) of the Polymorphic VI.  What is the easiest way to BUILD a application that will work????   I've used this method back to 4.1.  Can I change VISA Configure Serial Port .vi from a Polymorphoric to a Non Polymorphic and still initialize the Serial port??  This new BUILD/PROJECT METHOD is not good. 
    Please Help
    Brian Campbell

    Briancam-
    Have you set the VISA Configure Serial Port as a startup VI in your build specification? If you are using that VI as a subVI in one of your VI's, then you do not need to manually add it to the startup list, LabVIEW should automatically add it as a dependency.
    Xaq

  • [Linux] Serial Ports

    Hi,
    are the PC Com1 & Com2
    serial Ports still supported
    under LV Linux version ?
    I dont find the Serial Port VIs anymore ?
    The idea was to move a LV .vi from WinX to Linux.............
    any experiences ?

    In both Windows and Linux, you are supposed to use the VISA functions. It's almost the same, and there is a compatibility menu, with wrapper VI's that simulate the old functions. I'm currently developing an application in windows (old habbits die hard), and I'm running it under Linux without any serial problems.
    Regards,
    Wiebe.

  • The "VISA Configure Serial Port" VI will only run at 9600 Baud

    I have written a Serial Port monitor "RS232 RW.vi"  that works for the most part. The problem is that it will not respond to alternate port configuration settings.... For instance: the default RS232 Serial port configuration is:
    (COM1,9600 baud,8 data bits,1 Stop bit, None no parity)
    As a test, I am using a Null Modem Cable to connect From my LabView Com1 port to another PC running RealTerm Serial Port Monitor.. Using my newly designed "RS232 RW.vi"  With port settings of (COM1,9600 baud,8 data bits,1 Stop bit, None no parity),  I can send and receive data back and forth all day long no problems....
    However, if I configure the "RS232 RW.vi"  port to any other configuration, such as (COM1,2400 baud ,7 data bits,1 stop bit, Odd parity).. It will not take the expected chances and continues to operate @ 9600 baud etc.
    I then changed the "RS232 RW.vi"  default settings to (2400,7,1,Odd)
    it still refuses to deviate from (COM1, 9600,8,1,None...)
    I also went into the Win XP  Device Manager on the LabView system and manually configured Com1 to 2400,7,1,Odd  
    and still,.... the "RS232 RW.vi"  will only operate @ 9600,8,1,None
    Can anyone else test drive my VI and see if they have the same problem of not being able to see new changes in the Port configuration settings ..other than (COM1, 9600,8,1,None...).... ?
    FYI.. Unfortunately my LabView is running on Version 6.0 so you may need to up-convert the attached vi
    Solved!
    Go to Solution.
    Attachments:
    RS232 RW.vi ‏102 KB

    Instead of just appreciating the comments, you need to implement them.
    Having the VISA close inside the loop is definitely the problem.  And Crossrulz is 100% correct about the problem being that the serial port gets reset to the default baud rate after closing the port.  Here is the proof.
    Note that while you may have set the port settings manually in device manager, those settings are revised by the VISA driver.  If you look in Measurement and Automation Explorer under Devices and Interfaces >> Serial and Parallel, you'll see the default settings that the VISA driver uses.  If you change the setting there, your program will work the way you want.  But that is not the correct fix.  The correct fix is to get the VISA close out of the while loop.
    The port settings are established in this order.
    1.  By the Windows device drivers.
    2.  By the VISA driver as established in MAX.  Since you are useing VISA, these settings will automatically override #1.
    3.  By the port settings you set programmatically in your LabVIEW program.
    Attachments:
    Example_VI.png ‏18 KB

  • Serial ports not appearing in MAX - VISA installed.

    Hi All,
    Had a rather strange issue today that I couldn't resolve with serial ports not appearing in MAX (and hence being inaccessible to LabVIEW). Under the windows device manager it shows 4 COM ports and I have verified with an external program that they are functioning correctly.
    I had the LabVIEW 2011 SP1 f2 runtime installed, DAQmx 9.6.1 and NI-VISA 5.3 (5.2 also didn't work).
    Things I have tried:
    - Updating VISA from 5.2 to 5.3
    - Reinstalling the COM port devices under device manager
    - Changing the COM port numbers
    - Verifying that the COM ports are functioning correctly
    - Tried adding a USB to Serial converter as a new COM port
    - Reinstalling MAX
    - Reinstalling NI-VISA
    - Reinstalling everything (reboot each time when prompted)
    - Resetting the hardware configuration from within MAX
    - Run installers / MAX as administrator (this is running from the local admin account)
    - Checked that NI-VISA appears under software in MAX
    - Repaired MAX/NI-VISA
    Is there anything else that could cause the COM ports not to appear in MAX when they appear (and work correctly) in device manager when a reinstall of NI VISA / MAX won't solve?
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets
    Solved!
    Go to Solution.

    I found the solution - it turns out that the serial ports were available to LabVIEW, they just didn't show up in MAX because installing just the runtime does not show the devices in MAX.
    Despite doing a lot of googling earlier, it didn't throw up this knowledgebase article until I searched for it under a different phrase - http://digital.ni.com/public.nsf/allkb/766FD80DAE42E52886256A0200619CFE?OpenDocument
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Rs485 and VISA Configure Serial Port.vi ?

    I'm given the following spec:
    RS485, full duplex asynchronous, 19.2K baud, 1 start bit, 1 stop bit, 1 parity bit, and 8 data bits.
    VISA Confgiure Serial Port.vi does not have input for 1 start bit and parity choices are none, even, odd, mark, space.
    What should my settings bit for this to work?

    Since the VISA Confgiure Serial Port.vi does not have an input for the start bit you can just ignore this. For the parity bit, your instrument should give more information. For example, two of the choices are even or odd. These are both one parity bit, so your instrument needs to define whether it is odd or even. It should say on the spec sheet.
    Hope this helps!
    JenK

  • VISA get resource name doesn't return USB serial ports

    We built an application on a computer that had an onboard serial port - COM1.  We put the option to change the COM port in the application.  We installed the built application on a computer with no serial ports, but installed a USB to serial converter that registers as COM3.  LabView does not see this port, even with a test application to return only the VISA resource names. 
    We have verified that the port is good with another program (a Modbus simulator) and installed the latest VISA runtime v4.41 separately to no avail.
    Any suggestions at further troubleshooting would be extremely helpful.
    Joe T.
    Solved!
    Go to Solution.

    My main application still isn't working, but now the small test ones are.
    Here's what I did:
    1.  Update my LabView 8.5 with the latest VISA runtime - 4.4.  This updated the Installer as well.
    2.  Added the MAX Installer to the build.
    3.  Added  the NI-VISA Configuration Support to the build
    4.  Uninstalled the application and reinstalled it with the new install volume.
    When I run MAX, COM3 shows up.  It also shows up in the Get Resources test application.  The simple test Modbus write program works, too.  I have a sneaky feeling that COM1 may be hard-coded somewhere in the main application; our next task is to find where the communications breaks down in our code.  The bottom line seems to be a lack of experience with the Application Builder on our part.
    Thanks to all who contributed!
    Joe T.

  • Warning 1073676424 from VISA Set I/O Buffer Size.vi on a serial port

    I am porting an application from LabVIEW 6.1 on Windows to LabVIEW 7 on OS X (Mac). It was very painless except some GUI modifications.
    The application involves 30 KB data from a instrument through a RS232 serial port. I found the application misses data whenever the computer is busy. The problem came down to the unchanged buffer size.
    Attempt to change the buffer size of a serial port with "VISA Set I/O Buffer Size.vi" fails with a warning of 1073676424 (The specified I/O buffer is not supported). Even the example vi from NI web site "Advanced _Serial_Write_and_Read.vi" has the same warning.
    I wonder what I am missing.

    Under the hood VISA is using the POSIX serial interface for Mac OS X (same as for Linux and Solaris). This interface does not support changing the buffer size. Hence, the buffer size is fixed to the internal OS buffer size. The only thing that changing the buffer size will do (for the out buffer) is to have VISA not flush the data after every write. This is a limitation in the serial API for Mac OS X. Therefore, VISA reports a warning.

  • Control Camera Attibutes through serial port using VISA commands

    Hi there,
    I'm using a Basler acA2000-340kc camera through an PCIe-1473R FPGA as frame grabber.
    I would like to be able to configure the camera through the serial port just in LabView, not using a third-party as Pylon (which I can do now).
    According to this forum post 
    http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/My-Basler-acA2040-180km-NIR-is-not-visible-in...
    this is possible just taking the VI posted here
    https://decibel.ni.com/content/docs/DOC-5049
    and converting from IMAQ to VISA, as RIO frame grabbers cannot use IMAQ. I have been trying to do this by changing the IMAQ vi to their VISA equivalents, but I have no good results.
    Does anyone know which are the steps to go from that piece of code to one that can be used to control the camera in my case?
    Thanks a lot,

    Hi i.popa,
    Basler makes the Basler Binary Protocol Library for serial communication with their cameras. If you make sure you're running the serial server section of your FPGA code to keep the serial port open, you should be able to use calls from this library to communicate with your camera. We have a community example with more information on using the Call Library Function Node to call a DLL. This DLL will take care of all the processes needed to write from and read to the registry, so this implementation will probably be similar to the example program you listed above, using calls to this library instead of the IMAQ Serial functions.
    Good luck with your application!
    Emily C
    Applications Engineer
    National Instruments

  • Problems with VISA and the serial port

    Hello,
    i have a little problem with the serial port and VISA. I have changed an existing LabView- Software in that way that I have replaced the serial- module by the VISA- module. The function of the program is to communicate with different devices by RS232. After changing the modules to VISA the software doesn't work probably. The problem is, that when I try to communicate with one of the devices first I get no answer. When I try it a second time after some seconds the communication works perfect. After about a minute I send another message to my device but there is no answer again. I have to send the message again.
    I hope someone in this forum can help me with my problem
    cu Marco

    Marco,
    this sounds very much like a problem with the termination of your messages. You may have to tell VISA to add a termination character. Please follow the instructions in this document.
    Best regards,
    Jochen
    National Instruments Germany

Maybe you are looking for