Visa reading reads all bytes to the port

I have a camera that I communicate via the Serial Port. I have a standard communications protocol. For a particular command, I know that the exact number of bytes expected in return. I send my order. I see the correct number and exepcted to bytes in the port. I then read the number of bytes in the port. However, the VISA read returns only the first two bytes.

I contacted success with this camera and this Protocol for more than 130 commands unique and different. There are only about 6 orders in which the read visa does not read all the bytes in the port. Anyone know why that would happen?  I expect to see 6 bytes. I see 6 bytes. I have visa read the command with 6 bytes. The visa read returns only the first 2 bytes. It's very very frustrating. I can do this exact process even with a different command. I expect 45 bytes of this command. I see 45 bytes with this command and I read 45 bytes with this command.

I don't think that it is device connected as I can converse with success with the same camera on the same computer with the same cable of connector using non-LabView. It seems to be a problem strictly related to labview and VISA read the order. If someone could help that would be greatly apprecicated.

Thank you.

What is the exact byte stream that await you in return with this command?

Instead of opening VISA, use the configuration Serial Port VI.  In this way, you can override the default values.  It looks that your instrument using all the defaults VISA of speed in baud rate, start and stop bits, etc.  However, in the VISA software, there is a failure to use a termination character, and this character is 10 (0x0A).  If you use the configure Serial Port, you can tell the pilot VISA do not use the stop character.

Tags: NI Hardware

