Communicating USB using Labview VISA

I have a USB RAW device that I am trying to communicate with using labview VISA. I have had success with setting up the driver and I am able to get information from the device such as serial number, etc. When I try to use the VISA read and write commands, I have no success getting the information I want. The commands are simple: R SP<CR><LF> is a read set point command. The only thing I do get back for every command I try, is a 2 byte message "01 60"hex.
If you have any suggestions, I would appreciate it, thanks!
[email protected]

Hello Chris, I do not receive any errors and yes, I am including the termination characters in the string.
Here is what I get when I use a USB port monitor when I send out this string.
Thanks!!
[94] URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (SUCCESS/0x00000000) 20101119150318.131 (+0)
Pipe handle: 0x87696D6C
Transfer flags: 0x00000002 (USBD_SHORT_TRANSFER_OUT, USBD_SHORT_TRANSFER_OK)
Transfer buffer MDL: 0x88C47208
Transfer buffer length: 6
Bytes transferred
0x0000: 52 20 53 50 0D 0A (R SP.. )
[94] URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER (SUCCESS/0x00000000) 20101119150318.147 (+16)
IRP status: 0x00000000 (STATUS_SUCCESS)
Pipe handle: 0x87696D6C
Transfer flags: 0x00000002 (USBD_SHORT_TRANSFER_OUT, USBD_SHORT_TRANSFER_OK)
Transfer buffer MDL: 0x88C47208

