08-31-2010 09:32 AM - edited 08-31-2010 09:33 AM
@Jick wrote:
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.
You could just use Find Resource twice. For example, this is what shows up on my system:

You could search the first array and then index out the appropriate element from the second one.
08-31-2010 10:26 AM
Ok, I'll try that when I am back at office.
If I write the alias name to device reference in input node as a string it will give me an error. I hope your trick works!
BR,
Jick
08-31-2010 01:02 PM
@Jick wrote:
If I write the alias name to device reference in input node as a string it will give me an error. I hope your trick works!
Are you sure you will get an error? I don't know about the 8451 drivers, but with the DAQmx drivers, you can write a string to the Device Name input and it will cause a red coercion dot, but it won't give an error, and it will work. Try it,
09-06-2010 05:37 AM
Ok. I don't know what was wrong last time when I got an error when wiring a string to reference in input node but now it seems to accept it.
In LV 8.0 the solution is to wire 2 into the search mode input. That is how I get the connected device's alias from the find list string array. And the correct alias is always at index 0 in the string array.
BR,
Jick