How to access Call Back Functions using *.dll in the Labview?
Hai,
I am Pavan Ram Kumar Somu.
I am new to Labview, currently I am working on MVB Interface.
I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
1. Pointer Arguments(To which memory it points in Labview)
2. function pointers Arguments
3 .pointers in structures and pointer structures in structures and many other data types.
Please Answer the below queries also:
1. How to pass pointer arguments to API functions in DLL and how to collect pointer
return types from API functions in DLL
2. How to pass structure arguments to API functions in DLL and how to collect structure
return types from API functions in DLL
3. How to use callback functions(nothing but function pointers) in Labview and how to
collect callback fuctions return types from API functions in DLL
I need your help while passing these datatypes to API functions in DLL from labview.
Suggest me if there is any other alternative for implementing this task.
I am referencing some examples here:
Examples:
I)
Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
II) #include <windows.h>
#include <process.h>
HANDLE rcvEvent0, rcvEvent1;
/* Function call*/
CanGetReceiveEvent(handle[0], &rcvEvent0);
Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
With regards
Pavan Ramu Samu
"Somu" <[email protected]> wrote in message news:[email protected]...
Hai,
I am Pavan Ram Kumar Somu.
I am new to Labview, currently I am working on MVB Interface.
I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
1. Pointer Arguments(To which memory it points in Labview)
2. function pointers Arguments
3 .pointers in structures and pointer structures in structures and many other data types.
Please Answer the below queries also:
1. How to pass pointer arguments to API functions in DLL and how to collect pointer
return types from API functions in DLL
2. How to pass structure arguments to API functions in DLL and how to collect structure
return types from API functions in DLL
3. How to use callback functions(nothing but function pointers) in Labview and how to
collect callback fuctions return types from API functions in DLL
I need your help while passing these datatypes to API functions in DLL from labview.
Suggest me if there is any other alternative for implementing this task.
I am referencing some examples here:
Examples:
I)
Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
II) #include <windows.h>
#include <process.h>
HANDLE rcvEvent0, rcvEvent1;
/* Function call*/
CanGetReceiveEvent(handle[0], &rcvEvent0);
Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
With regardsPavan Ramu Samu
Search the forum (forums.ni.com) for callback, pointer or handle, and you'll find that it is all possible, but not very easy.
e.g.: http://forums.ni.com/ni/board/message?board.id=170&message.id=88974&requireLogin=False
Regards,
Wiebe.
Similar Messages
-
How do I call a function using local connection?
I have 3 Flash banners on 1 page that run through a synched animation together. At the end of the animation, there is a replay button in each of the 3 banners. I want the replay button when clicked in any of the banners to call a replay function in all 3 banners. Is there any easy way to do this? Using localconnection?
The banners are already using a local connection for the syching of the animation, if that helps.
Thanks!
ElliottI take it back... I figured it out. I just needed to paste the function below into each of the other banners...
Thanks! :-P -
How to unrigister the call back function,in vb6 with DAQmx 8.5
I use daqmx api which named DAQmxRegisterEveryNSamplesEvent to register my call back function,When I invoke the function DAQmxErrChk (DAQmxStopTask(taskHandleAnalog)) to stop my Task.then i call the procedure AD_OPEN again,it raise an error ,tell me that i need to unregister the event,the data has transfer into the buffer.how can i unregister the event,please look at the following code.
Spoiler (Highlight to read)
Private Sub create()
Dim channel As String
Dim minVoltage, maxVoltage As Double
Dim samplesPerChannelPerRead As Double
Dim sampleMode As Long
Dim boolVal As Boolean
On Error GoTo AdErrorHandler:
' Get values from UI controls
channel = "Dev2/ai1:2"
minVoltage = -10
maxVoltage = 10
samplesPerChannelPerRead = 100
If (taskHandleAnalog <> 0) Then
DAQmxErrChk (DAQmxStopTask(taskHandleAnalog))
DAQmxErrChk (DAQmxClearTask(taskHandleAnalog))
taskhandle = 0
End If
' Configure the task
DAQmxErrChk (DAQmxCreateTask("", taskHandleAnalog))
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleAnalog, "Dev2/ai0", "", DAQmx_Val_InputTermCfg_RSE, minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString))
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandleAnalog, channel, "", DAQmx_Val_InputTermCfg_Diff, minVoltage, maxVoltage, DAQmx_Val_VoltageUnits2_Volts, vbNullString))
End Sub
Private Sub AD_Open()
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandleAnalog, "", 200, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_ContSamps, samplesPerChannelPerRead))
'Find number of samples specified
DAQmxErrChk (DAQmxGetTaskNumChans(taskHandleAnalog, numChannels))
'Configure Event Callbacks
DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandleAnalog, 1, 4, 0, AddressOf EveryNSamplesEventHandler1, Nothing))
ReDim dataBuffer(numChannels * samplesPerChannelPerRead - 1)
' Start the DAQmx Task
' DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandleAnalog, "/Dev1/PFI2", DAQmx_Val_Edge1_Falling))
DAQmxErrChk (DAQmxStartTask(taskHandleAnalog))
' Update UI
Exit Sub
AdErrorHandler:
MsgBox Err.Description
End SubThis may be a bit late, so hopefully you found this on your own. But in order to unregister the event pass a null value for the callback function parameter in the DAQmxRegisterEveryNSamplesEvent function (Nothing in VB).
National Instruments
Product Support Engineer -
How do you call a function within a package using OCI in C
I am trying to call a user-defined function in Oracle 8.1.7 using OCI in C. I am getting a ORA-06550 PLS-00221, <function name> is not a procedure or is undefined. Can anyone tell me how I would call a function using OCI?
Thanks.I think I figured it out, but I am now getting a ORA-06512 error; numeric or value error: character string buffer too small.
-
Can I call a function using array index?
I've defined an array which stores the function name, like this:
var aresetButtonTop:Array = new Array(resetTop1,resetTop2,resetTop3,resetTop4,resetTop5);
Then I have a button named"btnresetTop" which when clicked will call one of the five functions stored in the above array(aresetButtonTop). The functions are called at run-time depending upon some conditions. I need to figure out how I can call those functions using the array index. I'm using the following code to call the function. The value of i has been already calculated.
btnresetTop.addEventListener(MouseEvent.CLICK, aresetButtonTop[i]);
After doing this I'm getting the following error when I click the button:
TypeError: Error #2007: Parameter listener must be non-null.
at flash.events::EventDispatcher/addEventListener()
at gallerytest_fla::MainTimeline/thumbTopClick()
Note: thumbTopClick() is a function inside which all these codes are written.
I need to find out whether it is posible in AS3 to call a function name using the array index or not. If yes, could you pleas ehelp me out.Thanx Andrei1, you were right, i was out of range.The value of i will obviously expire outside the for loop. Now I have corrected my mistake by assigning the value of i to a variable index inside the for loop and then use the following code:
btnresetTop.addEventListener(MouseEvent.CLICK, aresetButtonTop[index])
It was a silly mistake but I was not able to figure it out for the last 2 hours. Thanks once again for your help -
How to use call back function ?
i have MlEditmanager class which extends xyzManager class. I also want to extend Eventdispatcher .. but it is not possible to extend more than one class ...
so the work around can be to create call back function. private var xyz:Function; --> how to use this syntax?
Can someone help me how to achieve this?
Urgent pls.Hi
check out this link
http://rushmeflex.blogspot.com/2010/09/cairngorm-2-view-notification.html
Though this is not your requirement, however in the source code callback functions are used. You can get clue from that.
Hope this helps
Rush-me -
How do you call a function in an attached MovieClip from the current MovieClip?
Hi there,
I have this MovieClip A (converted as a symbol) and put in my
main MovieClip B using attachMovie() , and I am wondering how I can
call a function defined in A from within B.
Is it possible?
ThanksHi kglad,
yes, I did the attachMovie of the symbol B and it seems like
none of the ActionScript written in B was not carried over.
This is how I built B into a symbol :
(1) Two layers ( one for the ActionScript only, the other for
the Components)
(2) I defined the functions to be called remotely by A in the
ActionScript layer
(3) I selected all the components in the Components Layer and
did a Convert To Symbol
(4) I added the Symbol into A's Library
(5) I used attachMovie to instantiate the Symbol of B
I must have missed out something somewhere
Thanks -
How to access (call) variables from multiple components
I have what I think is a basic task, but I cant seem to get it to work. I have a Flex project with one application. In addition to the one application, I have many components that are used in the application. These components vary from simple (a ComboBox) to complex (many sub-components). What I need to do is define a viable in one component and access it in another component. I can't seem to do this. Below is an example of how I think it should be:
Component1
<mx:Script>
<![CDATA[
[Bindable]
private var userID:int=0;
]]>
</mx:Script>
Component2
<mx:TextInput text="{Component1.userID}"/>
Any help you can provide would be beneficial.
LeeHello,
You may also want to consider using the mx.core method.
In your main application script area define all of your public variables and functions. Then from your component, you can reference these absolutely with the following syntax.
<!-- Main App -->
[Bindable]
public var userID:int;
<!-- Component -->
private function init():void {
var com_UserID = mx.core.Application.application.userID;
Using this method ensures that you will have access to any Function or variable within the scope of the project.
Kind Regards,
Dr. Ivan Alexander, Ph.D.
Sr. Applications Engineer
FlexAppsStore.com
Sun Microsystems
MySQL Enterprise Ready Partner 2009 -
I upgraded to version 5.0 but am unable to use because it is not supported with my online college platform. How can I go back to using version 4.0? If I do not find a solution I will have to find a new browser.
I had the same problem (issue with Google Apps and XUL runner etc) of needing to downgrade. To pull it off I went to the main Firefox download page (http://www.mozilla.com/en-US/firefox/new/) and followed the link to OTHER SYSTEMS AND LANGUAGES which took me to a page that included a link on the right hand side to download Firefox 3.6.16.
(The stuff below pertains to Windows. If you are on a different OS your steps will vary)
To do the actual downgrade (and there may be some other steps that would be wise to take but this is what worked for me) I merely renamed "c:\Program Files\Mozilla Firefox" to "c:\Program Files\Mozilla Firefox bad" (in case I want to try troubleshooting the issue later) and then ran the "Firefox Setup 3.6.16.exe" file that downloaded from that link. That solved my problem and I'm back and running 3.6.16.
In case you don't feel comfortable changing things in your Program Files directory you might try a different approach and try uninstalling via the Control Panel and Add and Remove Programs (or whatever it is called on the version of Windows you are on) and then running the installation file. I didn't go that route so I can't tell you how well that might work. -
Hi All,
I need to implement a HTTP call back functionality to do a handshake between my portal and a 3rd party application.
Framework: Oracle ADF
Application server: Weblogic 10.3.6
1. We will do a HTTP POST (that includes a token for validation purpose) from our portal to a 3rd party application, lets say, XAPP.
2. Then the XAPP will make a call back using the call back URL of our portal. When they do the call back, they include the token that we provided to them in Step1.
3. We need to accept the call back request and validate the token. After this I need to resume with the response processing from the initial POSTing session.
4. After all the validations, I need to open XAPP's URL in a browser.
Here the main catch is to keep the initial POSTing session alive(waiting) while accepting the call back request and then continue with the response processing from the initial POSTing session.
Thanks for your help.Hi,
make sure to post this to the WebCenter forum too as i would assume they more likely have this as a requirement too
Frank -
How get recent call back (because of I change password form other device)
I use iphone 5 and ipad2
all devices use same apple id
I change apple id(password) on ipad
my recent calls in iphone are lost but i cant remember one important number
How get recent call back ? i sign in my apple id on my iphone too but it not work.If you have previously employed Create and delete iPhone, iPad, and iPod touch backups in iTunes - Apple Support, then restoring using iTunes should do the trick.
From the above article (emphasis is mine):
What iTunes backs up
SNIP
Contacts* and Contact Favorites. (You should regularly sync your contacts to a computer or cloud service, such as iCloud.)
SNIP
*Your contacts are part of the backup to preserve recent calls and favorites lists. To avoid any potential contact data loss, back up your contacts to a supported personal information manager (PIM) or another cloud-based service (such as Gmail or Microsoft Exchange). You can also make a copy of contacts that are in iCloud. Learn about backups in iCloud.
ÇÇÇ -
Dear Forum
I was using Adobe version XI and the signature feature disappeared from the menu. Now I downloaded Acrobat Reader DC. Using the menu and instructions I created a signature ID and customized the signature; however, when I go to sign a document it only shows the name layout or graphic image? How do I go back to using the certificate that I created?
Any help would be greatly appreciated.
Regards
CarlosFirefox works fine on Windows 2000 SP4 for me.
Any chance you have a dial-up connection that uses a web accelerator to speed the loading of content? -
Apple recently replaced my broken iPhone 5 with a new one. I backed up the contents of my phone with iCloud.
When setting up my new phone I used an iCloud back up from an earlier date. Now I am missing some of my most recent stuff. How
Do I go back to use the proper iCloud back up to set up my new phone?Tap settings> general> reset> erase all content and settings...then you'll have a chance to setuo your phone again
-
How can I call a function from a procedure
I have a function named: f_calc_value which return the variable v_result. This function is part of a package.
How can I call this function from a new procedure I am creating?
Thanksor refer this theread....calling function from procedure
-
How can we prevent back button using java script
how can we prevent back button using java script
Would be quicker for you to google for javaScript
javascript:window.history.forward(-1);
Maybe you are looking for
-
Greetings, I'm able to see and connect to my MacBook (early 2008) from my iMac, but not the other way around. File share is on and match. Any solutions?
-
Authorization Issue with infotype
Dear Guru's, There are a couple of Customer IT that have been created. For which I have also assigned the authorization. But for some of these Infotypes though the user has no authorization he is able to access it. Can you guys give
-
How do I write complex numbers to an excel or text spreadsheet file.
I am performing an FFT on 3 channels of simultaneous analog input. I want to write the resultant 3 complex numbered arrays to a spreadsheet. Do I have to seperate the a and b*i components into r and theta and write two columns per array or is there a
-
Combining projects in to a one.
I am trying to convert finished projects back in to AVCHD files to be combined in to one HD project. For some reason, the conversions to not contain the audio, just static type noise. The original projects were done with Pe9. I now have and am usin
-
Disable user cache on terminal servers
When users start reader XI on terminal server, it generates files in %appdata%\adobe\acrobat\11.0\cache, about 15 MB. It seems to be som fonts and other stuff?? As our user profiles are limited in size to 30 MB, it gives us some troubles. Is there an