Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB RAW Control pic18f2450

Hi Guys,

 

Recently I began a project trying to send and receive information from LABVIEW to my PIC18F2450 microncontroller.

So far I have made good progress, using the Visa driver wizard I have managed to create the driver for my USB RAW device.

I can also send and receive data packets from the VISA interactive control program very consistently, i have used this tool to help to check if the device is working correctly.

My next step is to get this working from LABVIEW itself, now I have read through lots and lots of the tutorials but the penny still hasnt dropped, so I just have a few questions.

I have also came to the conclusion that I will be using VISA USB Control in and VISA USB Control out .

From the interactive control utility when I go to the property node get tab I receive the following informationabout my device

 

Timeout Value = 50
Maximum Queue Length = 50
Termination Character = 0x0A
Termination Char Enable = VI_FALSE
IO Protocol = 1
Suppress End on Reads = VI_FALSE
USB Maximum Interrupt Size = 1
USB Control Pipe = 0x0000
USB Bulk-Out Pipe = 0x0001
USB Bulk-In Pipe = 0x0081
USB Interrupt-In Pipe = 0xFFFF
USB Alternate Setting = 0
USB Bulk-Out Pipe Status = 0
USB Bulk-In Pipe Status = 0
USB Interrupt-In Pipe Status = -1
USB End Mode for Reads = 5

 

In LABVIEW do i need to use a VISA open box ? Or can I just use Control In and Control out without VISA Open ?

 

In the connection named Visa Resource Name  I have also connected on that little I-O box and right clicked it to select Visa Class >I-O Session>USB Raw or do I need to enter in (USB0::0x04D8::0x0011::NI-VISA-0::RAW ) somewhere ?

 

What about the connections on USB control out, " index,value,request type request " ? What should I put in there ?

 

Hope somebody can help me soon, if you need anymore info from my side just let me know,

 

Regards Eoin

 

 

 

0 Kudos
Message 1 of 5
(5,440 Views)

USB RAW communication is not trivial.

 

Have a look at my Nugget here.

 

Shane.

Message Edited by Intaris on 05-06-2009 07:04 AM
0 Kudos
Message 2 of 5
(5,435 Views)

Great I managed to get it working with Visa Read and Write.

But now I have another issue, in the text box where I need to enter the name of my Raw Device Ive got a problem.

 

Sometimes when i connect my USB microcontroller it is assigend this name 

 

"USB0::0x04D8::0x0011::NI-VISA-1::RAW"

 

and next time I reconnect its assigned a slightly different name which of course stops me from being able to open the device

 

"USB0::0x04D8::0x0011::NI-VISA-0::RAW "

 

Is there anyway of permanently setting the name to be 1 or 0 instead of it switching between the two ?
0 Kudos
Message 3 of 5
(5,402 Views)

You can do a VISA search and give in the PID and VID of the device so that it will only return instances of that particular device.

 

 Use the String "USB0::0x04D8::0x0011::*" for the search.  It should return only the devices you are looking for.

 

Shane.

Message Edited by Intaris on 05-07-2009 08:54 AM
0 Kudos
Message 4 of 5
(5,400 Views)
hello I am using PIC18F14K50 installed usb. i am trying to communicate with the help of a labview. I am successful in reading the device but i am unable to write to the device. I am using PIC 18F14K50 as a mouse in a circle demo. Please can anybody throw a light how to perform control out function in Usb raw control communication.vi
0 Kudos
Message 5 of 5
(4,955 Views)