LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX with Labview ???

Does anybody know, how can I implement following Visual Basic (AktiveX) code
in Labview ???


Call CANapeApplication.Open(WorkingDir.Text, 0)
Set CANapeDevice = CANapeApplication.Devices.Add(Devicename.Text,
ASAP2.Text, Driver.Text, Val(Channel.Text))
0 Kudos
Message 1 of 4
(3,144 Views)
> Call CANapeApplication.Open(WorkingDir.Text, 0)
> Set CANapeDevice = CANapeApplication.Devices.Add(Devicename.Text,
> ASAP2.Text, Driver.Text, Val(Channel.Text))
>

Drop down an Automation Open node. Popoup on the to left and create a
constant for the type. This should give you a list of the automation
servers, the typelibs registered on the computer. In that list you
should find CANapeApplication, or something similar.

From that node, you can wire to an invoke node to select and call
functions like Open, and you can wire it through that node to a property
node to set properties.

Greg McKaskle
0 Kudos
Message 2 of 4
(3,144 Views)
"Greg McKaskle" schrieb im Newsbeitrag
news:3D86794C.1090708@austin.rr.com...
> > Call CANapeApplication.Open(WorkingDir.Text, 0)
> > Set CANapeDevice = CANapeApplication.Devices.Add(Devicename.Text,
> > ASAP2.Text, Driver.Text, Val(Channel.Text))
> >
>
> Drop down an Automation Open node. Popoup on the to left and create a
> constant for the type. This should give you a list of the automation
> servers, the typelibs registered on the computer. In that list you
> should find CANapeApplication, or something similar.

I have tried both automation server (Application and Devices) with the open
node.
The Application part works well. I can start the application with open
methode
but the Device part returned an ERROR
( "Exc
eption occured in CANape.Devices.1, CDevices.Add() - No valid handle.
in COM_001.vi" )

I think there could be a difference between call and set -order.
Does another node than the open node exist (especially for set)?
(Set CANapeDevice = CANapeApplication.Devices.Add(Devicename.Text,)




>
> From that node, you can wire to an invoke node to select and call
> functions like Open, and you can wire it through that node to a property
> node to set properties.
>
> Greg McKaskle
>
0 Kudos
Message 3 of 4
(3,144 Views)
> ( "Exception occured in CANape.Devices.1, CDevices.Add() - No valid handle.
> in COM_001.vi" )
>
> I think there could be a difference between call and set -order.
> Does another node than the open node exist (especially for set)?
> (Set CANapeDevice = CANapeApplication.Devices.Add(Devicename.Text,)
>

I'm not much of a VB user, so I was assuming that the Set was basically
a redundant assignment of the variable CANapeDevice to the value
returned from the method Add. Another assumption is that if you are in
a function associated with a class, that the CANapeDevice isn't a
variable, but a data member of the class.

Anyway, be sure to single step and look at error outputs each step of
the way. If an earlier method fails, but the error i
s not wired out and
into the next node, downstream nodes will try to execute on the invalid
results from the earlier nodes and will produce secondary errors which
are essentially a wild goose chase. So always wire the errors from each
and every property and invoke node to something. Even if it is just to
something that will put up a debugging dialog on error and then clear it.

Other than that, I'm assuming that something must be wrong with an input
to a method node, or something is out of whack with other configuration
on the machine or the CAN device.

Greg McKaskle
0 Kudos
Message 4 of 4
(3,144 Views)