From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

activex - Reg Event Callback - Leds

Solved!
Go to solution

I tried with the Laser program, and that works. I tried also with a C# program, and works too.

 

But somehow, I don't see the triggered signals in Labview stand-alone executable.

0 Kudos
Message 21 of 47
(1,510 Views)

Do you see the signals in a labview VI running in the Development Environment?



Remember Cunningham's Law
0 Kudos
Message 22 of 47
(1,497 Views)

I don't understand your question.

 

how should I see the signals?

 

I was thinking on using the "highlight execution" command in the block diagram, but the problem is that the Computer connected to the laser does not have Labview installed. So I can only create stand-alone applications in my PC and then run them in that computer.

 

Considering that, I am trying to make the basic and simplest program, and after seeing it works, continue adding more parameters that I will need.

 

The basic program as you can see is, load a file, and then when the button is pressed, execute the file. During this I am expecting to see some events triggered from the laser HW or SW, but nothing works. Nor the execution, neither the displayed events.

0 Kudos
Message 23 of 47
(1,482 Views)

I understand your dilemma. It would be easier to try things out with the dev. environment installed. But since that's not possible...

 

Have you tried if the activeX element itself works in labVIEW? Can you try something else than callback events, like set some property or use some method for which you can see a reaction if it works?



Remember Cunningham's Law
0 Kudos
Message 24 of 47
(1,477 Views)

The ActiveX element works in Labview. In the same Laser computer, I have another instrument which I created a Labview stand-alone program to control it (uses a container instead of Refnum).

 

The ultimate goal is to create this program, and then combine both together.

 

Even If I could manage to install Labview, how could I see the signals in the dev. enviroment?

 

As you could see, I did use two Laser properties: LaserAxApp, and LaserDoc, but coudln't see that those worked....

 

I would like to see more debug techniques.....

0 Kudos
Message 25 of 47
(1,464 Views)

Do you have access to the Source code for the program that is working? Can you have a look at how the activeX elements are used there and try something out? 

 

I'm sorry I am of so little help to you. It's kinda hard to debug those things, without trying some stuff out live.



Remember Cunningham's Law
0 Kudos
Message 26 of 47
(1,457 Views)

Absolutely, I have all the source code of the working program. The activeX elements are used in static events (eventhought Labview use dynamic events).

 

This is part of the code in C#:

private void InitLaser()
{
try
{
// Create a connection with the ActiveX Server
Laser = new LaserAxApp();

// Get an instance of System
LaserSystem = Laser.System;

// Subscribe to various events
LaserSystem.sigLaserError += LaserSystem_sigLaserErrorHandler;
LaserSystem.sigLaserEnd += LaserSystem_sigLaserEndHandler;

}

 

private void Form1_FormClosed(object sender, FormClosedEventArgs e)
{
if (Laser != null)
{
Laser.release();
}
}

 

private void ExecuteButton_Click(object sender, EventArgs e)
{
if (LaserDocument != null)
{
bool brc = LaserDocument.execute(true, true);
if (brc)
{
AddMessage("Marking started!");
}
else
{
AddMessage("Marking FAILED");
}
}
}

 

As you may see, the used classes (in Labview methods) are samed used as in my program (as exception of "Laser = new LaserAxApp();", which I didn't know how to translate in Labview comand)

 

Tell me what kind of stuff I can try out live.

0 Kudos
Message 27 of 47
(1,451 Views)

hey!,

 

any updates?

0 Kudos
Message 28 of 47
(1,421 Views)

Your LabVIEW code does not match the C# example code. Note the C# code:

// Get an instance of System
LaserSystem = Laser.System;

So, you should duplicate this in the LabVIEW code. To get the reference to System in LabVIEW, use a property node on the reference to LaserAxApp. Right now you are opening a new reference to System, which won't necessarily be connected to the LaserAxApp, and therefore probably won't work. Also, if you have working LabVIEW code where you're using an ActiveX container, why would you expect this to work when it's not in a container?

 

Is the development computer on the same network as the computer that's connected to the laser? If so, you can use remote debugging to debug the code in the development environment without installing LabVIEW on the laser computer.

Message 29 of 47
(1,375 Views)

Hey, thanks for that. I noticed it later on, and changed as well. But I think that didn't fix the problem. (although was a real good correction!)

 

About the two ActiveX programs, the one that is working with a container is for manipulating an X-Y board (which is working), and in the laser program which is only using Refnums should be working only with triggering signals.

When I get the two programs working, I will use the signals created from the container program and use to trigger the refnum program.

 

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

 

0 Kudos
Message 30 of 47
(1,353 Views)