LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

what should be in Resource Descriptor

I am new to LabWindows/CVI, so please forgive my ignorance, but I've been struggling for several days with the very basics of creating an IVI Specific Driver, using the IVI Instrument Driver Wizard tool, and getting nowhere.

 

I am trying to create the most simple Serial IVI driver I can, to see if I can get some communication flow from a test app created with CVI on a PC to a new device, which is a SocKit evaluation board with an SoC and some on-board I/O interfaces.  The new instrument has a serial port and an Ethernet port... ultimately I'd like a driver that can connect to either.

 

I'm using the IVI Instrument Driver Wizard to create the serial driver.... using CVI 13.0.

 

When I get to the 'Test' page of the Driver Wizard, it asks for a Resource Descriptor, and provides the default of "ASRL1::INSTR". 

 

My question is where am I supposed to get this descriptor?

 

My device is connected to COM4 (which is a USB Serial Port with an FTDI driver installed to convert USB to serial...).    I know that communication on this port from the PC to the device works, because I can set up a putty terminal connection and connect to a linux 'sh' program running on the board.

 

Currently I just want to test this driver to see if the device sees any 'receive' data on its serial port ... so I've told the driver that I want it to send an Identification Query as part of the Initialization.

 

If I keep the default Resource Descriptor of ASRL1::INSTR, and select 'Run Tests...', I'm fairly sure that no communication is going across COM4... I dont' see any Rx LEDs light up on the device.   But the tests act like they're trying to communicate with something, and eventually return with the following:

Serial Port Configuration
...Passed
VISA Initialization
Return Code : 0x0 (VI_SUCCESS: No error)

ID Query
Return Code : 0xBFFF0015 (VI_ERROR_TMO: A timeout occurred)

 

I've change the Resource Descriptor to "ASRL4::INSTR", and also tried "COM4", to see if I can see any Rx LEDs light up on the device... but in any of these cases, when I click 'Run Tests...', CVI immediately returns with an error message...

Could not get the board number for the given interface. (VI_ERROR_INV_RSRC_NAME: Invalid resource reference).   

So one problem is that I don't know where I'm supposed to get a valid Resource Descriptor to try communicating across the PC's COM4 port ??

 

I've also tried building and installing this driver, and running NI MAX.

Within NI MAX, the new driver shows up under IVI Drivers->Advanced->Instrument Driver Software Modules.

 

But it does not show up anywhere else (e.g. under "Devices and Interfaces", or "IVI Drivers->Driver Sessions").   I don't know if this is something I need to fix first before expecting to provide a valid Resource Descriptor, or really what to try next.

 

Just to be clear, I don't have any communication software specifically set up to run on the device... but it has a built-in Serial communication capability, and as mentioned above, this has been tested by connecting to an embedded linux 'sh' app running on the device, using putty on the PC.

I'm hoping I can verify that I have a mechanism for communicating through an IVI driver to the device, before putting an IVI/Visa compatible app on the device that provides the desired communication interface.

 

 

 

 

0 Kudos
Message 1 of 11
(5,382 Views)

Hi HowardS,

 

Where you can see how COM4 is named is in NI-MAX which should of installed with LabWindows/CVI.  The naming convention for COM ports is usually something along the lines of "ASRL4::INSTR "COM4"" so my guess is that your COM4 should be ASRL4::INSTR.  Here is another good resource that is worth taking a look at:

 

http://www.ni.com/white-paper/10098/en/

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(5,367 Views)

Peter,

   I am not sure if NI-MAX (or CVI) is working, because I'm not sure what it should show me... but I don't see any interfaces listed there.

Attached ('NI-MAX.PNG') is a screen shot of what NI-MAX shows, after I did the following...

 - connected a FTDI USB-to-serial adapter to one of my PC's USB ports

 - connect this adapter to the serial port of an Agilent E4419B power meter using a standard 'null modem' cable 

 - let Windows auto-install the FTDI driver for this port (COM5 in this case)... see attached Device Manager screen shot showing my Ports

 - verified that I can run 'putty' to talk to the power meter via this serial interface

    - I was able to send *IDN? and get back a valid response from the power meter using a simple terminal window with the program 'putty'

 

After doing all this, you can see in the attached screen shot from my Device Manager that that my PC's "standard" serial port is showing up as "COM1".  The USB port that has been converted to a serial port is also showing up as "COM5".  However, neither these nor any other interfaces show up under "Deviced and Interfaces" in NI-MAX.

Are there supposed to be serial interfaces displayed there in NI-MAX?

 

 

When I try to build a simple driver with LabWindows/CVI's IVI Instrument Driver Wizard, and I get to the "Test" screen, the only Resource Descriptor shown under the pull-down menu is "ASRL1::INSTR"

 

Currently, when I try to "Run Tests..." for any Resource Descriptor, including ASRL1::INSTR (or manually entering ASRL5::INSTR), I get the following error message in a LabWindows/CVI pop-up dialog: 

 

   "Could not get the board number for the given interface.  (A code library required by VISA could not be located or loaded.)"

 

This makes me believe there is something wrong with my installation, but not sure how to go about fixing this, other than to try to uninstall everything CVI/Labwindows, VISA, and IVI-related and start over ???

 

From the NI-MAX.PNG screen shot, is it obvious that some software is missing or messed up?

 

Thanks for any advice.

 

 

 

Download All
0 Kudos
Message 3 of 11
(5,340 Views)

HowardS,

 

So from the picture of NI-MAX that you posted I don't see the NI-VISA driver installed.  You will need this to do serial communication.  Here is a link to the latest version NI-VISA 5.4:

 

http://www.ni.com/download/ni-visa-5.4/4230/en/

 

