Getting clusters from LabVIEW ActiveX Server with Excel/VBA
Hello,
my colleague and I are trying to control a LV from Excel (VBA) by ActiveX.
I.E.:
We do something like :
Set LV = createObject("LabVIEW.Application")
Set VI = LV.GetVIReference("Path_to_VI")
ParamNames(0) = "Input1"
ParamNames(1) = "Input2"
ParamNames(2) = "Output"
ParamValues(0) = 1
ParamValues(1) = 3.1415
Call VI.Call(ParamNames,ParamValues)
msgbox("output =" & ParamVals(2))
This works perfectly for simple data types (int, double, float, string, etc )
Now we need to transfer more complex structures, which are originaly LV-clusters.
But we did not find any clue on how do that (especially receive clusters) in the help or on the internet.
Is there any chance to succeed ???
TIA,
Thomas
Actually, working with clusters is really really easy. Through the magic of - well something - a cluster in LV comes out in the VBA environment as an array of variants. There was an activex example that shipped with V7.1 that showed this very thing. I couldn't find them in V8 so here is the 7.1 stuff.
Check out the macros in the Excel spreadsheet... This show running the VI in the development environment, but if this looks interesting I can fill you in on how to make it work in an executable.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps
Attachments:
freqresp.xls 49 KB
Frequency Response.llb 155 KB
Similar Messages
-
Calling LabView ActiveX Server from TCL?
Does anyone have experience calling a LabView ActiveX server vi from
TCL? I created a simple VI with one control (labeled "A") and one
indicator (labeled "B") and a +1 adder between them. I can load and
open the VI from TCL:
package require tcom
set lv [::tcom::ref createobject "LabView.Application"]
set viPath "D:\\National Instruments\\LabView\\Activity\\a.vi"
set vi [$lv GetVIReference $viPath]
$vi FPWinOpen True
But when I try to send in data:
$vi -namedarg Call A 1
I get the error message "unknown parameter A".
I have also attempted to duplicate the "ActiveX Server" example
from the LabView help file, calling "Frequency Response.vi". This
approach encounters the same error message:
% package require t
com
3.0
% set lv [::tcom::ref createobject "LabView.Application"]
::tcom::handle0x013202F4
% set viPath "D:\\National
Instruments\\LabView\\examples\\apps\\freqresp.llb\\frequency
Response.vi"
D:\National Instruments\LabView\examples\apps\freqresp.llb\frequency
Response.vi
% set vi [$lv GetVIReference $viPath]
::tcom::handle0x01335AE8
% $vi FPWinOpen True
% $vi -namedarg Call Amplitude 10
unknown parameter Amplitude
If anyone can point me in the right direction, or give me an
example of how to do this I would greatly appreciate it.
TIA.
LeslieIn article ,
Leslie Brooks wrote:
>"Bruce Hartweg" wrote in message
>news:...
>> "Chin Huang" wrote in message
>news:[email protected]...
>> >
>> > I don't use LabView, but from the Visual Basic example I saw, it seems
>> > the Call method takes two arguments. The first is an array of parameter
>> > names and the second is an array of parameter values. Try to send in
>> > data with the Tcl command
>> >
>> > $vi Call [list A] [list 1]
>>
>> I'm unable to help the original question (don't know LAbView or VB stuff) but
>> just want to point out that [list A] is equal to A and [list 1] is the
>same as 1.
>>
>> Bruce
>
> I know what is supposed to be passed to the 'Call' method. Doing
>this:
>
>set inst [::tcom::info interface $vi]
>$inst methods
>
> produces (among other things):
>
>{1015 VOID Call {{{in out} {VARIANT *} paramNames} {{in out} {VARIANT
>*} paramVals}}}
>
> So the 'Call' method is expecting two parameters, both pointers
>to variants. TCOM appears to be passing the correct parameter type
>because the TCOM documentation says that a TCL List maps to a
>one-dimensional array of VT_VARIANT. However, the results are
>INvariant (bad pun intended):
>
>% $vi -namedarg Call Amplitude 10
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list 10]
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list [::tcom::na]]
>unknown parameter Amplitude
>% set i 5
>5
>% $vi -namedarg Call [list Amplitude] {incr i}
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list [incr i]]
>unknown parameter Amplitude
>% $vi -namedarg Call Amplitude [incr i]
>unknown parameter Amplitude
>
> Who can help me with this? Who is the LabView Guru?
Try invoking the Call method without the -namedarg option. The
-namedarg option doesn't work the way you seem to think it works. The
-namedarg option provides a way to specify arguments named from the
method's parameter specification. For example, you discovered that the
Call method take two parameters named "paramNames" and "paramVals".
Tcom returns the error "unknown parameter Amplitude" because "Amplitude"
doesn't match either parameter name. -
Trying to use FTP to get data from a different server
Hi Friends,
I have to use FTP to get data from a different server and upload it on SAP server. Now my problem is when I m trying to do ftp through command line it brings the file but with no data.
Through ABAP program nothing is happening.
Here's my code--
V_PASSWORD = 'test@123'.
V_PWD_LEN = STRLEN( V_PASSWORD ).
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = V_PASSWORD
SOURCELEN = V_PWD_LEN
KEY = CS_KEY_500098
IMPORTING
DESTINATION = V_PASSWORD.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
USER = 'test'
PASSWORD = V_PASSWORD
HOST = '176.0.1.6'
RFC_DESTINATION = 'SAPFTPA'
IMPORTING
HANDLE = MI_HANDLE
EXCEPTIONS
NOT_CONNECTED = 1
OTHERS = 2.
CHECK SY-SUBRC = 0.
cmd = 'lcd d:\ftp'. .
PERFORM FTP_COMMAND USING CMD.
CMD = 'asc'.
PERFORM FTP_COMMAND USING CMD.
CONCATENATE 'dir' 'ftpt*' INTO CMD SEPARATED BY SPACE.
PERFORM FTP_COMMAND USING CMD.
cmd = 'ls'.
concatenate 'ls' INTO CMD SEPARATED BY SPACE.
PERFORM FTP_COMMAND USING CMD.
cmd = 'mget trial.txt'.
CONCATENATE 'mget' 'trial.txt' INTO CMD SEPARATED BY SPACE.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = MI_HANDLE
COMMAND = CMD
TABLES
DATA = MTAB_DATA1
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0.
LOOP AT MTAB_DATA1.
WRITE: / MTAB_DATA1.
ENDLOOP.
ELSE.
CONCATENATE 'Error in FTP Command while executing' CMD INTO ERROR SEPARATED BY SPACE.
WRITE: / ERROR.
ENDIF.Hi
try this.....in one of my reqt, i done this successfully....
FORM FTPCON.
FTP-------------------------------------------------------*
CLEAR DSTLEN.
SET EXTENDED CHECK OFF.
DSTLEN = STRLEN( S_PWD ). -
> (S_PWD (password) is a selection screen field )
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = S_PWD
SOURCELEN = DSTLEN
KEY = KEY
IMPORTING
DESTINATION = S_PWD.
CALL FUNCTION 'FTP_CONNECT'
EXPORTING
USER = P_USER -
> Username
PASSWORD = S_PWD -
> password
HOST = P_HOST -
> Host
RFC_DESTINATION = P_DEST -
> Destination
IMPORTING
HANDLE = HDL
EXCEPTIONS
NOT_CONNECTED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_COMMAND'
EXPORTING
HANDLE = HDL
COMMAND = 'set passive on'
TABLES
DATA = RESULT
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = G_FCNAME
CHARACTER_MODE = 'X'
TABLES
TEXT = T_FILE1
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = HDL
FNAME = G_FCNAME1
CHARACTER_MODE = 'X'
TABLES
TEXT = T_FILE2
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
HANDLE = HDL.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
DESTINATION = P_DEST
EXCEPTIONS
DESTINATION_NOT_OPEN = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " FTPCON
Hope it helps..... -
Using LDAP from 10.5 Server with Joomla
Has anybody successfully used the LDAP from 10.5 server with Joomla?
Here is another post in Joomla's forums asking the same thing
http://forum.joomla.org/viewtopic.php?f=473&t=260357I've had some success with the LDAP integrated into Joomla 1.5. Although, Joomla currently appears to require an email address during validation. So, if you don't have email addresses in the OSX LDAP database, a user can not fully login even if the username and password is correct).
Here are my sanitized settings
Host: hostname.domain.tld , e.g. [email protected]
Port: 389
LDAPV3: yes
Negotiate TLS: no
Follow Referrals: no
Authorization Method : "Bind and Search"
BaseDN: cn=users,dc=hostname,dc=domain,dc=tld , e.g. dc=myserver,dc=mydomain,tld=com or whatever OD LDAP is set for.
Search String : uid=[search] // I do not know if this is valid.
UserDN: uid=[username],dc=hostname,dc=domain,dc=tld
Connect username:
Connect password:
Map full name: cn
Map email : email
Map userid : uidnumber
When you enable the module, you should see an OD LDAP log entry
Something like
May 29 2008 19:04:33 USER: {0x4230826a3fffffff0000000f0000000a, username} is the current user.
May 29 2008 19:04:33 AUTH2: {0x4135826cffffffff0000000a0000000a, username} CRAM-MD5 authentication succeeded.
May 29 2008 19:24:11 RSAVALIDATE: success.
If you don't get any log messages, LDAP has rejected the query outright.
Regards,
Jay Vicory -
How Do I set up a LabView ActiveX server?
Are there any documenation or sample program which is about how to setup a LabView ActiveX server? my C++ program will dynamically call VI and then pass the integer to Labview program via ActiveX and then perform some control of digital oscillscope. Do anyone help me? thanks for help so much......It is in hurry......please help..............
CowCowFrom the NI knowledge base...
Problem: How do I enable LabVIEW as an ActiveX Server?
Solution: Under Edit >> Preferences >> Server: Configuration, select ActiveX as a protocol and enable all server resources. Under Edit >> Preferences >> Server: Exported VIs, list the name of all VIs that can be accessed remotely. You can include the full path to the VI, or just list its name. Wildcard characters are valid. You can explicitly deny access to certain VIs by clicking the Deny Access button. Note that changes to the Server will not take effect until LabVIEW is relaunched. -
How do i get contacts from iphone to merge with outlook contacts
how do i get contacts from iphone to merge with outlook contacts
If Outlook already has a munch of contacts, do I need to delete them all (all but 1 unique) to sync correctly?
I have and iPhone ith up to date contacts, and I have outlook with some of the same contacts with older info. When I sync, outlook is OK, but I get a lot of copies of the same contact on my iPhone. Now I'm not entirely sure which are the up-to-date contacts and which aren't (and there's hundred of contacts to go through).
...For future reference, is there a way to to send the iPhone contacts to Outlook without adding crap to my phone? Amidst the sync process I noticed and option for conflicting files and choose the "always use phone" but still wound up with a contact mess of mixed old and new on the phone. -
Issue listeneing queue from Weblogic Cluster server with multiple managed server
Haveing issue listeneing queue from Weblogic Cluster server with multiple managed server.
Weblogic Cluster structure is like
Weblogic Cluster01
--ManagedServer01(http://server01.myhost.com:7001)
--ManagedServer02(http://server02.myhost.com:7001)
JMS Servers
JMSserver01 targeting: ManagedServer01
JMSserver02 targeting: ManagedServer02
JMSmodule
ConnectionFactory01 targeting:JMSserver01,JMSserver02
UDQueue01 targeting:JMSserver01,JMSserver02
Uniform Distributed Queue in Monitoring tab showing like this
mysystemmodule!JMSserver01@UDQueue01
mysystemmodule!JMSserver02@UDQueue01
So when I am sending message to any Host(by specifying the provider URL) its distributing equally on both server like
mysystemmodule!JMSserver01@UDQueue01 10
mysystemmodule!JMSserver02@UDQueue01 10
But when try to listen message from these queue, it is listening from one server, for which URL given to connect.
mysystemmodule!JMSserver01@UDQueue01 0
mysystemmodule!JMSserver02@UDQueue01 10
untill I connect to other server by giveing its URL, will not able to access other message left on the queue.
Solutions that tried
1) we have tried give both server URL coma sparated in provider URL
we need to configur same scenario for 5 managed server with 3 listener on other servers.
Do any one have solution for this.You need to have:
1. Consumers connected to each UDQ member
OR
2. If no consumers in some of the members is expected, you can configure Forward Delay (specify the amount of time, in seconds, that a queue member with messages, but with no consumers, will wait before forwarding its messages to other queue members that do have consumers):
http://docs.oracle.com/cd/E12839_01/apirefs.1111/e13952/taskhelp/jms_modules/distributed_queues/ConfigureUDQGeneral.html
For example you can set it to 10 (10s)
Additional Information here:
http://docs.oracle.com/cd/E23943_01/web.1111/e13727/dds.htm#i1314228
http://docs.oracle.com/cd/E23943_01/apirefs.1111/e13951/mbeans/DistributedQueueBean.html?skipReload=true#ForwardDelay
How Does JMS Load Balancing Work with Distributed Queues and Uniform Distributed Queues? (Doc ID 827294.1)
I hope this helps
Best Regards
Luz -
Labview- .EXE file with excel template
How to create a .exe file from the .vi file with excel template. Since I am giving only .exe file, the client wont be having the excel templates. So please tell me how to build a .exe file with templates which will be invoked by mainfile.vi. Please let me know if U guys know. (Now in my mainfile.vi I am using local file location path to invoke)
Hi saamy,
I have tested it out at my PC and it is working.
I have tested with MS office report and put the template "Excel Template.xlt" under VI's folder (C:\temp) and make the exe file.
After the exe file has been moved to other place(C:\build) and has been executed, the exe file try to locate "Excel Template.xlt" under both C:\temp and C:\build. As long as the template is the same folder with exe file, it is working.
Pls refer to attached file.
Hopefully it will help. Please let me know the result.
Thanks & Regards,
Steve
Attachments:
My Application.zip 4415 KB -
How BW get data from MS SQL server DB?
I got infomation about this from help.com, http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm.
this web told me, when BW application server must be Win NT.BW can get data from MS SQL server DB.
but our BW application server was AIX.
Did you know other solution to this?Hi,
you need to use the DBConnect or in BI7.0 the UDConnect features.
regards
Siggi
See also: http://help.sap.com/saphelp_nw70/helpdata/EN/a1/89786c3df35c4ea930a994e884bb4c/frameset.htm
or
http://help.sap.com/saphelp_nw70/helpdata/EN/44/bcdce1dcaf56a3e10000000a1553f6/frameset.htm
Edited by: Siegfried Szameitat on Aug 13, 2008 9:16 AM -
Hello,
I'm working with Excel VBA and I have a 6024E card. I'd like to know where I can download the CW DAQ 3.0.1 and if there is a documentation describing the functionality of the CW DAQ.
With kind regards
Alexander HeßHello Alex,
you are able to use 3 different drivers for the device.
DAQmx,Traditional DAQ or DAQmx Base.
I didnt found any 3.0.1 version.
Only a 3.1 version of the DAQmx Base driver.
http://joule.ni.com/nidu/cds/view/p/id/970/lang/de
Here a link to the DAQcard overview with the latest driver software: http://zone.ni.com/devzone/cda/tut/p/id/6910#eseries
Kind regards,
Elmar -
Labview activex server registration incomplete.
I made an ActiveX server using LabVIEW. The server should communicate with Excel. During installation of the server I register the server: "Server.exe /RegServer". When I try to call the server from Excel/VBA, it responds with "Run-time error '429': ActiveX component can't create object". The server is only recognized by Excel after I have started and stopped the server once.
When investigating the registry, it appears that the difference between registering with /RegServer and just starting and stopping the server are the following registry keys:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ServerName.Application
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ServerName.Application.6
To my opinion the /RegServer commandline option does not do the whole job.
Also /UnRegServer does not remove the above mentioned registry keys.
Is this a bug or just normal behaviour?
Has it been solved in newer LabVIEW versions (I use 6.0.2)?Hi,
I've tried to call a with LabVIEW 7.1.1 created activeX server. This works without any errors. I've attached my code.
As for the register keys, this seems to be the default behaviour of ActiveX, each server has a key without version number e.g.
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ServerName.Application
And one or more with a version number:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ServerName.Application.6
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ServerName.Application.7 Kind regards,
Karsten
Applications Engineer
National InstrumentsMessage Edited by KvZ on 07-27-2005 02:37 PM
Attachments:
ActiveX Server.zip 45 KB -
Starting applications remotely using LabView activeX server
I want to
make a program that enables me to start applications on a remote computer. I
made a program that starts applications using either System exec.vi or .NET and
both methods work find on my local computer. I built it with activeX server
enabled and copied it to my remote computer. After struggling with DCOM
settings and Security settings for a couple of days!! I’m now able to start the
program from my local computer. The thing is that I can’t see either the
LabView program or the started application. When opening the Windows Task
Manager, I can see both the programs under the Process tab so they have
started, but obviously as a “background” process and not as an application.
Does anyone
have an idea on how to start the programs as applications?Why not just use PsExec?
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx -
Labview ActiveX Server PATH if in developmen​t environmen​t
I'm using Labview 2010 to build an ActiveX server. I can access the executable as an activeX sever from both C and LabVIEW clients. No problems there. But now I want to do some debugging in the development environment while accessing the program via an ActiveX client. In such a situation, how do I change how I access the VI's in the project? I tried using the lvproj in place of the EXE, but this was insufficient. Seems a little convoluted with the changes required to do this debugging.
I think that I already have my answer in that I can not generate a LV event through an ActiveX interface regardless of the type of control, but if you want to play with it, here is a Demo which I derived from the previous link given above. Within the attached ZIP file, read the "Readme.txt" file for instructions. Specifically the program assumes that is located in C:\tmp, since LabVIEW doesn't like relative pathes in both the build and reference node paths, (so they are coded with absolute pathes). If you use C:\tmp, the instruction in Readme.txt should work.
What happens is that you click on the button in the ActiveX Client running in the LV development space.
You can see the control value change shade/color in the ActiveX Server EXE application,
but because no event is generated, the Event Handler does nothing.
I know that I can poll the value of the control and then use the Value (Sgnl) property control to generate an event, but this isn't a very clean solution.
All code in the ZIP file is LabVIEW 2010 release1
Attachments:
LV ActiveX Demo.zip 172 KB -
Making ActiveX Server with App Builder
OK I am writing a program in C++. I want the GUI to be in Labview and I need the C++ program and Labview GUI to communicate. So I used the app builder to create an ActiveX Server. So how do I use this? Do I use the GUI.tlb instead of the normal labview.tlb? Do I still create an application reference to Labview or do I create an application reference to GUI.exe since this is my executeable now? I can't find much documentation on this at all... Please help!
> OK I am writing a program in C++. I want the GUI to be in Labview and
> I need the C++ program and Labview GUI to communicate. So I used the
> app builder to create an ActiveX Server. So how do I use this? Do I
> use the GUI.tlb instead of the normal labview.tlb? Do I still create
> an application reference to Labview or do I create an application
> reference to GUI.exe since this is my executeable now? I can't find
> much documentation on this at all... Please help!
Switch over to using the GUI components that you mention. Think of it
this way, your C++ program could need to use both LabVIEW and GUI. For
that to work, most of the connection pieces have to be specific about
what they are dealing with.
Greg McKaskle -
Error retrieving data from the web server in Excel fo BPC
Hello Everybody,
I'm working with BPC v7.5 , i created some reports with the EVDRE formula and they were working perfectly.
The problem started when i created new users, that in fact have the same access profile and task profile as my user.
i started to test these new users in excel and every time i expand the report this legend appears: " EVDRE Retrying... EVDRE encountered an error retrieving data from the Web Server. Retrying in (X) Seconds...". After waiting a while a push cancel, then appears a window with the legend: Ev4excel Addin, Errors found retriening data.
The funny thing is that when i login back to my user everything works fine again, any idea what could be the problem? the other user have the same permissions.
Thanks a lot in advance!!
Nidia Olguívery strange. Normally the member access profile must be diifferent. So it is not important the task profile but the member access profile. Can you please double check ?
If you are doing a simple EVDRE with users having problems is it working or you still have problems?
Regards
Sorin Radulescu
Maybe you are looking for
-
Missing and duplicate entries in the calendar
I'm a long time (1997) Palm user who's moved to a BB 8330 last month. I can't seem to get calendar syncing to work correctly. In some instances, I am missing items on Outlook. I often have duplicate entries on the handheld. I've searched the forums a
-
PLEASE help with multi-cam edit issue (head about to explode...)
PLEASE believe me when I say I've watched 20 YouTube videos on the subject, read the manual, reinstalled FCS on a new machine (in the event that the install or my last MBP was at fault), etc., etc.... JUST can't get FCP to make the cuts for me when I
-
How noisy/quiet is new iMac with Retina 5K display?
How noisy/quiet is new 5K iMac compared to the standard display versions? I returned three 27" iMacs (3.5GHz Quad-core Intel Core i7) back in May because they were too noisy for me. Is this 5K machine any different?
-
I have all my music stored on a mac. I currently sync my ipod with the mac. I am now looking to purchase an iphone which I will need to synch with my windows pc and outlook express. Is there any way of synching the iphone with the pc for emails and c
-
How to Interface with IP in Kernel
I have a unique problem regd solaris network stack. I want to add a new protocol over solaris IP, say RIP. How can it be done ?? Does Solaris IP use the published NPI interface ?? or does it use some other published interface ?? Can we write a stream