Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine Traditional DAQ Device number using Labview.

Solved!
Go to solution

Hi,

 

Can anyone answer the following question:

 

With regards to Traditional DAQ devices, e.g. NI-4060 DMM, how

can I programmatically determine the Device number which can be seen in MAX ?

 

Using Labview 8.5, I've looked in the following function libraries:

 

NI-DMM

VISA

NI-ModInst

None of the above libraries seem to provide access to the Traditional DAQ Device number

property, which is automatically assigned.

 

 

Background:

I have an 18 slot PXI chassis which contains 2 DMM's, in slots 3 and 14.

The DMM's could be a mix of either type NI-4060 or NI-4070.

 

The system is controlled by a Teststand sequence which employs IVI - DMM

steps.

When defining the IVI step Logical Name, I refer to IVI Device Sessions defined

in MAX - determined at rutime.

 

Using Labview VISA functions I can determine the model, i.e. 4060 or 4070.

Because the DMM's only locate in slots 3 or 14, then the NI-4070 device(s)

can be accessed using the following Resource Descriptors: PXI1Slot3 or

PXISlot14.

(The 4070 is DAQmX compatible.)

 

So for the NI-4070 devices, I can predefine 2 IVI Device Sessions, knowing

it will suffice for all occasions when I run my Teststand sequence, which will

determine which Device Session to use at run time.

 

But for the NI-4060 I am stuck.

In the Device Session, I have to give a Resource Descriptor of the following

format:           DAQ::x              (where x is the Device number)

 

I could create 18 Device Sessions each referring to a different DAQ::x, but to select

the correct one at runtime I would need to determine programmatically the Device

number, i.e. value of x. 

 

Hence my question.

 

 

The closest I've come to a solution was a Knowledge Base entry which said that the

Device number allocated would be the same as the slot number, providing the

device number had not been previously manually configured.

Unfortunately our Device numbers have been changed manually and may well be in the future. 

 

 

Any solutions much appreciated.

 

 

Gary.

 

 

0 Kudos
Message 1 of 6
(5,205 Views)
Solution
Accepted by topic author Gary_H

Hi Gary,

 

Good afternoon and I hope your well today.

 

Thanks for your post and I'd like to help you to resolve your problems.

 

I don't believe there is just one function you could use to identify and gather information on all the cards your using. For the Traditional DAQ devices in particular I would suggest using the Get DAQ Device Information.vi.

 

If you look at this link,

Sal posted an example vi titled, find dev trad.vi.

You can get information such as Serial Number, Dev Name and Base Address.

 

The using respective drivers to gather information you could generate a string array with the information you require of all the slots.


Please let me know if this helps at all,  

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 6
(5,191 Views)

Thank you James.

 

The find dev trad.vi gave me a list of Device Numbers and their associated base address property.

 

Because I have assigned Visa Alias names to the 2 DMM's in the MAX\Device\PXI chassis view, I can use a

Visa Property Node (Instrument I/O / VISA / Advanced) to get the BAR1 Address Base (Properties \ PXI\PCI Settings \

PCI Resources \ BAR1 Address Base) of each DMM.

 

By comparing base address from find dev trad.vi with the BAR1 Address Base from Visa, I can match a

Traditional DAQ Device Number with a Visa Alias, i.e. I can now reference a specific Traditional DAQ DMM

in the chassis using the DAQ::n resource descriptor in my IVI Driver Sessions, even if the DAQ Device Number

is automatically changed due to board swopping.   

 

I've only tried the base address/BAR1 Address Base comparison  process using separate VI's

and human judgement, and I'm assuming the relationship will always exist.

 

Thankyou for your help.

 

Gary.

 

 

 

 

 

 

0 Kudos
Message 3 of 6
(5,181 Views)

Hi Gary,

 

Thanks for the reply and your kind feedback.

 

Could I ask you to post an example of your finished code for other users reference in the future?

 

It would be great to see,

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 4 of 6
(5,163 Views)

Please see attached Solution.zip file for my Labview solution.

 

Contains 6 files.

 

Top level VI: DetermineVISA_DeviceDriverSession.vi

 

 

I'll be calling the top level vi from Teststand to determine the correct Driver Session for the

IVI DMM steps, i.e. the Driver Session name is used in place of the IVI Logical Name.

 

I've declared a pool of Driver Sessions in MAX, 2 of which will be chosen for the 2 DMM's

in our system at run time.

So despite having 2 types of DMM, the mixture of which can change throughout the year,

the Teststand sequence will automatically chose the appropriate Driver Session.

 

 

 

Notes:

1. Base Address and BAR1 Address Base device properties are relied on.

2. VI's coded for NI4060/4070 DMM's but could easily refer to other DAQ/DAQmx devices.

3. The IVI Driver Sessions defined in MAX should follow same format as in CreateDriverSessionName.vi.

 

 

regards,

 

 

Gary. 

Message 5 of 6
(5,112 Views)

Please find attached a version of the VI's for Labview 8.2.

 

The previous Solution.zip contained VI's for Labview 8.5.

 

We're using Labview 8.2 in Production, and 8.2 does not support the

Conditional Terminal in For Loops, now replaced with While Loop structure.

(See GetVISA_DeviceDAQDeviceNumber.vi)

 

Plus: Error cluster wiring not complete in GetVISA_ModelAndSlot.vi, now complete

through out VI's.

 

 

Top level vi: DetermineVISA_DeviceDAQDeviceNumber.vi .

 

 

regards,

 

 

Gary.

 

 

Message 6 of 6
(5,093 Views)