LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activex enums and disabled methods

I am relatively new to using Labview for accessing COM objects. I am trying to use Labview to access an SDK library for controlling a USB ultrasound machine. I am having a couple of problems that I am not sure if I can get around and would appreciate any help.

 

Firstly, I am having accessing tagged enums which are inputs to methods. This works for some inputs, where the enums are sequential (SCAN_STATE_STOP = 0, SCAN_STATE_ACQUIRE = 1, SCAN_STATE_FREEZE = 2,SCAN_STATE_RUN = 3). When I right click on the input and right click, the appropriate enum list shows. But this does not work for others that are not sequential (e.g. SCAN_MODE_UNKNOWN = 0,SCAN_MODE_B = 1,SCAN_MODE_M = 2,SCAN_MODE_PW = 4,SCAN_MODE_BPW = 7 etc). Is there a way of being able to access these? By just defining the integer value, I seem to be getting errors in some methods (but not all). 


I am also having a problem in that one of the methods of the a specfic class is greyed out and disabled (GetControlObj). The input for this method is 'System.Guid@ riidCtrl', System.UInt32 ScanMode and System.UInt32 streamId. I suspect that the problem is that Labview cannot interfacece GUID object that needs to be input. Is this correct? Is there any way around this?

 

Regards,

Glen 

 

 

0 Kudos
Message 1 of 9
(2,907 Views)

Hi Litch09,

 

I think I need a little more explanation. First, what version of LabVIEW are you using?

 

Second, can I assume that you are using a Call Library Node to access some sort of DLL? And you're trying to create Enum controls off of the DLL call but it is having problems with certain enums when they are not sequential?

 

 

Jeff | LabVIEW Software Engineer
0 Kudos
Message 2 of 9
(2,881 Views)

I don't believe the user is using Call Library Function Node. It sounds more like the user is dealing with a .NET assembly, given references to System.UInt32, which are .NET classes.

 

Are you sure you're dealing with COM?

0 Kudos
Message 3 of 9
(2,878 Views)

Thanks for your replies, sorry I wasn't specific enough. For starters I am using Labview 8.5.

 

I am using the ActiveX automation open to get a reference to the library which is made available in the SDK.

 

I have attached a screenshot of the block diagram I have made so far, with some text in it. Let me know if there is anything else you require to understand... I am sorry if my lingo is not up to speed, I have no formal programming training!

 

 

 

0 Kudos
Message 4 of 9
(2,866 Views)

Litch09 wrote:

I am sorry if my lingo is not up to speed, I have no formal programming training!


Neither have I, and that's never stopped me... Smiley Very Happy (My "formal training" is as an electrical engineer! Smiley Wink)

 

What you are seeing is behavior by design. Whether or not it's correct is debatable. LabVIEW enums are always consecutive. If you want to use a dropdown that has a text label with non-consecutive values then you can make a ring constant. Unfortunately, you have to do this manually. Basically, you're wanting to create a "sparse enum".If you do search for "spase enum" you'll find some information. A while ago JeanPierre wrote a tool to create an enum typedef and a lookup VI to conver the enum to the sparse value. 

Message 5 of 9
(2,861 Views)

This seems to be the information I required. I will look into these sparse enums.

 

On my other problem, which is not really shown in the picture. One of the methods of the UsgScanMode class is disabled (greyed out). As mentioned above, the input for this may not be accessible in Labview (one of the inputs, according to the SDK manual is of type System.Guid@ riidCtrl). Is this the reason it is disabled? Do you know of any way around this?

 

0 Kudos
Message 6 of 9
(2,855 Views)

Hi Litch09,

 

What COM server is this? Is it something publically available that I could get and try out myself?

 

Also, could you provide us with a screen shot of exactly what you're talking about with the greyed out option.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 7 of 9
(2,826 Views)

Hi Jeff,

 

This COM server is not publically available, unfortunately. However, I can probably send you a copy of the programmers guide that comes with the SDK, if that helps???

 

Screenshot below.... 

 

 

 

 

0 Kudos
Message 8 of 9
(2,777 Views)

Glen,

Methods are typically greyed out if they return a data type that is not supported by LabVIEW.  Here is a discussion forum that talks a little more about this:

http://forums.ni.com/ni/board/message?board.id=170&message.id=82975&requireLogin=False

I hope this helps.

-Christina

Message 9 of 9
(2,743 Views)