VISA select events dumps memory LabVIEW on serial port

I recently tried to use the VISA Event functions for serial communication and had a nasty surprise.

For some reason, it seems to drop a few hundred bytes of memory of LabVIEW in the COM port!

I do something terribly wrong or is it nasty bug lurking in LabVIEW here?

You'll need 2 COM ports, a null-modem cable and the attached vi in order to test this. (Null-modem: as long as the pins 2 & 3 are exchanged and PIN 5 connects via it will do.)

1. connect a COM (A) port to another COM port via a RS232 NULL-MODEM cable.
2. run the "Port B.vi" (the port COM B value).
3. run 'Port A.i"(position A COM port)

4. click on send a bunch of time at random on "Port A.i".

Result: If it worked correctly you should only get a single WAITING response from Port B.vi for each request sent.
If the bug appears, you get a few hundred bytes of memory of LabVIEW dumped on the COM port by Port B.vi.

It does not always seem to do, you may need to stop and start "Port B.vi ' a couple of times and quickly click the button send on"Port A.i"when they run together."

It happens on 2011SP1 and 2009SP1 of LabVIEW.

Bug seems fixed in NI-VISA 5.4 that comes with LabVIEW 2013. (Does not test in-depth yet, just using the screws included in the original post).

Tags: NI Software