Also, If you are working with GPIB you will need our NI 488.2 driver:

 

http://www.ni.com/download/ni-488.2-3.0.2/2922/en/

 

Once you install NI-VISA and restart NI-MAX you will be able to see your serial ports in NI-MAX.

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 11
(5,308 Views)

I uninstalled and re-installed everything related, including NI-VISA 5.3.0.

Now, I do see all of the serial ports in NI-MAX.

 

I am still unable to use the IVI Driver Wizard and do a successful 'Test' of a serial port communication with a device that uses a USB port with a FTDI "virtual serial" driver.

 

A test of communication with an Agilent E4419B power meter works successfully in the IVI Driver Wizard, when I connect the power meter to the COM1 (RS-232) port.   But when I switch to using one of the USB ports with the FTDI driver, I always get a LabWindows/CVI Message dialog saying:

 

  Could not get the board number for the given interface.  (The resource is valid, but VISA cannot currently access it.)

 

I can use the VISA Interactive Control tool, and open this virtual Serial port, and successfully send queries and receive responses from the power meter using this tool...   I can also use 'putty' to communicate with the power meter over this port.

So I am not sure why the Driver Wizard's 'Test' function is unable to communicate over the FTDI port, and keeps giving this "busy" message.

 

I have a separate device on another of these USB FTDI ports (the device for which I'm actually trying to create a new IVI driver).   And the IVI Driver Wizard always gives me the same error message (The resource is valid, but VISA cannot currently access it.) on that port as well.

 

 

0 Kudos
Message 5 of 11
(5,287 Views)

Hi HowardS,

 

So this usually pops up because something has the hardware resource port reserved, such as another program talking to your serial device.  Have you closed all other programs and tried using the Wizard?  If you have an open session of LabWindows/CVI and didn't close a VISA reference that might be the cause of the problem.  Could you post a picture of the error?

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 6 of 11
(5,267 Views)

 

PTerro,

   I'm fairly certain there isn't any other application interfering with those virtual serial (USB with FTDI driver) ports on the pc, because I tried this again immediately after rebooting the pc:

 - Ran NI Labwindows/CVI 2013

 - Created New Project

 - Selected Tools->IVI Development->Create IVI Specific Driver

 - In the driver wizard...

   - selected 'Serial' and 'General Purpose'

   - entered 'test' and 'test' for instrument name and instrument prefix

   - entered a target folder to save the driver in

   - left the Default Setup Command field blank

   - for Channel List String, left '1' in the field

   - Under 'operations supported by your instrument', left only the Identification Query field checked

   - for ID Query Command, entered '*IDN?'

   - for expected response, entered 'Agilent Technologies,E4419B'

   - under Serial Port Config parameters:

      - 9600 baud

      - 8 data bits

      - 1 stop bit

      - no parity bits

      - 512 input and output queue sizes

      - 5 sec timeout

      - LF for Read Terminator and Write Terminator (power meter needs to see this via experimentation)

      - No flow control

   - verified that all of these parameters match the settings on the power meter

   - next page is the 'Test' page...

      - left Identification Query as the only operation to test

      - in the Resource Descriptor field, selected 'ASRL5::INSTR' from the drop-down menu (previously have verified that the power meter shows up on this port, both through NI-MAX and through Device Manager on pc)

      - Selected Run Tests...

 - after about 2 seconds, the aforementioned "busy" error showed up.   Attached is a screen shot showing the results.

 

Note that when I go through exactly the same sequence, but connecting the power meter to my PC's DB9 / RS232C serial port instead of to the USB port with FTDI adapter, and selecting 'ASRL1::INSTR' as the Resource Descriptor, everything works successfully... the power meter sees the *IDN? query and responds with the correct query response, and the driver wizard indicates that the response matches correctly...   This just doesn't appear to work with the USB ports with the FTDI drivers.

 

After running the test above, I then brought up NI-MAX, and took a snapshot of what it now shows under 'Devices and Interfaces' and 'Software'...  This picture is also attached.

 

 

 

Download All
0 Kudos
Message 7 of 11
(5,244 Views)

As another added bit of information, I have verified that using the utility program 'VISA Interactive Control', I can successfully communicate with the Agilent power meter on ASRL5::INSTR (i.e. using the 'virtual serial' USB port with FTDI driver).   It appears to be only the IVI Driver Wizard that is having trouble communicating with it over these USB ports.

0 Kudos
Message 8 of 11
(5,203 Views)

HowardS

 

You may want to see if CVI can communicate with the Agilent power meter on ASRL5::INSTR. This tutorial walks you through how to run that test.

http://www.ni.com/white-paper/3377/en/

 

This will help narrow down if there is a problem with CVI talking to IVI drivers or if it is just the IVI Wizard that is refusing to connect.

 

ConnorM

0 Kudos
Message 9 of 11
(5,186 Views)

Hi HowardS,

 

I have another service request with you but I thought I'd write here because we have more troubleshooting history available. I think Connor's idea of determining where the point of failure is is a very good one, at least it will help us narrow it down. Have you had a chance to try using CVI? There are shipping examples for serial ports that can be run immediately, you don't need to write any code yourself.

 

Regards,

Basil

NIC 



Notes for Branch AE:
Please reply to This Post within 24 hours
The US AE is expected to reply to all of your posts within 24 hours. Having this expectation will keep the escalation moving quickly and toward a fast resolution.

You can also use other communication channels: Phone, Skype, etc. to discuss the issue with the US AE. This can help with troubleshooting and quick diagnosis of the issue.

Click here to provide kudos for a post on this page
0 Kudos
Message 10 of 11
(5,122 Views)