04-07-2009 10:27 AM
Hi,
Am using USB 1608FS board with LabVIEW. am trying to find the way checking the connection to card during initialization of my application. I tried using GetBoard.VI, but this gives the same answer even if i remove the card from the port. Any idea on how to detect whether the card is connected or not?
Thanks
Anil
Solved! Go to Solution.
04-07-2009 10:34 AM
04-07-2009 11:13 AM
04-08-2009 08:45 AM
Hi Anil,
MC's underlying InstaCal driver allows logical board numbers to be assigned from 0 to 99. You could call GetBoard.VI for each logical board number that you anticipate could be used, which will (as you pointed out) get the board name from InstaCal. If the string returned is blank and the error returned is 1, then there is no board configured in InstaCal for that logical board number. However, as you pointed out, if the physical board is not present in the system (such as a USB board previously having been configured in InstaCal but currently unplugged or unpowered, you will get error = 0 and you will still get the string name.
So, to test if a board is really installed in the system, since the MC driver has no function equivalent to "is the board really present?", you should attempt to perform a physical read with the board, so call TIN.VI (temperature), AI.VI (voltage) or DIN.VI (digital). If the error code returned is = 0, then the board is present. If the error code is 1, then the board is not present. If the error code is some other number, then the test is somehow invalid (such as asking to perform a function that is not supported on that model board, or on a channel number or port that does not exist on the board).
Brent
04-08-2009 10:16 AM
Yeah, I did similar thing, am using AIN.vi to check the presence of the card...