Similar Questions

  • Visa read byte at the port

    My visa to read, I feed in the bytes in the property node port as input for the number of bytes to read (it's 4 bytes).  However, the output of the read visa give only 2 bytes.  It seems that a few bytes have been lost during the read operation?  Why is this?  It is an easy to see what is in the buffer of the serial port?  Thank you!

    Yik

    You likely the session VISA set to end readings when he sees a stop character and VISA reading is to see the stop character, and ending the reading, regardless of the number of bytes you told to read. If you want that it explicitly read that much then you must disable the option "Activate the stop character" in VISA set up a Serial Port.

  • VISA read lose characters beyond the end of the output string

    Hello

    I wrote a VI to take a string of output data of an ardunio Uno and analysand. I use the vi read Visa to enter the output channel of the unit. In the end I will connect a device that actually gives the value in this type of format string: (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0 *).

    So after a large number of loops, the program starts to drop the last characters of the string that it generates. If the string of Visa Read output reads something like (#80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,). The only way to solve this problem, once it has occurred must completely close labview (completely). Once I open again and start the program running, all is well in the world.

    Has anyone had this problem? I tried to debug it in different ways and the only weird symptom I have other Visa Read function lose a few characters of the string is the fact that by looking at the bytes to the Port after I read visa, is that she starts showing five bytes instead of zero.

    my last attempt at resolving this issue is attached.

    Note: The Ardunio outputs a string of this format every 2 seconds with the values being incrimental on a specified range. (80212164,2289,2292,2296,2300,2328,2289,2297,2290,2300,2308,2292,2295,2298,2289,22,24,0 # *)

    You can configure the * your character of termination if your Arduino does not send the carriage return or line feed.  Use the configure a Serial Port to ensure that your settings are correct.  You can also use this VI to increase your timeout so that you no longer need your waiting.

  • Serial bus - bytes to the Port returns with the disabled character of endpoint 0

    I'm new to labview...

    I am trying to connect PC to a hardware device that is customized with a UART (9600 baud, 8 bits, no parity, 1 stop bit, flowcontrol HW). The device works as follows: when a data packet)<256 bytes)="" is="" sent="" to="" it="" via="" serial="" port,="" each="" byte="" is="" echoed="" by="" the="" uart.="" after="" the="" packet="" is="" completely="" received="" the="" device="" verifies that="" the="" packet="" is="" correcly="" received,="" and="" after="" a="" delay="" (~="" 200="" msec="" or="" more),="" sends="" 2="" bytes to="" the="" host indicating="" whether="" the="" packet="" was="" ok="" or="" not.="" this="" works="" perfectly="" when="" i="" use="" hyperterminal="" to="" communicate="" with="" the="">

    I designed a simple vi to manage it. As each byte is sent, I use the "Byte to Port" property and read the byte of the echo. The problem is after all bytes are sent, I get 0 instead of 2 for the 2 bytes that I'm supposed to get. I tried to do it with the read-write property-reading vi in order, but it does not work. As you can see in the attached vi, I therefore separated this in 2 cases;

    (Real deal) during the time the package is sent and (false case) where I just (trying) to read the 2 bytes. I get 0 bytes to the port and the VISA Read vi gives me a timeout error! .... Increase the time to 1000 ms did not help either.

    Can someone take a look at the vi and suggest what is wrong and what can be done?

    It will be much appreciated.

    Franck Tulpule

    Franck,

    I agree with crossrulz.  You must set the time-out period based on the behavior of the device.

    Consider reading 1 byte at a time - all the time - and comparing the result with what you sent.  From the echoes of the unit it receives, you can use this to check communication. Once all bytes sent found an echo, then start the search for "Y" follow-up by "." follow-up by "?" to see if you get the acknowledgement of receipt. With the timeout VISA has some value based on how long you want the program to be unresponsive to user input or any other activity, you can manage the knids of crossrulz errors mentioned.

    Lynn

  • Request from oracle to MySql using dblink read all rows in the table

    Hello
    I use the heterogeneous connectivity between oracle 10204 to the Mysql database.
    I have a database of link on the side of the oracle.
    I request a table in MySql with 10 million rows.

    His is not serious if I am running:
    ' Select * from ' CDR_Accounts"@mysql where 'id '= 7675405;
    or
    Select * from 'CDR_Accounts"@mysql;

    There is an index on the column id.
    It seems that the Mysql is feteching all rows in the table, all data is transferred to oracle on the dblink and only after the required lines are back to the client.

    The /etc/odbcinst.ini file is as follows:
    [odbcprd:oracle@odbc /software/oracle]$ cat /etc/odbcinst.ini
    [myodbc3]
    Description             = Mysql connector to mysql version 3.5
    Driver          = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3-3.51.25.so
    Driver64                = /usr/lib
    Setup           = /software/oracle/MysqlOdbc/3.52/lib/libmyodbc3S-3.51.25.so
    Setup64         = /usr/lib
    UsageCount              = 1
    CPTimeout               = 3600
    CPReuse         = 
    Please advice

    Thank you

    Initialization of gateway open tha file located in $ORACLE_HOME/hs/admin called init .ora and change HS_FDS_TRACE_LEVEL to HS_FDS_TRACE_LEVEL =WE.

    ATTENTION:
    Do not forget t turn off after all your tests.

  • Bytes to the port for Telnet sessions

    It is my first foray in communication with a Telnet Server.

    I put my old code to level to navigate the structure of menu on our previous devices that use a serial port now communicate by Ethernet using Telnet.

    Because the read VISA you should know how many bites to read my old code is highly dependent on 'bites at the port' vi.

    Is there a similar way to do this for a Telnet connection?

    Now I have to count the bytes and put it in a test outside, play with the values until I find something that works.

    The problem is that I don't know exactly how many bytes will be returned after entering a command because the unit will "inject" error messages and system of right on the telnet port.

    Telnet is mainly a line oriented protocol. So, basically, it should be enough to activate the mode of termination in VISA and simply start reading data with a fairly large number for the bytes to be read for you ensure that you always get at least one line. VISA will automatically terminate all read when he meets the stop character in the stream.

  • Windows media player cannot read all items in the playlist

    It says Windows media player cannot play all the items in the playlist. This happens from time to time. Something is interfering with the player? I don't know what to do when this happens. I hope that it is a minor and simple solution.

    Can anyone help?

    Original title: Windows media player Version 12:

    Hello

    1. What is the full/exact error message?

    2. When you receive this error message?

    If your computer has problems to access your collection of digital media files in the Windows Media Player library, try to use the of the Windows Media Player library Troubleshooter to fix the problem. The troubleshooter makes sure that Windows Media Player is installed correctly on your computer and checks if the Player library is corrupted.

    I suggest the steps and check if that helps.

    Method 1
    I suggest you to perform the following troubleshooters.
    Open the troubleshooter in the Windows Media Player library

    http://Windows.Microsoft.com/en-in/Windows7/open-the-Windows-Media-Player-library-Troubleshooter

    You can try to use the troubleshooting Windows Media Player settings Troubleshooter to automatically find and fix some common problems. See the link below.

    http://Windows.Microsoft.com/en-us/Windows7/open-the-Windows-Media-Player-settings-Troubleshooter

     

    Method 2

    If the problem is not resolved I would suggest you follow these steps and check if it helps.

    Step 1:
    Disable and enable Windows Media Player and check if it opens.

    a. click Start and select Control Panel.
    b. click on programs and features.
    c. click on or turn off Windows features turn on on the left side.
    d. develop media features; clear the check box Windows Media Player.
    e. click Yes and OK to continue.
    f. restart the computer.

    Note: If windows media player 12 is already disabled, follow the steps mentioned below:
    After the restart, follow these steps:

    g. click on start and select Control Panel.
    h. click programs and features.
    i. click on Turn Windows features on the left side on or off.
    j. develop media features; Check the Windows Media Player.
    k. click Yes and OK to continue.
    a. restart the computer.

    This would be re - install windows media player.

    Reference:
    Turn on or off Windows features
    http://Windows.Microsoft.com/en-us/Windows7/turn-Windows-features-on-or-off

    It will be useful.

  • No VISA Read reading all the bytes available and ordered

    Hi all

    I use Write.vi VISA and VISA Read.vi to send and receive packets of bytes to and from a processor.  Generally, everything works fine.  I put a loop repeats until he sees at least 20 bytes to the port, then I VISA Read to read 20 bytes.   However, when I receive some packets of bytes, my property node indicates 20 bytes to the port, I ask VISA Read to read 20 bytes, but it reads 13 bytes and leaves seven bytes to the port.  If I run the read operation again, it will read their remaining 13 bytes.

    Any ideas on what might materialize this project?

    Thank you

    Forbes

    OK, I thought about it.  I put 'Stop character activate' in 'VISA configure Serial Port' to 'False', and all my problems disappeared.

    It's fun to talk to myself.

    See you soon,.

    Forbes

  • The VISA read function is not read the bytes specified in the buffer zone

    I created a program that continuously acquire data of the inverter. But, the "Reading of VISA" function is not rreading all bytes of the buffer, which is a big problem because the way my work programme is it will extract the specific buffer bytes and convert these values in voltage and current values.

    I specified the number of bytes that I want to read the buffer as for example I want to read 21 bytes. But, even if there are 21 bytes in the buffer, the read function VISA read only 9 bytes. Im not using any character of endpoints so this is weird. I'm using LabVIEW 2011.

    Is attached a photo of my program and the results.

    You still have the active stop character.  You must connect up to a FAKE at the entrance of termination character activate on the Serial Port to set it up.

  • Visa read doesnot see the output of the read buffer

    Hello

    I can make a stupid mistake, but my read buffer doesnot show any output in the indicator, it shows only 1. I enclose the alongwith VI. Please help me here, because I'm really stuck. Thanks in advance.

    Guyz thanks for your answers, they are very useful. I removed the bytes to the port and a number of bytes to 8 in the read VISA seems to give me the result. I must confess that I had to change the chain of command of writing too, as it was incorrect. It isn't FPOP but spreading. Now I can read the data. Guyz thanks once again.

  • The value read by visa read that VI is not correct!

    I design a labview program to control the Agilent E5072C Network Analyzer. When I want to get the value of this instrument, I use VI "VISA read" listed in the plate. However, the value read from this VI's latest measurement of time value. For example, the last time that the read value is 1.0 db, and this time the measurement value is 1.2 db. But when I use 'VISA read' VI to extract the value is 1.0 db.

    Agilent also provide a VI for this device to read the measurement value and she was always correct value. If someone could tell me why? need to do any action before the value read from this instrument if I want to use VI "VISA reading" instead of Agilent VI?

    You are probably reading too quickly.  Reading it in NOR-MAX, you do it by hand, it takes more time.  When you do that programmatically, it is "instant".  Try using the * OPC? command to activate your order in a query.  He returned then a '1' in the buffer.  Read the '1' and then create the command fetch.

    For Dennis:

    I've had bad experiences with the drivers provided by the manufacturer to the point where I don't even try to use more.  But Agilent is also anal about their drivers, because they are on their books, they should pose no problems.

  • VISA read returns still a Virgin

    Please see the code attached screenshot. Its a VISA session trying to communicate with a BOX to BlueTooth converter. In the box marked red, I don't read any data at all. This despite the fact the property node "Bytes to the Port" read a value of 27! So where the bytes are? And isn't that all readings are like that. -in the previous state, I have a question for the Version not as "V"."for which read VISA's 'CANgine BT Version xxxx'. I don't know why its t read the only statements always white. ?? I tried the while loop with delays of 10 to 200 ms and nothing wrong with the orders - they work as intended on the Hyper Terminal.  And even in this code, I am able to read the number of bytes that 27. So whay aren't? LV2012 has a new data type: INVISIBLE?


  • VISA read very slow communication

    Hello

    IM using serial communications VISA in my project and I noticed that the reading block works very slowly.
    I have the microcontroller that connected to my laptop through XBee modules.
    Baud rate is 9600 due as a change factor in each component in the line won't make a difference at all.
    Also, I checked that it work with terminal XCTU and its working fine (very fast). so his can not be something else except read VISA.
    Please see VI attached file.

    Thanks for any help,

    If you do not use a stop character, then the read VISA will sit and wait that 100 characters have been received by the COM port or the timeout elapsed (which is probably something like 5-10 seconds long). You can change the time-out period (using a property node) or reduce the number of characters you read each time that the loop runs.

    Without a termination character, you will need to build your own string using a shift register buffer - whenever you make a VISA read, add it to the chain on the shift register and then do some analysis to take control of your microcontroller (e.g. alarm, coordinated) and remove all the foregoing orders of the string buffer (for example if you have started the VI in the middle of a command) ", then you don't want to throw these data).

  • increase speed visa read write

    Hi guys,.

    I use the visa read and write the example, but I am facing a problem when using it in a software expansion, and I can receive only date when the vi has been slown down (using the bulb).

    The program really works on her own with the defined settings.

    So, do you have any ideas/suggestions on how to significantly increase the speed of this vi (joint)? In addition, it seems to create a problem with the playback of data

    Thank you very much

    Kentmey

    Roll bytes to the port and the delay.

    Rely on the chariot of the termination

    Use a number larger than the bytes expected.

  • Visa read stops execution

    Hi all

    I have a little problem with the control of my power supply E3631A Agilent via Labview:

    I downlaoded all drivers and with the help of you guys I even persuaded that it is running properly.

    At least that's what I thought.

    Turns out he didn't really. At some point the VI just stops.

    Using the execution mode of nail I knew where the problem was:

    The VISA read error query of the configure output has stopped working.

    I have no explanation for it. I get unpredictable and I have not yet managed to influence by changing the different settings.

    (And I tried it for a while now..)

    I built a very simple example VI to show you where the problem lies.

    Explanation:

    I'm basically feeding the output a voltage variable and at the same time measuring how long the vi fonctionnee already has...

    I thank you very much in advance,

    keksbold

    OK it looks like as the time to copy this section of the FAQ: (posted in a place not yet public ~ ~ ~ Hey Jordan? is still FAQ on the right way?)

    "

    In this topic, we will discuss some of the common problems that have been observed using devices with LabVIEW on Windows operating systems.  Many of these points apply also in other environments, but the examples will use the Windows 7 operating system.

    FAQ 1: USB device stops working unexpectedly.

    The first thing to look at is the OS power save options.  There is a global trend towards "Green" electronic development and energy the coast to stars become fairly common.  "If his is used not to turn it off" is not new.  Cave men learned how to Bank a fire in order to preserve the energy that would otherwise be wasted.  Similarly, the Windows operating system has an energy saving function to stop power to the USB hubs when no user activity is present.  In automated systems, this feature can cause problems since remove power USB hub will stop the USB device.   Solution: use Device Manager to change the Power Options USB hub.

    FAQ2: I put the power options and my device connection is still not reliable: Don't forget, the USB ports on the computer are often the least expensive that can be mounted on the chassis and system share the PC power supply USB-powered. Most of the uses of USB are temporary connections such as a USB key or a camera.  These connections don't require high reliability because there the user interacts with it.  Mounted sudden power and fault tolerance at worst cause the operator to retry the transfer of data.  Automated systems require a bit more robustness.  Solutions:

    1) ALWAYS use a free external powered hub. Perform your due diligence genius and to inspect devices specifications too - if you do not find them for this device which should clue pick you a product from a vendor who published their specifications.

    2) high noise environments require the use of ferrites on the USB cable- and do not buy the cheapest cable either! The good markets are poorly protected.

    3) PROTECT connections HUB-if you have a USB 2.0 device and Joe User plugs in a 1.0 device into an open slot, managed by the same hub-Bingo all ports on the rear hub can convert USB1.0.  WORSE, there are a lot of damaged or marginally engineered USB devices out there.  Joe User should cause power fluctuations when it is inserted or removed from the hub just don't let it happen!

    FAQ3: I test USB devices and the operating system can not find more.

    It is a Plug-and-Play feature that deserves exposure.  When you connect a device P - n - P BONE remembers his serial number in an entry in HKEY registry (hive-Key).  This is useful when (for example), you want a specific instrument, say a NOR-USB-6008, to appear as a device DAQmx with VISA Alias "MyDAQ1" whenever it is plugged.  On the other hand, if you want to test a range of USB-serial converters that can be problematic because the pilot of P-n-P will mount the first serial number like "COM3" and the other as "COM4" Add infinitum until the controller of the enumerator in the registry and the VISA recognized alias adjust upward.  Solution: use the Windows registry API and the API of hardware in LabVIEW to clear unused VISA alias and HKEY entered.   Speak with your professional COMPUTING staff structure HKEY and possible side effects before developing a plan to modify registry entries.

Maybe you are looking for