Similar Questions

  • VISA select events fails for TCP/IP resources

    When I call VISA activate events to activate Service requests for my instrument of TCP/IP (VXI-11), it returns the 1073807265 error code, "no listeners is detected (NRFD both NDAC are Desassertion).»

    Apparently this error means that you are not connected to your instrument. all the end of Discussion Board by referring to these Knowledge Base articles:

    Error-1073807265 and

    Error-1073807265 or-1073807304 was held at VISA Write

    But this isn't the case here: open/read/write/status-byte /... all operations work perfectly.

    Other observations:

    • What allows a USB connection for the same instrument (USBTMC-USB488), service requests works as expected, so I think that basically, I know what I'm doing.
    • I tried the same operation in the Test VISA Panel in MAX - same result (works on USB, not on the TCP/IP Protocol).
    • I tried Mac OS as Windows - same result.
    • A curious thing: Mac and Windows pops up a warning of firewall when I ran my test program. ???

    For completeness, I included my program small test, which should work with any compliant IEEE 488.2 instrument. Any ideas would be GREATLY appreciated; This thing is driving me crazy. Oh, by the way, I use LabVIEW 2010 SP1 and 5.0 VISA.

    Update:

    The main problem proved to be a problem with the unit - one of ours, being developed. Slot VXI-11 (= IEEE 488.2 top of the TCP/IP Protocol), the event allow visa emits a CREATE_INTR_CHAN RPC Remote Procedure Call (), on which the instrument is supposed to open a socket (the channel of the interruption) to the host. On our instrument, this socket connection was failing, causing VISA activate events return the error indicated.

    A secondary issue was that the instrument requires the status byte to read in order to recognize the host received the interruption. I have that in the original version of my test program.

    For those interested, I attach the output of the software Open Source network analysis, Wireshark, showing the build-up and disassembly of the chain of interruption VXI-11 - the working version and the non-working. I also include the updated release of my test program.

    Special thanks to Lam Dang of NI Applications Engineering (Germany), which got me going in the right direction to solve this problem.

  • visa resource name shows only not all serial ports on labview no dev environment pc!

    Hi all!

    on my pc of labview development, I have no problem, but when I run the EXE to my application

    on the other pc (have installed the runtime labview on this) - there is no port com to choose.

    What can I do?

    did you install the VISA?

  • setting the parameters of serial port VISA does not persist

    When I set the baud rate using the VISA's Interactive Control Panel for a serial port specific (ASRL) and then close the window for ASRL, baud rate goes back to the default value.  Why doesn't baud rate?

    Also when I change the port settings for a particular serial port (COM) on the side of Windows, why can't I see these same port settings when I look at them from the interactive panel of VISA?

    Also, when I set by programming the output baud rate for a particular ASRL (code C), why is it reset by default when I re - run my program and do a get on baud rate?

    Some information:

    My C program works on an industrial PC which has a PXI MXI connected to it expansion chassis.  Series 3 cards in the expansion chassis.

    When you close the VISA session and/or close your application, port settings in the system default values.  It is a very normal behavior.  As long as you keep your open VISA session, the port will behave how you already told (set Baud Rate, etc.).

  • Transfer an image via the serial port of PC to PC

    Hello world

    can someone help me to transfer an image file to another PC with Labview via serial port?

    I tried to use the IMAQ functions to decode the image to a string. but there is a problem at the receiving end to retrieve the image.

    is there an easy way to just sent and receive an image via the serial port file?

    Thanking you in advance.

    Morgane

    Hello

    I love people who love to learn. Thanks for listening.

    I updated read and write Subvi is because I believe keeping simple and straight threads more readable program and less bugs remain.

    Even better, my eyes straight lines i do not get tired too soon.

    good luck with your program.

  • LabVIEW Serial port wait event with Serial Termchar

    Hello world!

    I'm quite new with LabVIEW and I'm having some trouble trying to communicate using the serial port.

    I'm trying to detect a data frame with an 'X' as the terminal character sent to the serial port.

    The problem is that with the VI attached on this post I am not being able to detect the chariot of the term series.

    I tried to make some changes to fix this, but I can't.

    In VI, I used a function of Type Cast when I was using the wrong ASCII for 'X' value, but it still the same.

    Can anyone help with this?

    Thank you!

    Best regards

    Omar

    This will work only if your message can never be more than 8 characters including the character. term set this value to 1000 or something that is guaranteed to be always bigger than the size of your message and all should be good.

  • How to transfer files from PC to PC via a serial port using labview

    I need to transfer files (.txt, .doc, .xls) from PC to PC via a serial port using LabVIEW. Is it possible to transfer files, if so how to transfer?

    Yes, it is possible to transfer files with the serial port using LabVIEW.  The files are just collections of bytes and the serial port is good enough in the expedition of the bytes from one PC to another.  You must connect the ports series with a null modem cable.

    First, take a look at the example of serial communication.   In LabVIEW, go to the Help menu and select «Find examples...» ».  From there, you can search for "serial" or navigate to hardware input and output > series.  Select «Write series base» and Read.vi  Try this example to gain confidence on the serial communication methods.

    Then it's time to learn how to read and write files.  For this, the examples might be somewhat confusing as they deal with files that are presumed to have data of a specific type in them.  I would recommend just familiarize yourself with the functions in the file e/s palette.  Specifically, familiarize yourself with the following functions.

    1. Open/create/replace file - on the side of your destination, you will need to create the copy of the file you are trying to transfer
    2. Close the file - when you're done reading or writing to a file, you must close it.  It cleans the memory used and finalizes write operations that are still floating in the write buffer.
    3. Read a binary file - is the best way to play a file when you don't really like what type of file it.  In your case, you just want to get these read bytes and sent so they can be written down instead of destination.
    4. Write to a binary file - next to the destination, is what will store the bytes in the file that you created with the number 1.
    5. Size of the file get (under the range of the advanced features of file) - you need to know how big the file is, so you know when you are finished.

    OK, so once you are able to create files byte write and read bytes from existing files, you can move forward.

    I suggest the basic method is to have the user specify a source file on the source PC, and a folder on the destination computer.  Then find the size of the source file using the number 5.  Divide this number of size by the number of bytes that you want to transfer to the times.  The series pads are usually around 32 k (if I remember correctly) in order not to exceed that.  Now start to send data by reading a number of bytes and this string output wiring to the feature of writing VISAS.  On the side of destination, you will want to monitor the serial port for bytes and read when they arrive.  This string of yarn to the writing of the function of binary file to add them to your destination file.

    This is the basic outline of how to do it.  He needs to not to overload him write and read buffers on the serial ports.  Initially, you can use delays on the side sending to make sure that the side reading has enough time to digest.  To make things faster, you can bring in a control of flow.

    If all that sounds a little intimidating, there are there Alliance member companies (such as the automation of PrimeTest) who can write this code for you and even provides a turnkey for you solution.

    Happy wiring,

    Dan press

    Certified LabVIEW Architect

    PrimeTest Automation

  • communication serial port works to the max, but not in labview

    Hello

    I am trying to connect a regulator to oxygen flow (flow Bronkhorst EL) to a laptop through a USB using MAX and Labview series port adapter. After the MAX aperture, I see my instrument on port COM5 and need to change the baud rate to 9600 to 38400. After this I querry the command: 06030101217D00\r\n, I can turn the mass flow at maximum power regulator (looks a little weird order because of the syntax of the instrument, but it works very well). If I write a vi to do the same and send the same string through visa series, I get no results, it seems that the command is not send to the device. I tried to change all settings for the serial port, nothing seems to work.

    I've attached an example vi here, any suggestions?

    Hello

    just a simple misunderstanding, happy that you added the code.

    In MAX \r\n will be always interpreted as send a cr and line break.

    In LabVIEW only when you select \codes view by right-clicking on the channel.

    In your situation, it now sends a-a r another- and a n

  • Clear VISA with event structure

    Hello

    I have a number of virtual serial ports of bluetooth as stream very quickly as soon as you open them with VISA configures port. I have set up/open these ports one after the other and it takes a lot of time (2 min), I think it's because they are com ports virtual bluetooth.  However, as soon as a single port is open, the data streams in and fills the buffer (eventually crashing the program), while I open other ports. I was invisioning something similar to an interrupt driven microprocessor to erase the buffer whenver it exceeds 2000 bytes to the port, my friend told me about event structures is similar to interrrupts. So, ideally, I would like to create a user event customized, defined by the property (bytes to the port) of a VISA com port node when it exceeds 2000 bytes. I would like just to run code that was going to free the buffer when occurs the same. Seems like a simple idea, I searched and did not find what I wanted to do.  Any help would be appreciated

    Thank you

    Chris

    Its delicate, but I think it would work.

    LV allows multithreading, so you can certainly run screws in parallel which are completely independent of each other.  But the challenge is that your code cannot access the same COM port simultaneously.  But the way you described the problem, which could be circumvented.  I think your 'COMPortMonitor' could sit and wait for each port to open before their follow-up... so that your main loop before opening the following COM port.

    Here's what the flow would look like:

    VI of HAND PORTMONITOR.VI                                      

    0 Begin execution of this

    1 separate launch PORTMONITOR.VI

    2 open COM1 begin implementation of this loop

    3 tell PORTMONITOR COM1 is open

    4 begin to monitor COM1

    5 open COM1 empty COM2 buffer when it becomes large

    7 tell PORTMONITOR COM2 is open

    8. start monitoring COM2

    9 empty COM1 & COM2 when they become large

    10 stop this loop when last COM is open

    11 more...

    In step 5, your parallel loop will work with COM1... so that your main loop is busy opening COM2.  In theory, I expect to run independently.  And you can try to put them in separate threads, too.  This links talking about parallel loops in series:

    http://forums.NI.com/T5/LabVIEW/multiple-parallel-asynchronous-continuous-serial-visa-reads/m-p/8090...

    BTW: I think that you must ensure that your VISA application is asynchronous to operate (right-click on them).

  • VISA serial port automatically configures scan of the available serial ports?

    I am using a VISA set a serial port to open a connection to the serial port, to enter data, make some manipulation of array and display it.

    My VI works perfectly until what I have build in exe and transfer it on a laptop with a USB converter to port series (as the laptop does not have a serial port).

    Windows allocated the converter to COM9, but I do not see it in LabVIEW.

    Do I need to use something like 'Find VISA resource'? If it does find something how can I change the name of resource VISA?

    I have attached a screenshot to give you an idea of what I'm doing.

    There is absolutely no reason to use all of this code. The original order of resource VISA name should work just fine. Have you installed the runtime VISA on the laptop? If so, did you also install MAX, so you can check the VISA resources on the latptop?

    In addition, since an exe file will run automatically when opening, have you provided a mechanism for a com port selection until the program begins the acquisition of VISA?

  • Error: The property node (arg 1) in .vi VISA set up a Serial Port (Instr)

    Hello

    I've seen people once they have gotten this error, but none of them really apply to my situation.

    Right now I use LabVIEW example code to read from a device manufacturer. This device is connected using a Tripp Lite USB adapter series (http://www.tripplite.com/en/products/model.cfm?txtSeriesID=782&txtModelID=2430) for the connection from the PC to device with RS232. The adapter works fine when using the software prepared in advance (not LabVIEW) given by the manufacturer and the COM port is seen by LabVIEW. When I run the program, I get the property node (arg 1) visa set up a Serial Port (Instr) .vi (I've also attached the VI but it's a standard VI I got of LabVIEW). I get this error despite the fact that I use the same COM port, who has worked with the manufacturer's software.

    I have attached manual of Protocol RS232/debit BUS (not sure if this applies) that requires the device. The device is a mass flow controller whose operating instructions is: (http://nemu.web.psi.ch/doc/manuals/device_manuals/Bronkhorst/917023--Operation%20instructions%20digi...

    I'm using LabVIEW 10.0.1

    Any help is appreciated

    Try to restart the PC and then try the LV version before trying other software.

    I have seen thrid party serial interfaces work on the first try but fail when you switch to another application. It was as if the pilot did not know that it was no longer the first process.

    Ben

  • Time GPS, Position, Velocity.vi - error-1073807360 reading was held at node (arg 1) .vi property VISA set up a Serial Port (Instr)

    We receive information such as the Latitude and Longitude of a receiver Garmin GPS18xLVC via a serial port on our PC using LabView 7.1.  Successfully, I connected the GPS on the serial port and tested with HyperTerminal.  I tried reading GPS time, Position, Velocity.vi several times and still receive the following error message: error 1073807360 has occurred to the property node (arg 1) visa configure a Serial Port (Instr) .vi.  I think it has something to with the configuration of the VISA series under vi.  Any suggestions would be greatly appreciated.

    Thank you

    I understood the question, that I had with the time reading the GPS, the Position, the Velocity.vi.  The vi. "do not open" port com automatically and so I had to modify the NMEA GPS Subvi reading to first open the port (VISA open command) and then continue with other operations.  Once I did this it started to work very well.  I don't understand why this feature has been left out because it won't work without it.  I tested the code with a receiver Garmin 18xlvc and it seems to work fine.

  • VISA from read/write to serial port - unable to implements several orders of writing!

    Hello

    I'm new to Labview and I'm reading from a pressure through a virtual serial port USB sensor. I am able to read the port when you use HyperTerminal

    The code sequence that I should write to the port in order to obtain measurements using hyperterminal is the following:

    ' *' (2A hex)-online start and the responses of the port by asking 'Command', I should then enter

    FF-online measurement select the port must ask the 'mode', so I should enter

    0 has-online measurement of high resolution mode and it was then that I should start receiving action.

    The port is always answer by errors when I write the start command or the FF one. I tried to establish a sequence stacked to write the three commands then read the port, I added some delay between the three of them, but it does not work.

    Now I made really simple and removed the stacked sequence and just put the three commands one after the other and try to remedy not to not on the code.

    I'm really stuck at this point, could someone help me please? I read a lot fo articles on the forum, but I can't solve this problem

    Thank you

    I have attached my VI and the SCP1000 documentation (I can provide other versions of my demo if necessary)

    The reason for your problem is a frequent misunderstanding even among experienced programmers. Take a look at this thread

    http://forums.NI.com/NI/board/message?board.ID=170&thread.ID=417750

    In your data sheet, then they return codes like 0xFF or 0x0A so has a single byte of average value. Then you in your-active code constant writing FF\n is so this equal to values in format hexadecimal 46460A and your instrument do not understand. But it will include FF0A. In order to solve your problem, you would type in \FF\n in your '-' chain helped codes. Remember too, if you type in \32 it will be converted to character 2 this being 0 x 32 50 decimals and code ASCII 50 is equal 2

    Take the time and change the display format of string between '-' display and Hex display and you will see the difference

    Hope this helps

  • Can not read the serial port VISA without MAX

    Hello

    I'm trying to build an application that will interface with a Black Cat Systems GM-10 radiation detector.

    The app works fine on my computer (with the full development system OR) but when I install it on another computer, without LabView, the application cannot see the serial port!

    I checked that the driver is installed correctl and Windows can see the device, but when I run my program, he can't seem to access the serial ports.

    I then tried to install MAX on the second computer, how the application worked well, but as I install this app in other places, I don't really have the ability to install MAX everywhere (software must be autonomous).

    Any help would be appreciated!

    Z

    I would have joined the project file, but the forums seem to not want to allow me to download that big of a file.

    What version of LabVIEW are you using? With 8.x, the installer is very able to install the runtime of NI-VISA and MAX. If you are using an older version of LabVIEW, there is an option to include the series VISA support. Install just MAX will do nothing to make the available ports. This is the VISA that does this.

  • VISA, unable to contact or see RS232 serial com port

    I have a Dell Optiplex GX260, who had recently for Windows XP (Service Pack 2) re-installed on it.  National Instruments VISA is unable to communicate with port com RS232 serial on the computer.  Control of "VISA Resource Name" in LabVIEW 8.5, or the "measurement and Automation Explorer" can see serial port.  Refreshing the list does not help.  "HyperTerminal" is able of see and communicate with instruments connected to the serial port.  In windows 'Device Manager, the serialport appear in the list of material without any warnings.

    Can someone please help with suggestions on how I may be able to get the VISA in LabVIEW 8.5 to see and communicate with the serial port?

    System details:

    Dell Optiplex GX260 (One RS232 serial port)

    Windows XP Edition Family Service Pack 2

    LabVIEW 8.5

    I had this happen to me once. In my case, I've updated to the latest version of VISA that corrects the problem.

Maybe you are looking for