取消
显示结果 
搜索替代 
您的意思是: 

USB-8451 Device Reference and Device Attached

已解决!
转到解答

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.

http://forums.ni.com/t5/LabVIEW/How-to-ask-the-I2C-device-alias-name-from-the-MAX/td-p/1231439/highl...

 

 

0 项奖励
1 条消息(共 10 条)
5,708 次查看
So is there a question?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 项奖励
2 条消息(共 10 条)
5,699 次查看

best practices?

0 项奖励
3 条消息(共 10 条)
5,683 次查看
Best practices for what? I don't see any code and from your description haveno clear idea of what is going on and where you need guidance.

Clearly the system needs to be configurable -- but what system doesn't?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 项奖励
4 条消息(共 10 条)
5,672 次查看

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.

0 项奖励
5 条消息(共 10 条)
5,638 次查看

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. 


"Should be" isn't "Is" -Jay
6 条消息(共 10 条)
5,630 次查看
解答
已被主题作者 Pappion 接受

Jeff

That looks good.

Thank-You

0 项奖励
7 条消息(共 10 条)
5,625 次查看

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.

 

 

 

0 项奖励
8 条消息(共 10 条)
5,619 次查看

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?

 

 

 

 

0 项奖励
9 条消息(共 10 条)
5,590 次查看

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.

0 项奖励
10 条消息(共 10 条)
5,585 次查看