LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activex - Reg Event Callback - Leds

Solved!
Go to solution

Ok, I see the problem. In the sencod Reg Event the evetn sigLaserEnd was unwired from the automation refnum . Fixed. Now is connected.

How can I replace the boolean T with a triggered signal from the event?

0 Kudos
Message 11 of 47
(2,375 Views)

@Stavrosyt wrote:

Ok, I see the problem. In the sencod Reg Event the evetn sigLaserEnd was unwired from the automation refnum . Fixed. Now is connected.

How can I replace the boolean T with a triggered signal from the event?


Great! Now my understanding is this: You manage to run your program and once the Laser on event triggers you set the LED to true. All this works, right?

 

My understand is, that you have to take a look at the Variant (the one you deleted when comparing your current program to the example you posted earlier). What is in that Variant when the Event triggers? You can try that out or have a look at the documentation for the laser's activeX Interface.

 

In terms of functionality, why don't you just use one LED and set it to true in the "On Event" and to false in the "Off Event"? That would do what you want: Indicate wether the laser is on or not, wouldn't it?



Remember Cunningham's Law
0 Kudos
Message 12 of 47
(2,353 Views)

Hey again,

 

I manage to run my program, but it doesn't seem to work with the laser (althought no errors are displayed). Need to see when the event triggers....

 

The variant should be nothing because according to the laser documentation, sigLaserStart is a void signal [void sigLaserStart (void)].

 

Your solution using one LED could be a good idea, but then I need to be set to TRUE by the trigger event "LaserStart" and set to FALSE triggered by the event "LaserEnd", how can I do in that case? same user parameter reference for both reg event callback?

0 Kudos
Message 13 of 47
(2,346 Views)

That would be my best guess. Since start and end are separate events, this might work.

 

I don't understand: Does the event trigger? have you been able to verify this?



Remember Cunningham's Law
0 Kudos
Message 14 of 47
(2,340 Views)

No, how can I verify it? is there a simple way to see if the event trigger, and if it doesn't find where is the fail?

0 Kudos
Message 15 of 47
(2,333 Views)

See when it triggers: Why don't you call a one button dialog within the Event VI? That would at least tell you if there was an event.



Remember Cunningham's Law
0 Kudos
Message 16 of 47
(2,318 Views)

I will try that, but then this doubt appers:

 

which events should I manage with the Reg Event Callback, and which ones with a Case structure, or Event structure?

0 Kudos
Message 17 of 47
(2,300 Views)

Nevermind, I see that ActiveX events should only be used with Reg event callback. And event structures for non-activeX events.

I will be trying if the events are triggered, but what about the leds ligthing?

0 Kudos
Message 18 of 47
(2,294 Views)

Hi Peter,

 

I can't see the event is triggered at all. How can I debugged if the ActiveX is running in my program? or at least to debug step by step the program.

 

Here is the new main VI:

 

 

NewVI.png

 

And this is what the VI ref block diagram looks like:

 

VIref.png

 

As you can see, there are already a TRUE constant at the LED value. But I can't see if the event is triggered or not even with the "One button dialog" inside.

 

Any more ideas?

0 Kudos
Message 19 of 47
(2,262 Views)

hmm... that's strange... Does the laser switch on?

 

If I try this with the browser example that comes with labview it works. 

 

So our logical next step would be to see why the event doesn't trigger. 



Remember Cunningham's Law
0 Kudos
Message 20 of 47
(2,252 Views)