07-02-2012 12:39 PM
Hi everyone,
First off, I don't have a strong knowledge of USB RAW or VISA, so I apologize if any of the wording/questions do not make sense/aren't written the way they should be. I am trying to modify a program to work with a USB RAW device (laser) that I have connected. I have already created a driver for my device which shows up in MAX, and I have used VISA to do this, and have changed the VISA class in my program to USB-RAW already.
I have a few questions regarding how to read/write data using this device.
1) How do I know what type of transfers I need to use (bulk or control)? I believe based on my research I will be using bulk.
2) Assuming bulk transfers, can I just use VISA Read and VISA write the way I have in the screen shot entitled "VISA Write Program"?
3) In this screenshot of "VISA Write Program" what would I use as the byte number? (currently set at 1). And do I need to use the property node to specify where the data is coming from?
I am currently receiving an error from the "VISA Write Program" subVI, which is why I chose it to include in this question. The error number is 1073807339".
I have also attached screen shots of my RAW device showing up in MAX, as well as the attributes (I don't know if this will be helpful enough, please let me know if more information is needed to help me).
Thank you.
csot88
07-02-2012 01:14 PM
07-02-2012 01:25 PM
The manual tells me that the laser is designed to communicate via a standard USB interface, and that if I install the application it will install the "right" USB drivers.
Attached is the USB driver they provided and the sample program.
The reason I chose to use USB RAW is that the program I am modifying (which we used with the older version of laser which is connected by GPIB) already had coded in a VISA option. I thought it would be easiest just to modify this code.
07-02-2012 01:26 PM
Assuming that it is bulk transfer and I knew the correct numbers, what is the format for the code to set up a VISA Write and VISA Read?
Thanks.
07-02-2012 02:23 PM
07-02-2012 03:16 PM
For the purposes of learning how to write and read with the VISA RAW class, I thought that would be the simplest question by making that assumption for now.
They did use USBTMC.
This is why I am trying to just modify their code to use with the USB RAW class, from what I understand (which could be totally wrong which is why I am asking this question) it might not be that much different because you can use VISA functions.
I already mentioned I am not an experienced user, trying to become more knowledgeable through these forums and tutorials, but it is still relatively new territory for me.
07-02-2012 03:31 PM
07-03-2012 12:38 AM
@csot88 wrote:
For the purposes of learning how to write and read with the VISA RAW class, I thought that would be the simplest question by making that assumption for now.
They did use USBTMC.
This is why I am trying to just modify their code to use with the USB RAW class, from what I understand (which could be totally wrong which is why I am asking this question) it might not be that much different because you can use VISA functions.
I already mentioned I am not an experienced user, trying to become more knowledgeable through these forums and tutorials, but it is still relatively new territory for me.
Well. USB Raw communication is definitely not something to start to improve your non existing knowledge. In terms of communicating with devices it is similar to programming your software in assembly instead of LabVIEW. You do need an exact protocol description. Since you claim it do be USBTMC you could download that specification and read it except that specifications are usually very hard to read and understand even if you know the details already.
Looking at your VI (that didn't contain the actual driver VIs at all) I do doubt your claim about the device being USBTMC however. If that would be the case there would be no need to use a .Net component to enumerate the possible devices in the beginning, since VISA does all this automatically for USBTMC devices.
USB Raw is complicated, lowest level and in general should be avoided at all costs, unless you have a very good understanding of how USB bits are transfered and even then only as last resort, after you were able to get the complete protocol specification. Anything else will be much faster to develop, easier to maintain and more likely to result in a working solution.