Jump to content

Question about ActiveX callback VI


Recommended Posts

Hi everyone,

I am working on a project which requires communicating with multiple similar devices. The communication with these devices is done through ActiveX, so I need multiple Callback VIs to process the tasks. But these Callback VIs have the same functions. Currently, I create the callback VI by right click on the VI Ref input of Reg Event Callback property node and select create Callback VI. I wonder if there is anyway more effective such as using multiple instants of only one VI (use reentrant). It likes we can put the Reg Event Callback property node in the For Loop and connect with an array of VI. I try to put the VI ref inside an array constant but I cannot do that. And event I can do that, I don't know how to identify these instants incase I need to debug them.

Thank you for your time.

Thang Nguyen

Link to comment

Hi Thang,

I'm not sure if I fully understand what you are trying to do, but from what I understand it is possible to do so. I've done something similar to that recently myself. ;)

Where you may hit a problem is if the referenced item is not of the same type. It will cause 2 problems:

1. you can't put them into an array

2. you can't call the exact same Callback.

How to solve this?

Well, for item 1, you may not be able to create an array of controls of different types, but you CAN create an array of clusters. The cluster can contain the different control types.

For item 2, you can obtain the control reference property and determine it's type. So in your Loop, you can have a case structure that contains the Callbacks for the different types you'll encounter (plus a default - catch all & error msg). That way you'll call the appropriate one, all within 1 VI that can be re-used.

Hopefully this gives you some ideas.. As I said, I am not sure if this is what you were looking for.

Have fun!

RayR

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.