03-10-2015 06:03 PM
I have 2 PC test systems using NI USB-8451 for I2C communication.
One has Device Reference ...33B.. and the other has ..33D... , so I can't use fixed defaults.
Also, I may need to roll out a complied exe for others to use.
Issues:
1. It's not VISA.No open or close VISA.
2. Nothing in the compare pallete validates this Device Reference.
3. No USB Device attached validation (Are You There).
So far
1. A succesful simple I/O operation can verify "Are You There". I choose Dig I/O Read one bit.
2. #1 above also validates Device Reference.
Isn't there a slicker, faster way to do this? Doesn't Windows OS register USB stuff etc...?
TODO:
Get the USB-8451 Device Reference from MAX.
This link might be the fix, I will know tomorrow. I just did not expect a VISA VI to be helpful.
Solved! Go to Solution.
03-10-2015 06:24 PM
03-10-2015 09:04 PM
best practices?
03-10-2015 10:25 PM
03-11-2015 01:41 PM
Finally I got back to it.
This FGV holds and refreshes the references. Checking for valid device reference and USB Device Attached.
If Device Reference input is EMPTY it will Auto default to USB0.
The 2nd file shows how to extract the device name.
03-11-2015 03:42 PM
Look into the system configuration API.
A simple hardware filter by Device Type (NI USB 8451) and the "Is Present?" and Aliases properties should help a lot.
03-11-2015 04:45 PM
Jeff
That looks good.
Thank-You
03-11-2015 05:22 PM
USB0::0x3923::0x7166::00E3133D::RAW
The NI MAX device string looked familar, like USB VID + PID + Handle? + Mode (Instrument or Raw).
So my simple USB0?* search could be tripped up by other VISA USB devices.
Vendor ID googled: 3923 National Instruments Corp.
So USB?::0x3923?* seach would trip up on other NI VISA USB devices.
0x7166 should be NI-8451 PID. What is 8452 PID? Is it different for OEM versions?
I don't have them to check it out. I don't want to exclude them either.
Oh well, instead of parsing a string I can do this with VIs, loops, and property nodes.
03-12-2015 10:22 AM
USB0::0x3923::0x7166::00E3133D::RAW
Parses to:
USB[controller? #]
VID (Vendor ID)
PID (Product ID)
Serial#
Mode (Instrument or Raw)
Serial # is best guess after moving Two USB-8451 around to Two PCs and using NI MAX.
NI Max can save an Alias that is tied to this serial number.
Important to know IF using more than one USB-8451.
Better ignored if using just one.
It makes setting up a new system easier. Especially for those off shore.
It makes swapping out USB-8451 easier. Ex. No blinking? Galvonic USB Isolator, USB cable, or 8451?
03-12-2015 11:25 AM
Cleaned Up version attached after validation.
The FGV holds and refreshes the references.
Checking for valid device reference and USB Device Attached.
If Device Reference input is EMPTY the SubVI will Auto Find NI-845? with lowest serial #.
BTW: Saved as LV2012 for your convienance.