LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activex - Reg Event Callback - Leds

Solved!
Go to solution

Stavrosyt wrote:

About the remote debugger, do you mean to insert the debugger in my stand-alone application?

Like this: http://digital.ni.com/public.nsf/allkb/8DA679805915DE40862572D5007B2F70


Yes, that's exactly what I meant. Can you use the remote debugger?

 

I've had some trouble following this thread. Is the problem at the moment that your ActiveX events don't fire (or you don't know if they do), or something else?

0 Kudos
Message 31 of 47
(1,754 Views)

Hello again,

 

I manage to install a simulator of the laser in my computer. I tried the C# executable and runned fine.

So I think it is not necesary to worry about the remote debugger again.

 

I run my program, and the first LOAD led, ligthed. But when I press the execute button, nothings happens. Not events, nothing.

 

How can I start debugging it?

0 Kudos
Message 32 of 47
(1,732 Views)

Here are my files:

0 Kudos
Message 33 of 47
(1,730 Views)

Sorry, I'm still on LabVIEW 2012, so I can't open your VIs.

 

Do you fully understand the C# code? Are you sure your LabVIEW code duplicates it? Does the laser simulator provide any feedback as to whether it's received the commands you send, so you can determine whether you're failing to send the command or if you're failing to get the callback?

0 Kudos
Message 34 of 47
(1,710 Views)

Hello again,

 

I made it worked!!, at least the first part where the file is loaded and executed.(it can be seen when a triggered simulation windows from the laser program appears). But the events I can't still see them.

 

I create a reg event callback where 2 signals where supposed to be active once the program starts, VI callback with a One Button Dialog inside them to pop up a message when triggered.

 

But nothing. how can I see why the event is not triggered, or maybe it is but I can read it.

0 Kudos
Message 35 of 47
(1,690 Views)

I make the sigLaserStart signal trigger!, but not the End......I am confused about how to use the error line to work as a dataflow direction.

 

when I connect the error line, the reg event callback is also connected to it? if yes, is it connected first or after the method is executed?

0 Kudos
Message 36 of 47
(1,677 Views)

Try running your code with Execution Highlighting turned on (the lightbulb icon in the toolbar) so you'll get a visual representation of dataflow as your code runs. I'm not exactly sure what you're asking, but I think that will help answer your question.

Message 37 of 47
(1,641 Views)

Hello Stavrosyt,

I am Ed from National Instruments Technical Support, I notice that there is a duplicate thread here: http://forums.ni.com/t5/LabVIEW/ActiveX-LabView-from-C/m-p/3173459#M916918. Since the greatest part of work has been done and achieved here I think we should continue on this thread and I have a good understanding of what you are trying to achieve now. The event callbacks are primarily an initialisation process (unless loaded dynamically) and so I would suggest registering callbacks before loading the file to the laser machine. As for the Reg Event Callback property node the events will be registered from top to bottom of the node in order so in this case the Laser Started event will be registered and then the Laser Stopped event.

 

I have worked with C# dll libraries with .NET and LabVIEW which has a very similar outline as to usage in LabVIEW with ActiveX. A good method for passing back data to your main VI is to input a notifier to the user parameter of the Reg Event Callback property node and then to send a notification of, for instance the Event Common Data in the event callback vi e.g. sigLaserStart Event Callback, to the notifier. This way a notifier which is obtained (initialised) in the main VI and then passed to the event callback via the User Parameter input can be used to pass data from the event callback to the main VI in LabVIEW, then using get notifier status the current notification can be read within the while loop in the main VI to periodically check the status of the laser machine and any event callbacks.

So I can further assist you, could you possibly provide a link to the simulator of the laser machine and the library in use as it would benefit me if I can also try simulating the system. In the mean time I have also included some articles linked below which will assist in the above explanations and explain some concepts.

http://digital.ni.com/public.nsf/allkb/B9398355D9550EAF862566F20009DE19?OpenDocument

http://zone.ni.com/reference/en-XX/help/371361K-01/lvcomm/reg_event_callback/

http://www.ni.com/video/1875/en/

Regards,

Ed

0 Kudos
Message 38 of 47
(1,612 Views)

Hello Ed,

 

I am glad to finally have someone to work with ActiveX.

I am really not familiar to Notifier Operations, can you give me some basic example inside a Callback VI?

 

What I did was using putting LEDs in my main VI and then using their references as parameters in the callback VI, in that way, the Event common data returned the signal event I was expective and I could it see it through the LED in my main VI.

 

At the beginning was not working, so instead of it I use only One Button Dialog operator to see if the events were triggered. But in my case weren't. Just some days ago, I re-do the program from scratch, and worked. But I still need to use this program in conjunction with my other ActiveX device program. What do you recommend me to do? creating VI as functions? otherwise it is going to be very messy, and not scalable at all.

 

About the laser, you cannot use it unless you have a license from the manufacturer, but at least you can read the manual for some commands that are use in the library.

 

Here is the link: http://www.datalogic.com/tools/download.aspx?iddwnfile=11434&path=%2Fupload%2Fia%2Fmanuals%2FLighter...

 

thanks,

0 Kudos
Message 39 of 47
(1,589 Views)

Hello Stavrosyt,


I did see your implementation of the LEDs as a user parameter, this is a good method for cases in which you have only a boolean value of concern. If you are interested in using notifiers so as to provide the main VI with the data from the callback VI then notifiers or queues would be suggested, there are several examples on using these in LabVIEW under Help->Find Examples... from which you can search notifiers and find the Simple Notifier.vi example and then also by searching queue you can find the Simple Queue.vi example. Implementing these for a callback is simply a matter of passing the reference to the queue/notifier as the user parameter, then in the callback VI enqueuing an element for a queue for example when the event occurs. Meanwhile in the main VI there needs to be an implementation of dequeueing elements (for a queue) or checking the notifier status. I have also provided links below to a brief outline of notifiers and queues, if you have anymore queries then I am happy to assist, I cannot find an example specific to using notifiers with callbacks but could produce one if necessary. For your specific application is it simply a matter of start, load file, run and finish? or do you plan on implementing much more complex functionality later on?

 

http://digital.ni.com/public.nsf/allkb/DD7DBD9B10E3E537862565BC006CC2E4

 

http://digital.ni.com/public.nsf/allkb/B9398355D9550EAF862566F20009DE19

 

Regards,
Ed

0 Kudos
Message 40 of 47
(1,573 Views)