AnsweredAssumed Answered

Measurement Computing board .NET layer causing hassle

Question asked by optiluca on Jul 19, 2011
Latest reply on Jul 20, 2011 by optiluca
Hi all.  I am currently running VEE 9.2 with a Measurement Computing 1608-FS DAQ board, via the Universal Library for .NET provided by Measurement Computing. 

I know there is the possibility of running an old driver with some patches so as to be able to access the board natively from VEE, but I'd rather not have to rely on a deprecated (and bound to get broken at some stage) method, so I am going for the .NET layer instead.

Almost everything is working well, after having added the file MccDaq.dll to the .NET Assembly References.  The only issue I have is related to the function mccBoard.AInScan , which takes a parameter "options".  This parameter can be set to one or more different values.  When using C#, one sets it to Scanoptions.Default for example.  It is also possible to set multiple options, by doing a "bitwise OR" of the different options (which are just enumerations representing some number).  So for example Scanoptions.Background | Scanoptions.Continuous is acceptable notation in a C like language.

VEE is quite happy when I connect a block containing a single option to the corresponding input pin on mccBoard.AInScan, but I can't find a way of passing it multiple parameters.  I have tried connecting a Scanoptions.Background and a Scanoptions.Continuous block to a "bitwise OR" block, then connecting that to the input pin of the mccBoard.AinScan block, but that returns:

"Invalid Operation for Data Type Object"

Error Number 440

Object title: bitOr(x,y)
Object type: Formula


It seems to me as if VEE does not "see" the fact that this "object" is just an enumeration and therefore represents a numerical value.  I also tried bitOr on 2 ints with values corresponding to those represented by the enumerations, but then VEE complained about the input to the mccBoard.AInScan block not being of the correct type.


Any suggestions?  Pls ask for info if you need anything else.

Thanks in Advance

Luca  

Outcomes