Similar Messages

  • How to read and write data from Excel to TestStand without using LabVIEW VIs

    Hi,
    How can I read in columns of data from Excel into a TestStand array and write columns of data to Excel from TestStand without using LabVIEW VIs?
    I don't think the Property Loader custom step type in TestStand will work because the data I would like to read in from Excel is in a column that is thousands of rows long and the data has to be in the proper format to use the Property Loader to load in an array from Excel.
    Thanks for your help.

    That example does not use LabVIEW and it does about 40% of what you need to do by calling Excel through ActiveX. If you don't know how to use Excel through ActiveX then you'll need to brush up on that.
    http://www.microsoft.com/en-us/download/details.aspx?id=16250
    http://support.microsoft.com/kb/141759
    http://support.microsoft.com/kb/302084
    CTA, CLA, MTFBWY

  • USB with LABVIEW / VISA

    Hi all,
    I am a beginner in Labview. I had to develop a small prototype to read data from RS232. With VISA's functions and labview examples, everything worked fine.
    Now I would like to interface some USB devices by using similar VISA's components. In order to acquire skills in USB programming, I would like to build a simple program which for instance would get information on a simple USB device (as a USB KEY, or a USB mouse...).
    I already succesfully created specific visa drivers with the drivers wizard, installed them, see them with MAX.
    I studied the LV examples USBRawControl.VI and USBRawBulkMain.VI. But I do not succeed in getting any results. I guess I enter the wrong parameters in the example. Can anyone explain me a bit more how it works ? Or give me a set of parameters to test the LV example and get any results ?
    Thanks a lot.
    Jérémy

    No, there is no international standard in order to get/receive data from a USB device. That's exactly the problem. How the vendor implements a USB serial adapter could be completely different than implementing a USB storage device.
    You would need to ask the vendor about the data transfer mechanism - i.e. bulk or control pipe. Bulk is probably the simplest since you can just use a VISA Write or VISA Read so you would need a list of the commands to send and how the received data is formatted. This is what I used and since we wrote the firmware for the USB device, it was fairly simple. Look at the shipping example called USB - RAW Control to see how much information you need to read/write with this mechanism. If you got this to work, you would still need information on how to translate the control buffer data. I've never had to formally request this but you misght want to search the forum for posts regarding USB RAW to see if you can find more information.
    If you are getting a commercial sensor, then it is very likely that they have a dll available that can be integrated into multiple programming environments. In most cases, this is a much better solution than trying to develop your own VISA driver.

  • Logging data in a file using Labview VIs vs. Mathscript functions.

    Hello,
     I'm working on a data logger at 200 Hz frequency. I wanted to log the data to a file after eace sample received. When I used (fopen,fprintf,....) on Mathscript, the Labview started to log the data at a slower rate. I then used the Labview file VIs and it is working fine up till now.
    My questions are as follows:
    1- Are the file functions in the Mathscript slower than the Labview VIs ?
    2- Is saving the data to a file after each sample is received a good idea or is there a better idea ? I just don't want to keep the data in the memory and after all the data is logged, I flush them to a file ... because, it seems that the PC will run out of memory.
    Thank you,
     Walid

    wfarid wrote:
    Hello,
     I'm working on a data logger at 200 Hz frequency. I wanted to log the data to a file after eace sample received. When I used (fopen,fprintf,....) on Mathscript, the Labview started to log the data at a slower rate. I then used the Labview file VIs and it is working fine up till now.
    My questions are as follows:
    1- Are the file functions in the Mathscript slower than the Labview VIs ?
    Yes. That's because you're going through another layer of software. Why were you trying to use MathScript to log data to file in the first place? Are you a Matlab "aficionado"? 
    2- Is saving the data to a file after each sample is received a good idea or is there a better idea ? I just don't want to keep the data in the memory and after all the data is logged, I flush them to a file ... because, it seems that the PC will run out of memory.
    It doesn't make sense to save data after each sample. File I/O is an expensive operation in terms of time, and you have the operating system to deal with, so while you may be able to keep up the rate for some time, eventually it will be thrown off. You can do as suggested which is to wait until you have a certain amount and then write that to file, or you can set up a producer-consumer or master-slave architecture. Let one process/loop collect the data and put into a buffer, like a queue, and the other process/loop can stream it to disk at a more reasonable rate. You just have to make sure the buffer is large enough so that if the file I/O gets hung up you won't reach the buffer's limit.

  • Using Labview VIs without runtime

    Hi all,
    here we have a quite heavy Labview 2012 application. It consists of several dozens of VIs. One of them is a firmware updater for devices we produce.
    The task is to create a standalone firmware updater which shouldn't rely on an installed Labview runtime. So our idea was to create a DLL from this VI which provides the corresponding functions. Then these DLL functions may be called from another application.
    The problem is that the produced DLLs rely on an installed Labview runtime. Is there any other way to access VIs (or Labview functions in general) without a dependency on the runtime? I mean besides using Cameyo.

    ABachmann wrote:
    The problem is that it isn't possible to download a 200+ MB runtime everywhere around the world. If a farmer in the Australian bush only has a 19k modem connection, it is hardly a solution to have him download the hundreds of MB for the runtime for a small updater which is only some hundred KB of size. This is a real world scenario, we had this.
    So we had the idea to create a DLL of some VIs and put around some glue code. This would be the fastest solution. But without a way to do this, we have to reimplement these VIs in another language. It is like reinventing the wheel.
    I understand your problems but other languages will require specific libraries to exist on the system in order to run. They will be no different in that regard. They may benefit from using the libraries that are included with the OS installation but they are still using those items and if not there, such as the DotNET example listed above they will need to be downloaded as well. NI has made some improvements in LV 2011 that can trim back some of the RTE elements that get installed. As suggested though you can always create two installers. The RTE does not need to be included once they are already on the system.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • FTDI With FPGA using labVIEW

    Hi,
        I am have got FT245 RL and i need to get the data tranmitted from an FPGA.The data is going to be an 8 bit data.I am doing the conversion using FPGA itself.I now want to read the data from the FPGA.I am new to FTDI and i am struck.Can some one please help me out?Aslo please tell me as to which 2 pins should i short to check the loopback .
    HELP!!!
    Message Edited by muks on 03-10-2008 08:08 AM

    hi,
    I have a little problem, maybe someone can help me.
    I want to communicate between FPGA and USB using Labview 8.2.
    I'm using ALTERA Cyclone II FPGA and
    FT245BL USB from FTDI and I tried to test the write-read routine
    (labview example) from FTDI website (see the link below):
    http://www.ftdichip.com/Projects/CodeExamples/LabVIEW.htm
    The
    write function is working (the bytes are written in the paralel
    port).The function FT_GetQueueStatus returns a parameter Bytes Waiting
    which is zero, so this means there are no bytes to read from FTDI
    device.My question is:
    Is there any protocol already implemented in Labiew and a website from
    where I can download it to do the communication between FPGA and USB?
    I have the VHDL code downloaded from ALTERA website and I installed all the
    required drivers related to my FTDI device model. The drivers were downloaded from
    the www.ftdichip.com
    website and also the D2XX _functions_7.0 for Labview.
    Regards,
    Leo

  • Using Labview VI as a Matlab function.

    Hi,
    I'm trying to use Labview VIs in a Matlab script. The VI should act as a function with input and output arguments. Tried to compile the VI to a .DLL file, however was unable to read the file using Matlab.
    Any advise?

    What errors did you get? Can you access the DLL from some other application that uses DLLs (i.e. Excel)? Try creating a very simple DLL that just adds two numbers together, does that work?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do I create Labview VISA ports for *individual* GPIB instruments using Prologix USB GPIB controller?

    Hello,
    I'm trying to use a Prologix USB GPIB controller to control GPIB
    instruments, and I would like to have a virtual serial (VISA) port for
    *each instrument*, as is the case with a normal GPIB controller with a
    standard NI driver. However this is not what the Prologix driver
    provides -- it provides a single VISA virtual serial port for the
    entire controller. To address the instrument with GPIB address 11,
    you first send "++addr 11" to the serial port, and then you're talking
    to instrument 11. However, this means I have to change all old
    Labview programs.
    Is it possible to create a "wrapper" function of some kind that will
    define a virtual serial (VISA) port for each *instrument* on the
    controller? For example, to talk to GPIB instrument 11, call it
    ASRL3::11::INSTR, each time it is written to it would have to write to
    the virtual serial port of the controller, say ASRL3::INSTR, first "+
    +addr 11" and then the command that is sent to it.
    A clearer explanation of the difference (i.e. incompatibility), and of
    my objective:
    1) A normal GPIB controller with NI driver: I go to the NI
    Measurement & Instrumentation Panel, under GPIB, and Scan for
    Instruments; all the live instruments show up; subsequently when I
    want to use Labview programs that use VISA ports, the VISA drop boxes
    allow me to choose a different port for each instrument, e.g.
    "GPIB0::11::INSTR", "GPIB0::12::INSTR" would be instruments at
    addresses GPIB 11 and GPIB 12.
    2) The Prologix GPIB controller that plugs into a USB port: In
    Labview you get a *single* VISA virtual serial port, ASRL3::INSTR, for
    the entire GPIB0 controller. Therefore to address GPIB instrument 11,
    you write "++addr 11" to the virtual serial port ASRL3::INSTR, and
    then you are communicating with device 11, so you can write and read
    ASRL3::INSTR to talk to that device. Then to talk to device GPIB 12,
    you write "++addr 12" to the same VISA port, and then you are talking
    to that device. The problem is that this requires recoding all
    Labview code, whereas I would like to be able to use the same program
    either with a normal or with a Prologix GPIB controller. Therefore, I
    would like to create code that scans the controller for all GPIB
    attached devices and creates VISA ports for all. Such ports, when
    written to, would have to first write "++addr DEVICENUM" to
    ASRL3::INSTR (i.e. the port of the GPIB-USB controller) where
    DEVICENUM is the GPIB address of the instrument corresponding to that
    port, and then would have to do a write or read or whatever function
    is being done on that instrument VISA port.
    I haven't figured out if it is possible to do this easily. Help and
    pointers on where to look for hints would be much appreciated. Many
    thanks!
    Milos

    My first impression is that if you don't want to make any changes at all to existing programs is that the wrapper you need is one around VISA. You would need to intercept all of the calls into the NI VISA driver. If you create your own visa32.dll and in there, change the addressing and then call the real VISA driver, you might (repeat, might) get something to work. If this would even work, you still might find that you have to make significant changes anyway. The serial connection is going to be considerably slower, and interface specific functions such as service request handling, bus triggering of multiple instruments, etc., would be difficult to impossible. This would be a lot of work, imho, to just save a couple of hundred dollars over a real GPIB controller. I've seen this Prologix device before and have even used NI's RS-232->GPIB controller. The Prologix intended use to me seems to me more for a hobbyist or very casual user. Of course, I'm used to having multiple GPIB instruments worth 10s/100s of thousands of dollars and the cost of an fully compliant GPIB controller is just lost in the noise.

  • How do I browse & play .mp3 files from a USB flash drive using Labview 8.0?

    I'm a tester & want to test USB flash drives connected to PC.
    I want to browse the file system & playback the audio files, .jpeg files etc in the USB drive. I've Labview 8.0. When I searched for some examples or VIs which can detect the USB flash drive, couldn't find any. So if you could point me in the right direction, I can find a solution to my problem.
    Thanks.
    Solved!
    Go to Solution.

    You probably won't find specific examples for this.  A USB flash drive is mounted by the OS and appears as a new memory storage device to all software on the PC, including LabVIEW.  You can certainly write a LabVIEW program to open files on the stick and play/run them but I would create a VI that wrote files to the stick and then read them back and checked them for bit-level errors.  Keep in mind that your OS might be doing parity checking under the hood which would make your test rather meaningless.
    BTW, testing memory by looking at pics or listening to MP3s would be useless of course.  A human can't see or hear bit-level errors in a high bandwidth data stream.
    Using LabVIEW: 7.1.1, 8.5.1 & 2013

  • Error in ni visa control out for usb in labview 2009

    Hi,
    I am using labview 2009 in which i have made a vi which communicates with a pic controller through USB interface.
    the vi is working fine in labview 8.6. I tried it in two PCs. but when i run that vi in a PC with labview 2009 then the VISA CONTROL OUT.vi gives error "0xBFFF003E : Could not perform operation because of i o error.". while the control in.vi works fine in both the labview versions and any other PC that i tried.
    I have run the application in total of 4 PCs with same set of cards/interfaces. two of them having labview 8.6 are running fine and giving no error but other two with labview 2009 are giving error.
    and it doesn't stop here.... i searched in the vi and did some experiment and found that when i give Request value input to control out.vi as "0x36 "(as required by my PIC program) then it is giving error but when i give other value such as " 0x35 or 34 or 55"(used for other purpose) then it is not giving error.
    Can it be a PIC programming problem? (i dont think so as everything is fine in other PC with LV 8.6)
    I have already explored the ni forum for this error solution but could not find helpful.
    Can anyone solve my problem?

    I installed labview 8.6 in that machine and made a small program with only 3 vis (visa open session, visa close session and visa usb control out.vi) which is working in LV 8.6 platform.
    Sorry the above statement is not correct actually.
    When i run the program in LV 8.6 it giving that same error but this time it is not displayed as pop up window. so i could not judge that error was still there.

  • Which is better for usb camera between VISA and imaqdx in labview 2010?

    i have done a program for usb camera to acquire images with imaqdx.
    now i want to know which is better between VISA and  imaqdx in labview 2010?
    i didn't study visa before
    thans for help.

    VISA is primarily used to communicate with instruments via GPIB/TCP-IP/Serial/USB. In order to use easily VISA with an instrument over USB the instrument must adhere to the USBTMC spec. A camera is not likely to have this. Otherwise you have to use USB RAW, and that requires detailed knowledge of the data that is transmitted by the instrument. Manufacturers rarely give this information out. Normally they will provide a DLL to communicate with the instrument.
    Thus, in your case, VISA is not going to be an appropriate API to use for a USB camera.
    Out of curiosity, what prompted this question?

  • Problems with Serial Communication using Labview 6 and Solaris 8

    I am working on a Driver for a Temperature Controller. But I am stuck at the very basics. I am using Labview 6 and the platform is Solaris 8 on a SUN Ultra 60 Workstation. I can not get the Serial communication to work. When I am running raw (uncompiled) code it works (I can read from and write to ttya and ttyb) but once compiled I get error code 37 (device not found). I have tried the following steps to fix this with no luck.
    1) I made sure that the "serpdrv" file is in the same folder with the executable. I also make sure the serpdrv file is added as a support file when building the app.
    2) I changed from using traditional serial VI's to labview 6's new visa functions. With these "new" VI's when
    I try to initiliaze the visa device and wire a control to the "visa reference" input only 1 serial port shows up (ASRL2, missing ASRL1). I am not sure if this is part of same problem or whole new issue.
    3) I reinstalled both visa and labview 6.0.2 update hoping this would help with no luck
    4) I placed the following entry into the ".labviewrc" file
    labview.serialdevices: "/dev/ttya:/dev/ttyb"
    If anybody has had the same problem I would love to hear about it and if you have any solutions
    Jamie Shea

    Hi Jamie,
    1. Do you have NI-VISA driver installed on the machine on which you are running this executable?? If you are trying to run the executable on the same machine on which the development program has ran fine, then you can ignore this point.
    2. If you have done all the changes that are suggested by other discussions related to this topic, then try changing the Port input to Visa Serial Configure.Vi from a control to a constant and try it. In some case, I have seen this to do the trick. I think this point should solve your problem. If it does do tell me. :-))

  • I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication

    I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication.
    I use LabVIEW to read the data from serial communication then, i open the example (.vi) from Serial Communication - Advanced Serial Write and Read  from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured  at property node in visa configure serial port (instr).vi -> advance serial write and read .vi
    this error code is undefined. no one has provide a description for this code, or you might have wired a number that is not an error code to the error code input.
    I don't know why? please help me. thank you.

    When I copy that code into "Explain Error" I get: "VISA:  (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded."
    You may have a bad install of VISA or the wrong version of VISA loaded. Try re-installing VISA. You can get the latest version from the NI support site: http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
    Also ensure that you are not pointing the example towards a serial port that does not exist.
    Please let us know what you find and what gets this working for you.
         Rob

  • Mandriva 2009: trying to use a raw USB device through VISA

    Hi,
    I'm a real beginner at Unix, so please be patient :-)
    I have just installed Mandriva 2009 and LabVIEW 2009 on my laptop. My objective is to drive a USB raw device.
    I went through some difficulties to install NI-VISA 4.5 and solved them by browsing in the forum. Some issues remain:
     - As I am not familiar with Unix, I am not sure to understand what "usbfs should be mounted with devmode=0666". Could someone tell me the rigth command line to enter?
     - When running AddUsbRawPermissions.sh, I am told that /etc/hotplug cannot be found. Reading the script, I saw that it is looking for /sbin/udevcontrol. I don't have it, I only have under /sbin the "udevadm" and "udevd" executables.
     - When running the VISA driver wizard, I only have access to PXI/PCI. Maybe it is related to former points.
     - When trying to launch the VISA Interactive Control, I get a nice bouncing cursor animation, but nothing else.
     - When trying to use the "VISA Find Resource" VI, Labview just crashes.
    Thank you in advance for your answers.
    Achille
    Message Edité par Achille Taylor le 08-11-2009 11:01 AM

    Hello,
    First command line generated an error (translation from French: mount: you must specify the file system type). Second command line seemed to work. At least it didn't cause an error. Therefore I went ahead and tried the AddUsbRawPermissions.sh script, leading to the same error: -Cannot find "/etc/hotplug".-
    Besides, VISA Driver Wizard and VISA Interactive Control still behave the same way.
    Regards,
    Achille

  • Anybody knows how to verify USB link operation using Labview

    I am trying to verify the operation of a USB link on a system I am testing. Does Labview have USB drivers that provide data communication.

    hamid00 wrote:
    >
    > I am trying to verify the operation of a USB link on a system I am
    > testing. Does Labview have USB drivers that provide data
    > communication.
    No.
    Using LabVIEW, the best way might be to verify the operation of a device
    on the other end of the link ...
    Best, Mark

Maybe you are looking for

  • How can I slim down the aperture library?

    Hi, My aperture library grew a lot. Is there any way to slimmed it down, without erasing content? I am talking about recreating previews with less quality or smaller size, deleting old thumbnails (I read that even if you delete a picture from the lib

  • Set filers in header of gridview

    hi all, In visual web part i used asp grid view to display master list after binding i want to set filters in the header of grid view and also fixed header and scroll bar for rows only  how to do this if any one knows please guide me Thanking you, Ar

  • Field as page item

    Hi All I have a report and i want to know if i can have a specific field both as page item and in the report, if so how do i do that. Thanks

  • ABAP proxy - XI - IDOC

    Hi, I built a new interface: ECC ABAP proxy - XI - CRM IDOC and tested it in DEV systems(ECC, XI, CRM) - it works well. I transport it to QA systems(ECC, XI, CRM). Everything  seems OK, but when I do Proxy test from ECC QA system, I don't see message

  • After i download my apps where do i find them??

    i am so confused please help!!