LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ask the I2C device alias name from the MAX

Solved!
Go to solution

Hi,

 

How can I ask the I2C device alias name which MAX uses in Labview? If the VISA Alias on My System is for example I2C in MAX, I need to ask it in Labview and write it then to Device Reference In input of a I2C vi.

 

BR,

Jick

0 Kudos
Message 1 of 14
(3,482 Views)

I am not exactly clear about your question, but you can get the correct VISA reference by using a VISA control on your front panel. If you then click on it the "pull down" list will show all of the VISA aliases on that system.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 14
(3,465 Views)

Assuming you are referring to the NI-8451, VISA doesn't even come into play with the I2C device, so I'm not sure why you'd be trying to use it. The 8451 installation adds a new control to the I/O palette called "NI-845x device". If you do have the 8451 have you looked at the examples that ship with it? If you are not using the 8451 then what do you mean by writing it to the "Device Reference In" input of an I2C VI?

Message 3 of 14
(3,461 Views)

Yes, I am using the NI-845x v.1.1.1. This version does not automatically recognize the NI I2C/SPI Interface device. That is why I have to give an alias name for that device in MAX and use the alias in LV.

My question was that can I somehow ask that aliasname in my LV code and after that I would use that name as the device resource name in LV?

 

However I could not find any solution for this. Instead of it I used VISA Find Resource vi which gave me a list of the interfaces including the serial number of my device. I used same serial number of the Device as alias in MAX. So I got it work!

 

BR,

Jick

0 Kudos
Message 4 of 14
(3,442 Views)

I am still interested in to find a solution for the original problem...

 

BR,

Jick

0 Kudos
Message 5 of 14
(3,432 Views)

Here is a picture which should clarify the problem a bit more.

As you can see I use "I2C2" as an alias in MAX and I need somehow query that alias in Labview and write it to the device reference in input node. How?

 

BR,

Jick

0 Kudos
Message 6 of 14
(3,421 Views)

 


@Jick wrote:

Yes, I am using the NI-845x v.1.1.1.


You should be using 1.1.4, as that is the latest version. v1.1.2 fixed a problem with aliases. Please download and install the latest version of the driver.

 

0 Kudos
Message 7 of 14
(3,412 Views)

I am using Labview 8.0 and I am not sure if it is possible to use later version than v.1.1.1 with it?

 

BR,

Jick

0 Kudos
Message 8 of 14
(3,410 Views)

 


I am using Labview 8.0 and I am not sure if it is possible to use later version than v.1.1.1 with it?

 

Well, that's a problem. v1.1.1 is the last version that supported LabVIEW 8.0.

 

 


@Jick wrote:

Here is a picture which should clarify the problem a bit more.

As you can see I use "I2C2" as an alias in MAX and I need somehow query that alias in Labview and write it to the device reference in input node. How?


Does it work if you manually enter "I2C2" in the device reference control?

 

0 Kudos
Message 9 of 14
(3,402 Views)

Yes, but I have to automatically recognize which I2C device is connected and write its unique alias name into the device reference in input node.

 

One solution is to use VISA Find Resource vi, parse the serial number out from the string array and use that serial number as an alias name in MAX. But how can I convert a serial number string to the device reference in type? I can't wire it directly because it gives me an error when I run the VI.

 

BR,

Jick

0 Kudos
Message 10 of 14
(3,396 Views)